Instructions: This is how you configure the FM350-2 Counter in PCS 7:
Changes from PCS 7 V7.x onwards:
Configuration via the FCs from the FM350 library - all 8 channels can be evaluated
Using this method you configure a Function Block to incorporate the relevant FCs from the FM350 library. More information is available in the manual "FM350-2 Counter Function Module Installation and Parameter Assignment" in Entry ID 1105178.
Configuration with the CH_CNT (FB127) block of the PCS 7 library V6.x - permits access to only 4 channels The blocks that are supplied with the module are not necessary for PCS 7 because PCS 7 only requires the blocks that are already in the PCS 7 V6.x library (from PCS 7 V6.0 SP3).
Changes to the configuration options of block CH_CNT (FB127): From V7.x with 8 possible channels
In order to use the 4 additional channels (4-7), you set the USE_CNT and USE_MSRV inputs (Fig. 04) to TRUE for these channels in the CH_CNT blocks. You must note that these 4 channels are read cyclically as a data record from the module because these counter and measured values are not in the process image of the FM350-2 Counter. For the sake of performance, you should set these two inputs to TRUE only if you need the function.
In the 4 channels of the FM350-2 Counter that are in the process image (channels 0-3), you can use the cyclic reading option by also setting the two inputs USE_CNT and USE_MSRV for channel. Here, however, you must note that this is also at the cost of performance.
Note: Install the FM 350-2 Counter software before proceeding as follows.
| No. |
Procedure |
| 1 |
Add an FM350-2 Counter module to your HW Config and select the module (Fig. 01).
Double-click on the FM module to open the parameterization window for the FM350-2 Counter.

Fig. 01: Hardware Configuration
|
| 2 |
In the parameterization window of the FM350-2 Counter, you execute the menu command "Edit > Specify channels" in order to set the channels (Fig. 02).

Fig. 02: Configuration of the counter module
|
| 3 |
Define the settings for the channels in this window.

Fig. 03: Specifying channels
Note: During parameter assignment, it is important to note which data type has been selected for the count values (user_type1 and user_type2) which have been read in.
In this example, user_type 1 has been configured with WORD and user_type 2 has been configured with DWORD. |
Configuration of block CH_CNT (FB127) in CFC:
| No. |
Procedure |
| 1 |
Insert the CH_CNT block (FB127) into your CFC chart.

Fig. 04: CFC block for the counter module
|
| 2 |
Create symbols in the symbol table for the start addresses for the FM350-2 module.

Fig. 05: Settings in the symbol table
Note the following here:
- Depending on which data type has been selected during the parameter assignment for FM350-2 with HW Config for user_type1 or user_type2, you select either IW for WORD or ID for DWORD.
The address for user_type1 commences from the base address of the module + 8 bytes (e.g. base address = 512; ID520 or IW520).
- The start address for the module in this example is 512.
The first channel has been set to WORD; therefore, enter IW520 in the symbol table.
- The address for user_type2 commences from the base address of the module +12 bytes (e.g. base address = 512; ID524 or IW524).
In our example, enter ID 524 in the symbol table.
In the case of the WORD data type, you can also assign symbols for the following addresses: "base address" + 10 and "base address" + 14. In terms of channels, the count and measured values must be sequential in the process image. The sequence can be count and measured value or vice versa. However, only one symbol may be defined as the start address of the count or measured values for a channel. |
| 3 |
Connect the LATCH input parameter to the appropriate channel.

Fig. 06: Manual interconnection of the CFC block
|
| 4 |
Start compilation of the CFC charts.

Fig. 07: Compiling the charts with the "Generate module drivers" option
|
| 5 |
Block after CFC compilation

Fig. 08: Connected and configured block in CFC
Note:
The following are performed automatically during compilation using the "Generate module drivers" function:
- Parameter assignment of the block
- Interconnection of the LATCH and CHANNEL inputs
- Connection of the MODE input to the OMODEx output of the FM_CNT block
- Connecting the FM_DATA structure to the identically-named structure of the FM_CNT block
|
Example for addressing the channels of block CH_CNT (FB127):
If you use the "WORD" data format for displaying the values, then the values of channels 0-3 are in the process image. The values for channels 4-7 are not in the process image and have to be read via "Read data record".
The channels in the process image are addressed as described in the Online Help. The base address 512 will be used in this example.
Channels in the process image:
Channel 0: Base address + 8 bytes = IW 520
Channel 1: Base address + 10 bytes = IW 522
Channel 2: Base address + 12 bytes = IW 524
Channel 3: Base address + 14 bytes = IW 526
Only 2 channels are available in the process image with the DWORD data format.
Channels outside the process image (these are read via "Read data record"):
Channel 4: Base address + 4 bytes = IW 516
Channel 5: Base address + 5 bytes = IW 517
Channel 6: Base address + 6 bytes = IW 518
Channel 7: Base address + 7 bytes = IW 519
The following holds for addressing these channels (4-7): Base address of the module + channel number.
Note: There is further information available on the configuration of the module and of the block in the online help for the "CH_CNT" block (FB127).
|