Document toolboxDocument toolbox

Communications between a device and the CFX Gateway

Note:

This section is intended for developers.


The CFX Gateway's purpose is to send and receive CFX messages as a proxy for a device. The communications between a device and the CFX Gateway for each supported CFX message was designed to be independent of those for all other supported messages (that is, each supported message was designed to operate asynchronously with respect to all other supported messages). However, through careful configuration, it is possible to have two supported CFX messages operate synchronously which can be useful, for example, when dealing with Request & Response messages.

Asynchronous messages

The single handshake

When a single handshake is used for a supported message operating independently of all other supported messages, one PLC tag is utilized. The entity sending data to the other entity writes a known value to the tag (sets the tag value high) to signal to the recipient that data is ready to be transferred. Once the recipient has transferred the data, it resets the value of that same PLC tag (sets the tag value low).

When configuring the trigger tag mappings for a CFX message that uses a single handshake, only the TxTriggerSet mapping should be defined—the RxTriggerSet, TxTriggerReset, and RxTriggerReset tag mappings should be left undefined.


Note:

Each tag mapping is preceded by two or three letters that identify the CFX message, for example, RA for RecipeActivated would be mapped as RATxTriggerSet, RARxTriggerSet, RATxTriggerReset, and RARxTriggerReset.

The double handshake

When a double handshake is used for a supported message operating independently of all other supported messages, two PLC tags are utilized. The entity sending data to the other entity writes a known value to the "sender's" tag (sets the tag value high) to signal to the recipient that data is ready to be transferred. Once the recipient has transferred the data, the recipient writes a known value to the "receiver's" tag (sets the tag value high) to signal to the sender that the data has been transferred. The sender then acknowledges that it knows the data transfer was successful by resetting the "sender's" tag (sets the tag value low). The receiver then acknowledges this by resetting the "receiver's" tag (sets the tag value low).

Note:

When configuring the trigger tag mappings for a CFX message that uses a double handshake, all four trigger mappings should be defined (TxTriggerSet, RxTriggerSet, TxTriggerReset and RxTriggerReset). Remember that each tag mapping is preceded by two or three letters that identify the CFX message, for example, RA for RecipeActivated would be mapped as RATxTriggerSet.

Synchronous messages

When two supported CFX messages are required to operate synchronously, the two supported messages share the tags used to control the handshake of each message. When configuring a pair of supported messages, it is important to consider which party initiates the communication handshake of each message.

Consider the ValidateUnitsRequest and ValidateUnitsResponse messages. In this situation, the device initiates the communication for the ValidateUnitsRequest message, with the CFX Gateway initiating the communication for the ValidateUnitsResponse message., whereas if the WorkStarted and WorkCompleted messages are to operate synchronously the device initiates the communication of both messages.

One-way communication

In a situation where two messages are to operate synchronously and the communication of both messages are initiated by the same entity (such as a device communicating the WorkStarted and WorkCompleted messages), the device sets the "sender's" tag to initiate the WorkStarted message but does not reset its value—that being left to the handshake of the WorkCompleted message.

When configuring the trigger tag mappings for two CFX messages to be handled synchronously where communications for both messages are to be triggered by the same entity, the TxTriggerSet should be defined to trigger the first message and all four trigger mappings of the second message should be defined (TxTriggerSet, RxTriggerSet, TxTriggerReset, and RxTriggerReset) to complete the handshake.

Two-way communication

In a situation where two messages are to operate synchronously and the communication of one message is initiated by one entity and the communication of the other message is initiated by the other entity (such as a device communicating the ValidateUnitsRequest and the CFX Gateway communicating the ValidateUnitsResponse), the device sets the "sender's" tag to initiate the ValidateUnitsRequest message but does not reset its value—that being left to the handshake of the ValidateUnitsResponse message.

When configuring the trigger tag mappings for two CFX messages to be handled synchronously where the communication for one message is to be triggered by one entity and the communication for the other message is to be triggered by the other entity, the TxTriggerSet should be defined to trigger the first message and the first three trigger mappings of the second message should be defined (TxTriggerSet, RxTriggerSet, and TxTriggerReset, but not RxTriggerReset) to complete the handshake.


Copyright © 2024 Aegis Industrial Software Corporation. All Rights Reserved.