2-685
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
CIPOpen
The following figure shows a programming example.
Refer to the following manuals for details on CIP communications.
• NJ-series CPU Unit Built-in EtherNet/IP Port User’s Manual (Cat. No. W506)
• CJ-series EtherNet/IP Units Operation Manual for NJ-series CPU Unit (Cat. No. W495)
• Execution of this instruction is continued until processing is completed even if the value of Execute
changes to FALSE or the execution time exceeds the task period. The value of Done changes to
TRUE when processing is completed. Use this to confirm normal completion of processing.
• Refer to Using this Section on page 2-2 for a timing chart for Execute, Done, Busy, and Error.
• You must execute this instruction before you execute CIPRead, CIPWrite, or CIPSend.
• For this instruction, the first timeout time after a connection is established is 10 s even if the value of
TimeOut is set to less than 100 (10 s).
• Use the CIPClose instruction to close connections that were opened with the CIPOpen instruction.
• Even if the connection times out, the handle created by this instruction will remain. Always use the
CIPClose instruction to close the connection.
• Handles that are created with this instruction are disabled when you change to PROGRAM mode.
• You can create a maximum of 32 handles at the same time.
• You can use this instruction only through a built-in EtherNet/IP port on an NJ-series CPU Unit or a
port on an EtherNet/IP Unit connected to an NJ-series CPU Unit.
• This instruction does not use ErrorIDEx.
• An error occurs in the following cases. Error will change to TRUE.
• There is a setting error for the local IP address.
• The text string in RoutePath does not end in a NULL character.
• The value of TimeOut is outside of the valid range.
Related System-defined Variables
Name Meaning
Data
type
Description
_EIP_EtnOnlineSta Online BOOL Status of built-in EtherNet/IP port communications
TRUE: Can be used.
FALSE: Cannot be used.
Additional Information
Precautions for Correct Use
CIPOpen_instance(A, ‘2\192.168.250.2’, UINT#0, abc,
def, ghi, jkl, mno, pqr);
LD
ST
def
ghi
jkl
mno
pqr
abc
‘02\192.168.250.2’
UINT#0
A
CIPOpen
CIPOpen_instance
Execute Done
RoutePath Busy
TimeOut Error
ErrorID
ErrorIDEx
Handle