Networking - CsCAN for IEC
See also: IEC 61131 Language Editor Programming
See also: Project Toolbox for IEC
Topic Menu
Home > View > Project Toolbox > Networking - CsCAN
Send Words 
Also called: NetPutWords. This function works with CsCAN network.
See also: Enhanced IEC 61131 Guide
NOTE: This feature requires Enhanced IEC License.
Operator - This element allows sending global data from any set of registers to any device on the network using multiple network IDs. If source data is not transmitted the function block will not pass power. Once the data is transmitted, function block will pass power.
Inputs
ID – (Type: INT) - This is a register or constant for the ID to use when transmitting data on the network. It must be in the range defined by the primary network ID and the total nodes allocated for this target.
SRC [ ] – (Type: INT[], BOOL[]) - This is the starting register for the source data to send on the network. This is a register local to the controller.
IOREF [] – (TYPE: INT, BOOL) - This defines the IO Reference for the destination of the data. This can be a %AQG or %QG registers. This is a network register, a register assigned and produced by the transmitting ID. This must be always the starting reference so it should be either AQG1 or QG1.
IOSTART INDEX [ ] – (TYPE: INT) - This defines the Start Index for the IO REF []. For e.g if user wants to PUT data from %AQG10 then specify 10 in this input.
#N - (Type: INT) - This is the number of words to send on the network.
ST Language
(* Netputwords is a declared instance of NetPutWord function block *)
Netputwords (ID, SRC[], IORef[], IOstartIndex , N );
FBD Language
LD Language
IL Language
(* Netputwords is a declared instance of NetPutWord function block *)
Return to the Top: Networking - CsCAN for IEC
Send Words on Change of State 
Also called: NetPutWordex. This function only works with CsCAN networks.
See also: Enhanced IEC 61131 Guide
NOTE: This feature requires Enhanced IEC License.
Operator – This element allows sending global data using multiple network IDs. When the "Send on Change of State" option is not checked, this function will copy the data from the source registers and attempt to transmit the data every scan that this function receives power. When the "Send on Change of State" option is checked and the SEND trigger is set LOW while the function receives power, this function will copy data from the source registers and attempt to transmit the data only if it changes. When the "Send on Change of State" option is checked and the SEND trigger is set HIGH while the function receives power, data will be sent every scan that the function receives power.
The function passes power if the ID is legal and, in the range, defined by the network ID and the total number of ID assigned to that node.
Inputs
ID – (Type: INT) - This is a register or constant for the ID to use when transmitting data on the network. It must be in the range defined by the primary network ID and the total nodes allocated for this target.
SRC[ ] – (Type: INT[], BOOL[]) - This is the starting register for the source data to send on the network. This is a register local to the controller.
IOREF [] – (TYPE: INT, BOOL) - This defines the IO Reference for the destination of the data. This can be a %AQG or %QG registers. This is a network register, a register assigned and produced by the transmitting ID. This must be always the starting reference so it should be either AQG1 or QG1.
IOSTART INDEX [ ] – (TYPE: INT) - This defines the Start Index for the IO REF []. For e.g if user wants to PUT data from %AQG10 then specify 10 in this input.
#N - (Type: INT) - This is the number of words to send on the network.
@SEND – (TYPE: BOOL) - If the option to "Send on Change of State" is checked within the Net Put configuration, a Send trigger must be configured. This register, when high, forces a data transmission and ignores the Change of State.
ST Language
(* putwordex is a declared instance of NetPutWordEX function block *)
putwordex (ID, SRC[], IORef[], IOstartIndex , N ,@Send );
FBD Language
LD Language
IL Language
(* putwordex is a declared instance of NetPutWordEX function block *)
Return to the Top: Networking - CsCAN for IEC
Receive Words 
Also called: NetGetWord. This function works with CsCAN networks.
See also: Enhanced IEC 61131 Guide
NOTE: This feature requires Enhanced IEC License.
Operator - This element allows global data from any device on the network to be copied into any set of registers. If the device defined by the source ID has not transmitted data, this function block will not pass power flow and will send a request for the data to be sent. Once the requested data has been received, power flow from this function block will turn on.
Inputs
ID – (TYPE: INT) - This register or constant defines the source node for the global data. If the ID is not valid, the function will do nothing and will not pass power.
IOREF [] – (TYPE: INT, BOOL) - This defines the IO Reference for the requested global data. This can be a %AQG or %QG registers. This is a network register, a register assigned and produced by the transmitting ID. This must be always the starting reference so it should be either AQG1 or QG1.
IOSTART INDEX [ ] – (TYPE: INT) - This defines the Start Index for the IO REF []. For e.g if user wants to GET data from %AQG10 then specify 10 in this input.
#N – (TYPE: INT) - This defines the number of words to get from the source ID. The valid range is 1 to 32.
ST Language
(* NGW is a declared instance of NetGetWord function block *)
NGW ( ID, IOREF, IOSTARTINDEX, DST[], N );
FBD Language
LD Language
IL Language
(* NGW is a declared instance of NetGetWord function block *)
Return to the Top: Networking - CsCAN for IEC
Send Heartbeat 
This function allows a device to transmit a heartbeat CsCAN message at a given rate to indicate to other devices it is on-line and operating normally. This function does generate network traffic. The message generated normally does not affect bandwidth The range of frequencies over which a system is designed to operate. The bandwidth is expressed in Hertz between the highest and lowest frequencies., but if many devices send heartbeat messages frequently it may cause reduction in bandwidth. This function works with CsCAN networks.
Inputs
EN – (TYPE: BOOL) - The "EN" input is a condition. If EN is TRUE State then ENO is same.
ID – (TYPE: INT) - This register or constant is usually the primary network ID of the device (%SR29), but can be in the range defined by the primary network ID and the total number of IDs assigned to this device.
#PT – (TYPE: INT) - This is how often in milliseconds to send the heartbeat message. This has a range of 1 to 6553.
Outputs
Status – (TYPE: INT) - This register is currently used for internal record keeping. Do not allow other function to write to this register.
ENO – (TYPE: BOOL) - ENO is equal to EN
ST Language
(* NPHB is a declared instance of NetPutHB function block *)
NPHB (EN, ID, #PT);
ENO := NPHB.ENO;
STATUS := NPHB.Status
FBD Language
LD Language
IL Language
(* NPHB is a declared instance of NetPutHB function block *)
Return to the Top: Networking - CsCAN for IEC
Receive Heartbeat 
This function allows the detection of a network heartbeat from another device. This function does not generate any network traffic. This function works only with CsCAN networks. This function will not pass power flow if the ID is not in the legal range or if the device being monitored does not send a heartbeat message within the timeout defined by PT.
Inputs
EN – (TYPE: BOOL Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'.) - The "EN" input is a condition. If EN is TRUE State then ENO is same.
ID – (TYPE: INT) - This is a register or constant defining the ID of the device to monitor for a heartbeat.
#PT – (TYPE: INT) - This is the maximum amount of time to wait for the heartbeat from the monitored device. This timeout should be greater than the rate the device is sending heartbeat messages. Depending on network traffic and scan rates the GET timeout should be 10 to 1000 milliseconds greater than the PUT. This has a range of 1 to 6553 milliseconds.
Outputs
Status – (TYPE: INT) - This register is currently used for internal record keeping. Do not allow other functions to write to this register.
ENO – (TYPE: BOOL) - ENO is equal to EN
ST Language
(* NGHB is a declared instance of NetGetHB function block *)
NGHB (EN, ID #PT);
ENO := NGHB.ENO;
STATUS := NGHB.Status
FBD Language
LD Language
IL Language
(* NGHB is a declared instance of NetGetHB function block *)
Return to the Top: Networking - CsCAN for IEC
Send Remote Analog I/O 
Operator - This function handles sending data to a remote I/O function block and gets the sent data from a set of registers specified by the user. This function passes power flow if the remote I/O device is function normally. This function does not pass power flow if the remote I/O device has not sent a heartbeat in 2000 milliseconds. This function sends heartbeat messages to the output device every 1000 milliseconds. The default remote I/O operation is to expect heartbeat messages at least every 2000 milliseconds otherwise the outputs are turned off (or their configured default state). Data is normally transmitted on change of state, if the remote I/O device loses power, the I/O state is also sent when it resumes operation. A remote I/O device consists of a CsCAN device such as SmartStix modules that transmit global data and receive directed network data.
Inputs
ID – (TYPE: INT) - This is the network ID of the remote I/O to direct the sent data. This can be a constant from 1 to 253 or can be a 16-bit register.
SRC[ ] – (TYPE: INT[]) - This is the starting location to get data to send to the remote I/O device. When this data changes state, it is sent to the remote I/O device. The number of registers used is defined by the "#N" parameter (see below).
#N – (TYPE: INT) - This is the number of words to send to the remote I/O device. Typically for digital devices a 1 to 16 point module requires 1 word of data, a 17-32-point module requires 2 words.
Outputs
Status – (TYEP: INT) - This 16-bit register is used internally. It should be not be written by any other function block.
-
Bit 1-12 - reserved or internal use only
-
Bit 13 - Remote I/O OK and in sync with supplied data
-
Bit 14 - the Remote I/O detected a heartbeat error
-
Bit 15 - the Remote I/O has just powered up
-
Bit 16 - the function is forcing a send (unit just power cycled or first scan)
ST Language
(* NPRIA is a declared instance of NetPutRemoteIO_A function block *)
NPRIA (ID, SRC[], #N);
STATUS := NPRIA.Status
FBD Language
LD Language
IL Language
(* NPRIA is a declared instance of NetPutRemoteIO_A function block *)
Return to the Top: Networking - CsCAN for IEC
Send Remote Digital I/O 
Operator - This function handles sending data to a remote I/O function block and gets the sent data from a set of registers specified by the user. This function passes power flow if the remote I/O device is function normally. This function does not pass power flow if the remote I/O device has not sent a heartbeat in 2000 milliseconds. This function sends heartbeat messages to the output device every 1000 milliseconds. The default remote I/O operation is to expect heartbeat messages at least every 2000 milliseconds otherwise the outputs are turned off (or their configured default state). Data is normally transmitted on change of state, if the remote I/O device loses power, the I/O state is also sent when it resumes operation. A remote I/O device consists of a CsCAN device such as SmartStix modules that transmit global data and receive directed network data.
Inputs
ID – (TYPE: INT) - This is the network ID of the remote I/O to direct the sent data. This can be a constant from 1 to 253 or can be a 16-bit register.
SRC[ ] – (TYPE: INT[], BOOL[]) - This is the starting location to get data to send to the remote I/O device. When this data changes state, it is sent to the remote I/O device. The number of registers used is defined by the "# N" parameter (see below).
# N – (TYPE: INT) - This is the number of words to send to the remote I/O device. Typically for digital devices a 1 to 16 point module requires 1 word of data, a 17-32-point module requires 2 words.
Outputs
Status – (TYPE: INT) - This 16-bit register is used internally. It should be not be written by any other function block.
-
Bit 1-12 - reserved or internal use only
-
Bit 13 - Remote I/O OK and in sync with supplied data
-
Bit 14 - the Remote I/O detected a heartbeat error
-
Bit 15 - the Remote I/O has just powered up
-
Bit 16 - the function is forcing a send (unit just power cycled or first scan)
ST Language
(* NPRID is a declared instance of NetPutRemoteIO_D function block *)
NPRID (ID, SRC[], #N);
STATUS := NPRID.Status;
FBD Language
LD Language
IL Language
(* NPRID is a declared instance of NetPutRemoteIO_D function block *)
Return to the Top: Networking - CsCAN for IEC
Receive Remote Analog I/O 
Operator - This function handles receiving data from a remote I/O function block and places the received data in a set of registers specified by the user. This function passes power flow if the function is actively receiving data / heartbeat messages from the remote I/O device. This function stops passing power flow if it has not received data / heartbeat messages from the remote I/O device for 2000 milliseconds. A remote I/O device consists of a CsCAN device such as SmartStix modules that transmit global data and receive directed network data.
Inputs
ID – (TYPE: INT) - This is the network ID 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 remote I/O from which to receive data. This can be a constant from 1 to 253 or can be a 16-bit register.
DST[ ] – (TYPE: INT[]) - This is the location to start placing received data from the remote I/O device. The number of registers used is defined by the "#N" parameter (see below).
#N – (TYPE: INT) - This is the number of words to receive from the remote I/O device. Typically for digital devices a 1 to 16 point module requires 1 word of data, a 17-32-point module requires 2 words.
Outputs
Status – (TYPE: INT) - This 16-bit register is used internally. It should be not be written by any other function block. Use the power flow from this function for the pass/fail status.
ST Language
(* NGRIA is a declared instance of NetGetRemoteIO_A function block *)
NGRIA (ID, DST[], #N);
STATUS := NGRIA.Status;
FBD Language
LD Language
IL Language
(* NGRIA is a declared instance of NetGetRemoteIO_A function block *)
Return to the Top: Networking - CsCAN for IEC
Receive Remote Digital I/O 
Operator - This function handles receiving data from a remote I/O function block and places the received data in a set of registers specified by the user. This function passes power flow if the function is actively receiving data / heartbeat messages from the remote I/O device. This function stops passing power flow if it has not received data / heartbeat messages from the remote I/O device for 2000 milliseconds. A remote I/O device consists of a CsCAN device such as SmartStix modules that transmit global data and receive directed network data.
Inputs
ID – (TYPE: INT) - This is the network ID of the remote I/O from which to receive data. This can be a constant from 1 to 253 or can be a 16-bit register.
DST[ ] – (TYPE: INT[]) - This is the location to start placing received data from the remote I/O device. The number of registers used is defined by the "#N" parameter (see below).
#N – (TYPE: INT) - This is the number of words to receive from the remote I/O device. Typically for digital devices a 1 to 16 point module requires 1 word of data, a 17-32-point module requires 2 words.
Outputs
Status – (TYPE: INT) - This 16-bit register is used internally. It should be not be written by any other function block. Use the power flow from this function for the pass/fail status.
ST Language
(* NGRID is a declared instance of NetGetRemoteIO_D function block *)
NGRID (ID, DST[], #N);
STATUS := NGRID.Status;
FBD Language
LD Language
IL Language
(* NGRID is a declared instance of NetGetRemoteIO_D function block *)
Return to the Top: Networking - CsCAN for IEC