Omron NX502-1 Series User Manual page 55

Machine automation controller cpu unit
Table of Contents

Advertisement

Sample Programming
In this sample, the SendCmd instruction sends CPU UNIT DATA READ command from the network
No. 0, node No. 2, Unit No. 0 and receives the data.
ST
Internal
Varia-
bles
Trigger
DoFinsTrigger
SendCmdExecute
State
InDNetAdr
InOption
CmdDat
RespDat
SendCmdInstance SendCmd
External variable
IF ( (Trigger=TRUE) AND (DoFinsTrigger=FALSE) AND (_Port_isAvailable=TRUE) ) THEN
State:= 1;
DoFinsTrigger:=TRUE;
SendCmdExecute := FALSE; // Send execution status
InDNetAdr.NetNo :=USINT#0; // Set network address.
InDNetAdr.NodeNo :=USINT#2;
InDNetAdr.UnitNo :=BYTE#16#0;
InOption.isNonResp :=FALSE; // Set response.
InOption.TimeOut :=UINT#20;
InOption.Retry :=USINT#2;
NX-series CPU Unit FINS Function User's Manual (W596)
Node address 1
CPU UNIT DATA READ
Name
Data type
BOOL
BOOL
BOOL
SINT
_sDNET_ADR
_sRESPONSE
ARRAY[0..1] OF
BYTE
ARRAY[0..1023] OF
BYTE
Name
Data type
_Port_isAvailable BOOL
Node address 2 Unit No. 0
Ethernet cable
Initial value
FALSE
FALSE
FALSE
0
NetNo:=0, NodeNo:=0,
UnitNo:=16#0
isNonResp:=FALSE,
TimeOut:=0, Retry:=0
[2(16#0)]
[1024(16#0)]
Comment
Network Communications Instruction Enabled Flag
3 Client Function
Comment
Execution condition
Processing
SendCmd instruction execu-
tion flag
Sample programming status
Network address at send
destination
Response
Send data
Receive data
SendCmd instance
3-17
3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents