Words and Heartbeats in Advanced Ladder

See also: Set Target Network ID

See also: Project Toolbox for Advanced Ladder

 

Topic Menu

CsCAN Networking: How it Works

CsCAN Networking: Installation and Troubleshooting

Receive Words

Also called: NetGet

 

 

The Get Network Words function, aka Net Get, is used to retrieve data from the Horner CsCAN bus, data which would have been broadcast to the CsCAN bus using the Put Network Words function in other OCS controllers. It can also be used to retrieve input data from CsCAN I/O modules that are not otherwise configured in this OCS controller. The Get Network Words function can be envisioned as a Move function that is moving data from the Network to program memory.

  • ID: A constant value or variable/register that specifies the CsCAN Network IDClosed Usually refers to the ID of the device on a supported CAN, such as CsCAN, CANopen, etc. Each device must have a unique network ID. Also called Node ID. of the device from which to get data. Valid CsCAN addresses are from 1 to 253

  • Format: This may only be Global Data, i.e. data available to everyone

  • Digital/Analog: Specifies whether it is the Digital data portion or Analog data portion of the broadcasting CsCAN device to obtain.

  • Word Offset: Specifies the word of the broadcasting CsCAN device data from which to start retrieving data; normally 0 to 3 for Digital data, or 0 to 31 for Analog data. Corresponds to the “//QG” Digital and “//AQG” Analog network references on the function block shown in logic

  • Address: The starting variable/array element/register in this OCS in which the retrieved data will be placed

  • Num Words: The length of the data to retrieve in Words, normally a maximum of 4 for Digital data, or a maximum of 32 for Digital data.

The Get Network Words function will only pass power if the device specified by the ID parameter has transmitted data. If that has not occurred, power will not be passed through the function but the function will send a request for the data. Once the data is received, power will pass through the function.

 

Return to the Top: Words and Heartbeats in Advanced Ladder

Send Words

Also called: NetPut

 

 

The Put Network Words function, aka Net Put, is used to broadcast data to the Horner CsCAN bus, normally so that other OCS controllers can retrieve the data using the Get Network Words function. A destination device is not specified; instead, this OCS is specified as the sender and the data is sent globally so that any other OCS device can retrieve it by using the Get Network Words function. The Put Network Words function can be envisioned as a Move function that is moving data from program memory to the network.

  • ID: A constant value or variable/register that contains the address of the broadcasting OCS, i.e. this OCS. Addresses not consumed by this OCS cannot be used. Valid CsCAN addresses are from 1 to 253.

  • Format: Normally ‘Global Data’ to broadcast data to the network for other OCS controllers to retrieve. “Directed Data (Remote I/O)” should only be used when needed for specific circumstances.

  • Digital/Analog: Determines which portion of this OCS’s allocated network data to broadcast

  • Word Offset: Determines which of the 4 Digital Words to broadcast from 0 to 3, or which of the Analog Words to broadcast from 0 to 31. Corresponds to the “//QG” Digital and “//AQG” Analog network references on the function block shown in logic

  • Address: Starting variable/array/register from which data will be broadcast.

  • Send on Change of State: Function will normally execute on every scan when powered and possibly cause undue network traffic unless this option is checked, which will check data for changes before broadcasting the changes.

  • Send: When using “Send on Change of State”, this trigger can be used to broadcast data regardless of any change of data or lack thereof. It must be configured but there is no requirement to use it.

  • Num Words: The number of Words to broadcast with this function, up to 4 Digital Words or up to 32 Analog Words.

 

The Put Network Words function will attempt to broadcast the specified data every scan that the function is powered unless the Send on Change of State option is checked. With the Send on Change of State option checked, data will only be sent if it changes. Turning on the “Send” trigger bit while Send on Change of State is checked.

Power will flow through the function unless the specified ID is outside the range of 1 to 253 or if it does not belong this OCS, i.e. this OCS’s address or one of multiple consecutive addresses it may occupy on the CsCAN network. See also:

 

Return to the Top: Words and Heartbeats in Advanced Ladder

 

Receive Heartbeat

Also called: NetGet HB

 

 

The Get Network Heartbeat function will retrieve the heartbeat sent out by another OCS controller that has used the Send Network Heartbeat function. No network traffic is generated by this function. The indication that the heartbeat is present is power flow through the function.

  • Network IDClosed Usually refers to the ID of the device on a supported CAN, such as CsCAN, CANopen, etc. Each device must have a unique network ID. Also called Node ID.: A constant value or variable/register that contains the address of the OCS broadcasting the heartbeat to monitor. Valid CsCAN addresses are from 1 to 253

  • Timeout(mS): A constant value or variable/register that determines the number of milliseconds that must pass without a heartbeat being detected before the function will stop passing power through to the output. This should be at least twice the amount of time that the heartbeat is being sent, i.e. 500 or more if the heartbeat is being sent every 250ms. Range is 1 to 6553ms.

  • Status: A variable/register that is only used for internal function tracking and has no use in the program. Must be unique to this function, the same status register cannot be used by multiple functions.

Get Network Heart Beat functions can be used multiple times in the same program to monitor other devices for their online status, assuming they are broadcasting a heartbeat. Only one per device should be used and their status parameter assignments must be unique.

In the following example, assuming another OCS at address 1 is broadcasting a heartbeat every 250ms, ‘Device_Online’ would be true until that heartbeat was not received in any period longer than 500ms. This could be due to the other device being powered off or being disconnected from the network, etc. ‘Device_Online’ would become true once again as soon as the heartbeat was detected.

 

Return to the Top: Words and Heartbeats in Advanced Ladder

Send Heartbeat

Also called: NetPut HB

 

 

The Send Network Heartbeat function is used to create a heartbeat from an OCS device to send to the network. A destination is not specified; instead, this OCS is specified as the sender and the heartbeat is globally broadcast for any other OCS device on the network to retrieve using the Get Network Heartbeat function. The Send Network Heartbeat function generates minimal network traffic, though many devices sending heartbeats at high rates can add up and reduce bandwidthClosed The range of frequencies over which a system is designed to operate. The bandwidth is expressed in Hertz between the highest and lowest frequencies. for other Network operations.

  • Network IDClosed Usually refers to the ID of the device on a supported CAN, such as CsCAN, CANopen, etc. Each device must have a unique network ID. Also called Node ID.: A constant value or variable/register that contains the address of this OCS. Valid CsCAN addresses are from 1 to 253 and must be the primary address of this OCS controller.

  • Timeout(mS): The interval at which to broadcast a heartbeat. This should be half or less than half of the time as is specified on the receiving end. Range is 1 to 6553ms.

  • Status: A variable/register that is only used for internal function tracking and has no use in the program. Must be unique to this function, the same status register cannot be used by multiple functions.

  • Direct: When checked, the heartbeat is instead directed specifically at another device. This is not normal use of the function and should only be used in special circumstances

 

The Send Network Heartbeat function should only be used one time per program in normal use. It is only to be used for the primary CsCAN address of the OCS and should not be used for additional addresses configured for this same OCS.

Power flow occurs through the function unless the Network ID parameter is not in the range of 1 to 253.

 

Set Network ID Function Block

Set Network ID function block is used to set CAN ID of the device.

The Set Network ID function block is available under Networking- CSCAN blocks toolbox as shown below:

 

Address - This field accepts both registers (16 bit) as well as constants.

NOTE: Logic passes power only if valid inputs are given.

 

Return to the Top: Words and Heartbeats in Advanced Ladder