Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 19734436, Entry date: 01/10/2014

How do you interconnect an FM350-2 in PCS 7?

  • Entry
  • Associated product(s)
This entry describes how to configure an FM350-2 in PCS 7 using the PCS 7 Standard Library.

If you are using the PCS7 Advance Process Library (APL) or PCS7 V8.1 and higher in your project, the information about configuring is in the entry below: 83146298

This is how you configure the FM350-2 Counter in PCS 7

Changes in PCS 7 V7.x and higher

Configuration with the FCs from the FM350 library - all 8 channels can be evaluated
Using this method you configure a block sleeve to incorporate the relevant FCs from the FM350 library. More information is available in the manual "SIMATIC S7-300 FM 350-2 Counter Module - Installing and Assigning Parameters" 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 the PCS 7 because the 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): V7.x and higher with 8 possible channels
In order to be able to use the 4 additional channels (4-7), you set the USE_CNT and USE_MSRV inputs to TRUE for these channels in the CH_CNT blocks (Fig. 04). You must note that these 4 channels are read cyclically as a data record from the module. They are read cyclically 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 setting the two inputs USE_CNT and USE_MSRV likewise for channel concerned. Here, however, you must note that this is also at the cost of performance.

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 the FM module to open the parameterization window for the FM350-2 Counter.

Fig. 01

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

3 Define the settings for the channels in this window.

Fig. 03

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 plan.

Fig. 04

2 Create symbols in the symbol table for the start addresses of the FM350-2 module.

Fig. 05

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 EW for WORD or ED for DWORD.
    The address for user_type1 commences from the base address of the module + 8 bytes (base address = 512; ED520 or EW520, for example).
  • The start address for the module in this example is 512.
    The first channel has been set to WORD; therefore, enter EW520 in the symbol table.
  • The address for user_type2 commences from the base address of the module +12 bytes (for example, base address = 512; ED524 or EW524).
    In our example, enter ED 524 in the symbol table.

In the case of the WORD data type, you can assign symbols for the following addresses: "base address" + 10 and "base address" + 14. In terms of channels, the count and measured values must lie flush in the process image. The sequence can be count or measured value and 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

4 Start compilation of the CFC charts.

Fig. 07

5 Block after CFC compilation

Fig. 08

The following are performed automatically during compilation using the "Create module driver" function:

  • Parameterization of the block
  • Interconnection of the LADDR 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 of addressing the channels of the block CH_CNT (FB127)
If you use the "WORD" data format to display values, then the values of channels 0 to 3 are in the process image. The values for channels 4 to 7 are not in the process image and have to be read using "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 = EW 520
Channel 1: Base address + 10 bytes = EW 522
Channel 2: Base address + 12 bytes = EW 524
Channel 3: Base address + 14 bytes = EW 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 = EW 516
Channel 5: Base address + 5 bytes = EW 517
Channel 6: Base address + 6 bytes = EW 518
Channel 7: Base address + 7 bytes = EW 519

The following holds for addressing these channels (4-7): Base address of the module + channel number. 

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).