2-697
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
CIPWrite
The data type of Handle is structure _sCIP_HANDLE. The specifications are as follows:
If the value of ErrorID is WORD#16#1C00, the CIP message error code is stored in ErrorIDEx.
The following example writes variable abc. The contents of variable def is written to variable abc.
To write array data, pass a subscripted array element to DstDat as the parameter. Also pass a sub-
scripted array element to SrcDat as the parameter. The following example stores the contents of array
variable elements def[10] to def[13] in the four array variable elements abc[3] to abc[6].
The maximum size of the data that you can write depends on the data type and variable name that are
specified for DstDat, as given in the following table.
Maximum write data size [bytes] = Base size − Size of variable name of DstDat
Name Meaning Description Data type Valid range Unit Default
Handle Handle Handle _sCIP_
HANDLE
--- --- ---
Handle Handle Handle UDINT Depends on
data type.
--- ---
Writing Arrays
Maximum Write Data Size
Item in above formula Meaning
Base size • Data type of variable specified for DstDat is a structure or STRING: 1,986 bytes
• Other data types: 1,988 bytes
CIPWrite_instance(A, cip_h, ‘abc’, UINT#1, def,
ghi, jkl, mno, pqr, stu);
LD
ST
jkl
mno
pqr
stu
ghi
def
cip_h
‘abc’
UINT#1
A
CIPWrite
CIPWrite_instance
Execute Done
Handle Busy
DstDat Error
Size ErrorID
SrcDat ErrorIDEx
CIPWrite_instance(A, cip_h, ‘abc[3]’, UINT#4, def,
ghi[10], jkl, mno, pqr, stu);
LD
ST
jkl
mno
pqr
stu
ghi
def[10]
cip_h
‘abc[3]’
UINT#4
A
CIPWrite
CIPWrite_instance
Execute Done
Handle Busy
DstDat Error
Size ErrorID
SrcDat ErrorIDEx