Specifying direct I/O access to the FM 350-2, 2 channels
How can count and measured values be read directly by I/O access on the FM 350-2?
The FM 350-2 permits a maximum of four measured or count values to be displayed directly on the module I/O. Using the "Specify Channels" function you define which of the individual measured values is to be displayed on the I/O area.
Depending on the size of the measured or count value, you must parameterize the data format in the "User_Type " as "Word" or "Dword". If you parameterize as "Dword", only one measured or count value per "User_Type" is possible. If you parameterize "Word", you can read in two values.
In the user program, the commands L PIW for Word access
and L PID for Dword access are used.
The access addresses are structured as follows:
- For Word access: module address of the FM350-2 from HW Config.
+8, +10, +12, +14
Example: FM350-2 address is 256 à access L PIW 264, L PIW 266, L PIW 268, L PIW 270
- For Dword access: module address of the FM350-2 from HW Config.
Example: FM350-2 address is 256 à access L PID 264, L PID 268
To read out measured values in this way, the read function "FC
CNT2_RD" is not necessary. The module updates its I/O input
interface every 2 ms and stores the additional counted and measured
values specified in the global DB of the "CNT_CTRL" function at
addresses 44 to 50. To do this you need to call function FC
If you need more than four measured or counted values, you have to work with the read function "FC CNT2_RD" as well. Follow these steps to arrive at the parameters window "Specify channels":
- Double-click the FM350-2 in the hardware configuration.
- In the "Properties - FM350-2 Counter" window you press the "Parameters" button.
Fig. 1: Setting the FM350-2 properties
- In the "FM350-2 Counter [Assigning Parameters]" window you select the menu item "Edit > Specify Channels".
Fig. 2: Specifying the channels