×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 109736374, Entry date: 08/08/2016
(1)
Rate

In STEP 7 (TIA Portal), how do you configure the technology module TM Timer DIDQ for distributed operation in an ET 200MP or ET 200SP?

  • Entry
  • Associated product(s)
Follow the instructions below to configure the technology module TM Timer DIDQ in STEP 7 (TIA Portal).

In this example we configure the technology module TM Timer DIDQ 16x24V of the ET 200MP. The technology module TM Timer DIDQ 16x24V supports the following functions:

  • Time stamp acquisition (Timer DI):

    The technology module acquires the associated time stamp of an edge at a digital input. The time stamp specifies when an edge has been acquired in relation to a time base. These time stamps can be used to calculate a time difference, for example. The time stamp acquisition is based on the "Time-based IO" technology supported by the technology module and requires clock-synchronized mode.

  • Time-controlled switching (Timer DQ):

    Using time stamps permits very precise time reproducibility of controlled processes. With this function the technology module outputs edges at exactly defined times at the digital output concerned. The Timer function is based on "Time-based IO" and requires clock-synchronized mode.

  • Counting

  • Pulse width modulation (PWM)

  • Oversampling

The entry entitledWhich IO controllers and IO devices support in STEP 7 (TIA Portal) the following functions: IRT, prioritized startup, MRP, MRPD, PROFIenergy, Shared device, MSI/MSO, I device, clock-synchronized mode and option handling? which modules support clock-synchronized mode.

The instructions below show you how to configure the "Time-based IO" technology to achieve a defined response time between input and output in conjunction with a digital input. In this example we achieve a defined response time between an input and an output. This means that

  • The channel configuration "8 inputs, 8 outputs" is set.
  • The configuration of the DI module is set to the value "Use inputs individually".
  • For one input, DI0, for example, the "Timer DI" operating mode is set.
  • For one output, DO0, for example, the "Timer DQ" operating mode is set.

Hardware configuration

  1. In the Project tree, you double-click the "Devices & Networks" item. The "Devices & Networks" editor opens.
  2. Open the Device view of the ET 200MP and drag-and-drop the technology module TM Timer DIDQ16x24 from the Hardware Catalog into any slot of the ET 200MP.
      

    Fig. 1
     

  3. In the Device view of the ET 200MP you mark the technology module TM Timer DIDQ16x24. The properties of the technology module are displayed in the inspector window. In the "General" tab you navigate to "TM Timer DIDQ 16x24V > Basic parameters". Here you set the channel configuration to "8 inputs, 8 outputs".
      

    Fig. 2
     

  4. To use the Input 0 as individual Timer DI you go to the "General" tab and under "TM Timer DIDQ 16x24 > Channel parameters > DI0/DI1" you set the configuration of this DI group to "Use inputs individually". Select "Timer DI" as the operating mode and the "None" for the input delay.
      

    Fig. 3
     

  5. For the output channels used you set "Timer DQ" as the operating mode.
      

    Fig. 4
     

Configure isochronous PROFINET IO system
  1. In the "Devices & Networks" editor you open the Topology view.
  2. Configure the network topology according to your hardware setup.
      

    Fig. 5
     

  3. In the "Devices & Networks" editor you open the Network view.
  4. Assign the IO device ET 200MP to an IO controller.
      

    Fig. 6
     

  5. In order to operate the PROFINET IO system in IRT mode and set the isochronous mode you mark the interface module in the Device view of the ET 200MP. The properties of the interface module are displayed in the inspector window. In the "General" tab you navigate to "PROFINET interface [X1] > Advanced options > Isochronous mode". Enable the function "Isochronous mode".
    For the Ti/To values you can leave the "Automatic setting" setting. All the settings required for the PROFINET IO system and the Sync domains are made automatically.
    In the Detail overview you enable isochronous mode for the technology module TM Timer DIDQ 16x24V.
      

    Fig. 7
     

  6. In the Network view you mark the PROFINET IO system. The properties of the PROFINET IO system are displayed in the inspector window. In the "General" tab you navigate to "PROFINET > Sync Domains > Sync-Domain_1". You can change the send clock here. In this example we take the preset send clock of 1 ms.
      

    Fig. 8
     

  7. In the Device view of the ET 200MP you mark the technology module TM Timer DIDQ 16x24V. The properties of the technology module are displayed in the inspector window. In the "General" tab you navigate to "TM Timer DIDQ 16x24V > Channel parameters > IO addresses". Assign a synchronous cycle OB to the input and output addresses by clicking the "Add new..." button under "Input addresses > Organization block". The "Add new block" dialog opens.
      

    Fig. 9
     

  8. In the "Add new block" dialog, to create a synchronous cycle OB, you select an organization block of the type "Synchronous Cycle" and close the dialog with "OK".
      

    Fig. 10
     

  9. Assign the created synchronous cycle OB to the input and output addresses. You can leave the setting "TPA 1" for the process image.
      

    Fig. 11
     

  10. In the Network view you mark the PROFINET IO system. The properties of the PROFINET IO system are displayed in the inspector window. In the "General" tab you navigate to "PROFINET > Domain management > Overview isochronous mode". Here you have a display of the Ti/To values that are valid for your configuration.
      

    Fig. 12
      

Create user program
In order to receive report in the diagnostics buffer of the CPU in the case of an event overflow in the synchronous cycle OB, go to the Properties of the synchronous cycle OB and under "Attributes" you enable the option "Report event overflow to diagnostics buffer".
  

Fig. 13
 

Under "Isochronous mode" you can set the application cycle to a multiple of the send clock of the PROFINET IO system. In this example the application cycle is set to 1 ms. In this way the application cycle is the same as the send clock.
  

Fig. 14
 

Open the synchronous cycle OB and call the following instructions in the given order.
1. SYNC_PI:
With the SYNC_PI instruction you synchronously update a process image partition of the inputs.
At the PART input parameter you specify the number of the process image partition of the inputs that is to be updated synchronously.
In the hardware configuration the process image partition "TPA 1" has been assigned to the input addresses of the technology module TM Timer DIDO 16x24V (see Fig. 11).
At the FLADDR output parameter you have output of the address of the first byte to cause a fault if there is an access error. The address is stored in the static variable "statPiFladdr".
  

Fig. 15

2. TIO_SYNC:
With the TIO_SYNC instruction you can synchronize the TM Timer technology modules to a common time base.
  • At the input parameters HWID_1 to HWID_8 you specify the hardware ID of the TM Timer technology modules from the hardware configuration. With a TIO_SYNC you can synchronize up to 8 TM Timer technology modules.
  • At the SendClock input parameter you specify the send clock of the Sync Domain. Take the send clock setting from the hardware configuration of the PROFINET IO system.
    If the synchronous cycle OB is called in every data cycle, the data update is done according to the IPO model. For this you set the value 2 at the PIP_Mode input parameter.
    Note
    This IPO model describes a basic principle of data processing in the order: Input-Process-Output.
  • Create a variable of the data type UDT "TIO_SYNC_Data". In this example the static variable "statTioSyncData" of the data type "TIO_SYNC_Data" is created.
  • At the TIO_SYNC_Data input parameter you specify the variable "statTioSyncData" of the data type UDT "TIO_SYNC_Data". The data type UDT "TIO_SYNC_Data" includes the central structure and the data for synchronizing the modules and forwarding the TIO_Time. You also specify the variable "statTioSyncData" of the data type UDT "TIO_SYNC_Data" at the TIO_SYNC_Data input parameter of the instructions TIO_DI and TIO_DQ an.
 

Fig. 16
 
3. TIO_DI:
The TIO_DI instruction continuously acquires the edges at one digital input of a TM Timer DIDQ technology module and delivers the associated time stamp. The TIO_DI instruction is called once per input that is to be read.
  • At the HWID input parameter you specify the hardware ID of the TM Timer technology module.
  • At the Channel input parameter you specify the number of the input of the connected TM Timer DIDQ technology module.
  • At the EdgeSel input parameter you define the edges at which a time stamp is to be acquired. In this example you specify the value 3, which means that rising and falling edges are acquired (in order of occurrence).
  • At the TO input parameter you specify the time for outputting the synchronized output data. Take the time To (output process values) from the hardware configuration of the ET 200M (see Fig. 12).
  • The DI output parameter gives the status of the input.
  • At the TimeStampRE output parameter the time stamp of the rising edge at a digital input is output.
  • At the TimeStampFE output parameter the time stamp of the falling edge at a digital input is output.
 

Fig. 17
 
4. User application: In the user application you can calculate the output time stamp for switching the outputs of the TM Timer DIDQ technology module based on an input time stamp and the current time (TIO_Time).
 
5. TIO_DQ:
The TIO_DQ instruction is for switching an output of a TM Timer DIDQ at defined times. The TIO_DQ instruction is called once per time-controlled output at which the calculated time stamp is to be output. The time-controlled output of the TM Timer DIDQ technology module is addressed via the input parameters HWID and Channel.
  • At the "Out_Mode" input parameter you define the output mode for the edges at the output. In this example you specify the value 3, which means that when either the time stamp TimeStempRE (time stamp of the rising edge) or the time stamp TimeStampFE (time stamp of the falling edge) has the value not equal to 0, the edge concerned is output directly.
  • At the TO input parameter you specify the time for output of the synchronous output data. Take the time To (process value output) from the hardware configuration of the ET 200M (see Fig. 12).
    The time stamps that are output at the output parameters TimeStampRE and TimeStampFE of the TIO_DI instruction are specified at the input parameters TimeStampRE and TimeStampFE of the TIO_DQ instruction.
  • Time stamps are specified at the input parameters TimeStampRE and TimeStampFE to output a rising or falling edge at a digital output at a defined time.
  

Fig. 18
  
6. SYNC_PO:
With the SYNC_PO instruction you synchronously update a process image partition of the outputs.
At the PART input parameter you specify the number of the process image partition of the outputs that is to be updated synchronously.
In the hardware configuration the process image partition "TPA 1" has been assigned to the output addresses of the technology module TM Timer DIDO 16x24V (see Fig. 11).
  

Fig. 19
  
Note
The above-mentioned instructions are called in a function block. The input and output parameters of the instructions have static variables that are contained in the instance DB of the function block. The instance DB is generated when the function block is called in the synchronous OB (OB 61).

Further Information
Detailed information about the technology module TM Timer DIDQ is available in the manuals below:
Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.