Addition of subscriber variables

If the EAP device is to receive variables, subscriber variables need to be added in order to complete its configuration (see next illustration).

1. In the context menu of the EAP device node (Device 1),
click on the entry [Add New Item...].
  • The Insert Box dialog opens.
2. Select the Network Variable Subscriber and click on [OK].

Addition of several subscribers

If several Subscribers are to be created, the number can be set using the Multiple input field.

The Subscriber Variables (RxData) are finally appended to the Subscriber generated (see following illustration).

Addition of subscriber variables 1:
1. In the context menu of the subscriber, click on the menu item [Add new Item...].
  • It opens the Import Network Variable dialog, with whose help a Subscriber Variable can be imported or defined. There is a choice of three possibilities.
Addition of subscriber variables 2:

Browse for Computer
The connection to a Publisher Variable of another controller in the network can be established automatically.

  • The other controller must be located in the list of known target systems.
1. Click on [Browse for Computer…].
  • The Choose Target System dialog opens.
2. Select the desired control computer from the list and click on [OK].
  • All Publisher Variables offered by this computer are listed.
3. Select the desired Publisher Variable and confirm with [OK].
  • The Subscriber Variable is created to suit the selected Publisher Variable.

Browse for File
As an alternative to Browse for Computer, the connection to a variable of another control computer can be automatically established by browsing for the project file that is or will be activated on the control computer.

1. Click on [Browse for File…].
  • A dialog opens for browsing the file system.
2. Browse the file system for the desired project file and confirm your selection with [OK].
  • All Publisher Variables offered by this computer are listed.
3. Select the desired Publisher Variable and confirm with [OK].
  • The Subscriber Variable is created to suit the selected Publisher Variable.

Create new Variable
The last option is to manually configure the Subscriber Variable (see following illustration).

Addition of subscriber variables 3:
1. Click on [Create new Variable].
  • The dialog Insert Network Variable appears.
2. Select a data type for the Subscriber Variable, enter a designation in Name, define an ID and then click on [OK].
  • The node for this Subscriber Variable appears below the Subscriber (see following illustration).

Assignment of an ID

The selected ID for a Subscriber Variable must be identical to the Publisher Variable ID that is to be received.

Addition of subscriber variables 4:

Description of the unconditional input and output variables

FrameState/FrameCtrl
The input variable FrameState and the output variable FrameCtrl below the Subscriber node are reserved and are not used at present.

VarState
The input variable VarState below the Subscriber Variable indicates the current state of RxData. A detailed description can be found in the Subscriber section.

VarCtrl
The output variable VarCtrl below the Subscriber Variable can be used to control the receiving. The following values are possible for VarCtrl:

Short description

Bit

Description

Ignore Hash/Version

VC.0

If the bit is set to the value 1, the checking of the version on receiving a Process Data is deactivated.

 

Appearance of the output variable VarCtrl

This variable does not exist in the case of EAP communication via the EL66xx terminal!

VarData
The input variable VarData of the Subscriber Variable can be linked with any desired variable of a suitable data type in TwinCAT (e.g. with a variable of a PLC program).

The reception of a variable is diagnosed on the receiving side. The two input variables Quality and CycleIndex below the Subscriber Variables are available for this.

Quality
The Quality variable supplies a counter with a resolution of 100 µs. The counter value indicates the length of time since the last data was received for this Subscriber Variable. The example in the next illustration shows the online value of the Quality variable after disconnecting the network plug (count increases) and reconnection (counter value 0).

Addition of subscriber variables 5:

CycleIndex
The CycleIndex variable is incremented in each Publisher cycle. The example in the next illustration shows the typical procedure when viewing the online value of the CycleIndex variables.

Addition of subscriber variables 6:

Description of the conditional output variables

VarId
The output variable VarId below the Subscriber Variable only exists if the option Online Changeable is activated for the Variable ID. In this case the ID for the Subscriber Variable can be changed dynamically (e. g. with the help of a PLC program).