Entry type: FAQ, Entry ID: 22637440, Entry date: 02/19/2010
(0)
Rate

How do you program the FC10 "AG_CNTRL"?

  • Entry
  • Associated product(s)

Requirements
The FC10 "AG_CNTRL" is supported by the following Industrial Ethernet CPs.
 

Order number Firmware version Entry ID
CP343-1
as of V1.0.17 Delivery release: New CP 343-1 Communication Processor Released for Delivery (PROFINET-Controller)"
Manual: Manual Part B3S CP 343-1
as of V2.0.16 Manual: SIMATIC NET S7-300 - Industrial Ethernet / PROFINET CP 343-1 Manual Manual part B
CP343-1 Lean
as of V2.1 Firmware update V2.1: Firmware Update V2.1 for SIMATIC NET CP 343-1 Lean
Manual: SIMATIC NET S7-300 - Industrial Ethernet / PROFINET CP 343-1 Lean Manual Part B
CP343-1 Advanced
as of V1.0.24 Delivery release: CP 343-1 Advanced V1.0 with PROFINET IO and CBA Released for Delivery
Manual: Manual Part B3A CP 343-1 Advanced
as of V1.0.23 Manual: Manual Part B CP 343−1 Advanced
CP443-1
as of V1.0.26 Delivery release: New CP 443-1 (6GK7443-1EX20-0XE0) Released for Delivery
Manual: SIMATIC NET S7−CPs for Industrial Ethernet Manual Part B
CP443-1 Advanced
as of V2.2 Firmware update: V2.2: Firmware Update V2.2 of the CP443-1 Advanced
as of V1.0.24 Manual: Manual Part B4A* CP 443-1 Advanced
as of V2.0 Manual: SIMATIC NET S7−CPs for Industrial Ethernet Manual Part B

Instructions
The block FC10 "AG_CNTRL" is included in the current SIMATIC_NET_CP library. The current library is available for downloading in Entry ID: 9061353. In this entry there is also a description of how to install the library correctly.

If you have installed SIMATIC_NET_CP library, then open the library in the SIMATIC Manager via the menu "File > Open".

You will find the FC10 for the S7-300 in the SIMATIC_NET_CP library under "CP 300 > Blocks".
You will find the FC10 for the S7-400 in the SIMATIC_NET_CP library under "CP 400 > Blocks".

Copy the FC10 "AG_CNTRL" from the SIMATIC_NET_CP library and insert it in your S7 program.

The FC10 "AG_CNTRL" block has 4 input parameters.
 

Input parameters Description
ACT Activation of the block
ID Connection number

Note
The connection number is to be taken from the configuration in NetPro.

LADDR Module starting address

Note
The module starting address is to be taken from the Hardware Configuration.

CMD Command to the FC10 "AG_CNTRL"

The FC10 "AG_CNTRL" block has 5 output parameters.
 

Output parameters Description
DONE The state parameter indicates that the order has been executed error-free.
ERROR Error display
STATUS Status display
RESULT1 Feedback according to command to the FC10 "AG_CNTRL"
RESULT2 Feedback Part 2 according to command to the FC10 "AG_CNTRL"

Note
Output parameter RESULT2 is evaluated only for S7-400.

The figure below illustrates a sample call for the FC10:


Fig. 01

The table below contains some calls to the FC10 with various commands:
 

No. Procedure
1

Call with CMD=1 (CN_STATUS - connection status). This command delivers the status of the connection which has been selected with the ID.


Fig. 02

The output parameter RESULT1 has the following value:
0111 0000 0001 0111 (bin)

The value of output parameter RESULT1 is evaluated bit by bit.

Bit 0 - 3: Displays for Send direction

  • Connection reserved for Send and Receive jobs
  • Send job being processed
  • Previous Send job completed positively

Bit 4 - 7: Displays for Receive direction

  • Connection reserved for Send and Receive jobs
  • No Receive job being processed
  • No information available on the previous Receive job

Bit 8 - 11: Displays for FETCH/WRITE

  • No FETCH connection
  • No WRITE connection
  • Job status OK
  • No job running

Bit 12 - 15: General CP information

  • Connection is established
  • CP in RUN
  • The FC10 has not yet made a connection reset or the reset ID has been canceled.

Bit 16 - 31: Reserved for later extensions

2

Call with CMD=2 (CN_RESET - connection reset). This command resets the connection which has been selected with the ID.


Fig. 03

The output parameter RESULT1 has the following value:
0000 0001 (hex), i.e. the Reset job has been transferred successfully to the CP

In order to test the connection abort, another request is now executed straight away with CMD=1.


Fig. 04

The output parameter RESULT1 now has the following value:
0100 0000 0001 1001 (bin)

The value of output parameter RESULT1 is evaluated bit by bit.

Bit 0 - 3: Displays for Send direction

  • Connection reserved for Send and Receive jobs
  • No Send job being processed
  • Previous Send job completed negatively

Bit 4 - 7: Displays for Receive direction

  • Connection reserved for Send and Receive jobs
  • No Receive job being processed
  • No information available on the previous Receive job

Bit 8 - 11: Displays for FETCH/WRITE

  • No FETCH connection
  • No WRITE connection
  • Job status OK
  • No job running

Bit 12 - 15: General CP information

  • Connection has been disconnected
  • CP in RUN
  • The FC10 has not yet made a connection reset or the reset ID has been canceled.

Bit 16 - 31: Reserved for later extensions

3 Call with CMD=3 (CN_STATUS_ALL - all connections status). This command supplies the status for all connections (established/disconnected) in the RESULT1/2 parameters (a total of 8 bytes of group information). The parameter ID must be set to "0" (is checked for 0).


Fig. 05

The output parameter RESULT1 has the following value:
0111 (bin), i.e. the connections with IDs 1, 2 and 3 are established.

Note

  • All the feedback values supplied are only conclusive if the corresponding SEND/RECEIVE block has been called beforehand for the connection under consideration.
  • You can find the complete description of the block and the evaluation of the parameters in the Online Help for STEP 7, as well as in the manual "Functions (FC) and Function Blocks (FB) for SIMATIC NET S7-CPs Programming Manual". in Entry ID: 30564821.
  • Information on which commands (CMD) the above-mentioned IE CPs support is available in Entry ID: 33414377.