Omron NJ501-1500, NJ501-1300, NJ501-1400 Reference Manual

Machine Automation Controller
NJ-series
Instructions Reference Manual
NJ501-1300 NJ501-1400 NJ501-1500
W502-E1-01
OMRON, 2011
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.

Introduction

Thank you for purchasing an NJ-series CPU Unit. This manual contains information that is necessary to use the NJ-series CPU Unit. Please read this manual and make sure you understand the functionality and performance of the NJ-series CPU Unit before you attempt to use it in a control system. Keep this manual in a safe place where it will be available for reference during operation.
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical sys­tems (an electrical engineer or the equivalent).
Personnel in charge of introducing FA systems.
Personnel in charge of designing FA systems.
Personnel in charge of installing and maintaining FA systems.
Personnel in charge of managing FA systems and facilities.
For programming, this manual is intended for personnel who understand the programming language specifications in international standard IEC 61131-3 or Japanese standard JIS B3503.
Introduction
Applicable Products
This manual covers the following products.
NJ-series CPU Units
NJ501-1300
NJ501-1400
NJ501-1500
NJ-series Instructions Reference Manual (W502)
1

Relevant Manuals

Relevant Manuals
There are three manuals that provide basic information on the NJ-series CPU Units: the NJ-series CPU Unit Hardware User’s Manual, the NJ-series CPU Unit Software User’s Manual (this manual), and the NJ-series Instructions Reference Manual. Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac Stu­dio Version 1 Operation Manual (Cat. No. W504) for information on the Sysmac Studio.
Other manuals are necessary for specific system configurations and applications. Read all of the manuals that are relevant to your system configuration and application to make the most of the NJ-series CPU Unit.
Basic information
NJ-series User’s Manuals
Introduction to NJ-series Controllers
Setting devices and hardware
Using motion control
Using EtherCAT
Using EtherNet/IP
Using CJ-series Units
Software settings
Using motion control
Using EtherCAT
Using EtherNet/IP
Programming
Using motion control
Using EtherCAT
Using CJ-series Units
Programming error processing
Testing operation and debugging
Using motion control
Using EtherCAT
Using EtherNet/IP
Troubleshooting and managing errors in an NJ-series Controller
NJ-series CPU Unit
Hardware User´s Manual
Use the relevant manuals for references according to any error that occurs.
NJ-series CPU Unit
Software User´s Manual
NJ-series Instructions
Reference Manual
NJ-series CPU Unit Motion
Control User´s Manual
NJ-series CPU Unit Built-in
NJ-series Motion Control
EtherCAT Port User´s Manual
Instructions Reference Manual
NJ-series CPU Unit Built-in
EtherNet/IP Port User´s Manual
NJ-series Troubleshooting Manual
CJ-series Special Unit Operation
Manuals for NJ-series CPU Unit
Maintenance
Using EtherCAT
Using EtherNet/IP
Using CJ-series Units
2
NJ-series Instructions Reference Manual (W502)

Manual Configuration

NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)
Section Description
Section 1 Introduction
Section 2 System Configuration
Section 3 Configuration Units
Section 4 Installation and Wiring
Section 5 Troubleshooting
Section 6 Inspection and Maintenance
Appendices
This section provides an introduction to the NJ-series Controllers and their features, and gives the NJ-series Controller specifications.
This section describes the system configuration used for NJ-series Controllers.
This section describes the parts and functions of the configuration devices in the NJ­series Controller configuration, including the CPU Unit and Configuration Units.
This section describes where and how to install the CPU Unit and Configuration Units and how to wire them.
This section describes the event codes, error confirmation methods, and corrections for errors that can occur.
This section describes the contents of periodic inspections, the service life of the Bat­tery and Power Supply Units, and replacement methods for the Battery and Power Supply Units.
The appendices provide the specifications of the Basic I/O Units, Unit dimensions, load short-circuit protection detection, line disconnection detection, and measures for EMC Directives.
Manual Configuration
NJ-series CPU Unit Software User’s Manual (Cat. No. W501)
Section Description
Section 1 Introduction
Section 2 CPU Unit Operation
Section 3 I/O Ports, Slave Configuration, and Unit Configuration
Section 4 Controller Setup
Section 5 Designing Tasks
Section 6 Programming
Section 7 Simulation, Transferring Projects to the Physical CPU Unit, and Opera­tion
Section 8 CPU Unit Status
Section 9 CPU Unit Functions
Section 10 Communications Setup
Section 11 Example of Actual Application Pro­cedures
Section 12 Troubleshooting
Appendices
This section provides an introduction to the NJ-series Controllers and their features, and gives the NJ-series Controller specifications.
This section describes the variables and control systems of the CPU Unit and CPU Unit status.
This section describes how to use I/O ports, how to create the slave configuration and unit configuration and how to assign functions.
This section describes the initial settings of the function modules.
This section describes the task system and types of tasks.
This section describes programming, including the programming languages and the variables and instructions that are used in programming.
This section describes simulation of Controller operation and how to use the results of simulation.
This section describes CPU Unit status.
This section describes the functionality provided by the CPU Unit.
This section describes how to go online with the CPU Unit and how to connect to other devices.
This section describes the procedures that are used to actually operate an NJ-series Controller.
This section describes the event codes, error confirmation methods, and corrections for errors that can occur.
The appendices provide the CPU Unit specifications, task execution times, system­defined variable lists, data attribute lists, CJ-series Unit memory information, CJ­series Unit memory allocation methods, and data type conversion information.
NJ-series Instructions Reference Manual (W502)
3
Manual Configuration
NJ-series Instructions Reference Manual (Cat. No. W502) (This Manual)
Section Description
Section 1 Instruction Set
Section 2 Instruction Descriptions
Appendices
This section provides a table of the instructions that are described in this manual.
This section describes instruction specifications in detail.
The appendices provide a table of error codes and other supplemental information to use instructions.
4
NJ-series Instructions Reference Manual (W502)

Sections in this Manual

Sections in this Manual
1
2
1
2
A
I
Instruction Set
A
Instruction Descriptions
I
Appendices
Index
NJ-series Instructions Reference Manual (W502)
5
Sections in this Manual
6
NJ-series Instructions Reference Manual (W502)

CONTENTS

Introduction............................................................................................................... 1
Relevant Manuals...................................................................................................... 2
Manual Configuration............................................................................................... 3
Sections in this Manual............................................................................................ 5
Read and Understand this Manual........................................................................ 15
Safety Precautions ................................................................................................. 19
Precautions for Safe Use ....................................................................................... 20
Precautions for Correct Use .................................................................................. 21
CONTENTS
Regulations and Standards ................................................................................... 22
Unit Versions ........................................................................................................... 24
Related Manuals ..................................................................................................... 27
Revision History ..................................................................................................... 29
Section 1 Instruction Set
Instruction Set ........................................................................................................... 1-2
Section 2 Instruction Descriptions
Using this Section ...................................................................................................... 2-2
Ladder Diagram Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
LD and LDN ............................................................................................................. 2-14
AND and ANDN ....................................................................................................... 2-16
OR and ORN ........................................................................................................... 2-18
Out and OutNot ....................................................................................................... 2-20
ST Statement Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
IF .............................................................................................................................2-24
CASE ....................................................................................................................... 2-28
WHILE ..................................................................................................................... 2-32
REPEAT .................................................................................................................. 2-34
RETURN ................................................................................................................. 2-36
FOR ......................................................................................................................... 2-37
EXIT ........................................................................................................................ 2-38
Sequence Input Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
R_TRIG (Up) and F_TRIG (Down) .......................................................................... 2-40
TestABit and TestABitN ........................................................................................... 2-43
Sequence Output Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-45
RS ........................................................................................................................... 2-46
SR ........................................................................................................................... 2-48
Set and Reset .......................................................................................................... 2-50
SetBits and ResetBits .............................................................................................. 2-53
SetABit and ResetABit ............................................................................................ 2-55
NJ-series Instructions Reference Manual (W502)
7
CONTENTS
OutABit .................................................................................................................... 2-57
Sequence Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-59
End .......................................................................................................................... 2-60
RETURN ................................................................................................................. 2-61
MC and MCR ........................................................................................................... 2-62
JMP ......................................................................................................................... 2-74
FOR and NEXT ....................................................................................................... 2-76
BREAK .................................................................................................................... 2-81
Comparison Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-83
EQ (=) ...................................................................................................................... 2-84
NE (<>) .................................................................................................................... 2-86
LT (<), LE (<=), GT (>), and GE (>=) ...................................................................... 2-88
EQascii .................................................................................................................... 2-91
NEascii .................................................................................................................... 2-93
LTascii, LEascii, GTascii, and GEascii .................................................................... 2-95
Cmp ......................................................................................................................... 2-98
ZoneCmp ............................................................................................................... 2-100
TableCmp .............................................................................................................. 2-102
AryCmpEQ and AryCmpNE .................................................................................. 2-105
AryCmpLT, AryCmpLE, AryCmpGT, and AryCmpGE ........................................... 2-107
AryCmpEQV and AryCmpNEV ............................................................................. 2-110
AryCmpLTV, AryCmpLEV, AryCmpGTV, and AryCmpGEV ................................. 2-112
Timer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-115
TON ....................................................................................................................... 2-116
TOF ....................................................................................................................... 2-120
TP .......................................................................................................................... 2-123
AccumulationTimer ................................................................................................ 2-126
Timer ..................................................................................................................... 2-129
Counter Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-133
CTD ....................................................................................................................... 2-134
CTD_** .................................................................................................................. 2-136
CTU ....................................................................................................................... 2-138
CTU_** .................................................................................................................. 2-140
CTUD .................................................................................................................... 2-142
CTUD_** ................................................................................................................ 2-146
Math Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-151
ADD (+) ................................................................................................................. 2-152
AddOU (+OU) ........................................................................................................ 2-154
SUB (-) .................................................................................................................. 2-156
SubOU (-OU) ......................................................................................................... 2-158
MUL (*) .................................................................................................................. 2-161
MulOU (*OU) ......................................................................................................... 2-163
DIV (/) .................................................................................................................... 2-166
MOD ...................................................................................................................... 2-168
ABS ....................................................................................................................... 2-170
RadToDeg and DegToRad .................................................................................... 2-172
SIN, COS, and TAN .............................................................................................. 2-174
ASIN, ACOS, and ATAN ....................................................................................... 2-177
SQRT .................................................................................................................... 2-180
LN and LOG .......................................................................................................... 2-182
EXP ....................................................................................................................... 2-185
EXPT (**) ............................................................................................................... 2-187
Inc and Dec ........................................................................................................... 2-189
Rand ...................................................................................................................... 2-191
AryAdd ................................................................................................................... 2-193
AryAddV ................................................................................................................ 2-195
ArySub ................................................................................................................... 2-197
ArySubV ................................................................................................................ 2-199
8
NJ-series Instructions Reference Manual (W502)
CONTENTS
AryMean ................................................................................................................ 2-201
ArySD .................................................................................................................... 2-203
ModReal ................................................................................................................ 2-205
Fraction ................................................................................................................. 2-207
CheckReal ............................................................................................................. 2-209
BCD Conversion Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-211
**_BCD_TO_*** ..................................................................................................... 2-212
**_TO_BCD_*** ..................................................................................................... 2-215
BCD_TO_** ........................................................................................................... 2-218
BCDsToBin ............................................................................................................ 2-221
BinToBCDs_** ....................................................................................................... 2-224
AryToBCD ............................................................................................................. 2-227
AryToBin ................................................................................................................ 2-229
Data Type Conversion Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-231
**_TO_*** (Integer-to-Integer Conversion Group) ................................................. 2-232
**_TO_*** (Integer-to-Bit String Conversion Group) .............................................. 2-235
**_TO_*** (Integer-to-Real Number Conversion Group) ....................................... 2-237
**_TO_*** (Bit String-to-Integer Conversion Group) .............................................. 2-239
**_TO_*** (Bit String-to-Bit String Conversion Group) .......................................... 2-242
**_TO_*** (Bit String-to-Real Number Conversion Group) .................................... 2-244
**_TO_*** (Real Number-to-Integer Conversion Group) ....................................... 2-246
**_TO_*** (Real Number-to-Bit String Conversion Group) .................................... 2-249
**_TO_*** (Real Number-to-Real Number Conversion Group) ............................. 2-251
**_TO_STRING (Integer-to-Text String Conversion Group) ................................. 2-253
**_TO_STRING (Bit String-to-Text String Conversion Group) .............................. 2-255
**_TO_STRING (Real Number-to-Text String Conversion Group) ....................... 2-257
RealToFormatString .............................................................................................. 2-259
LrealToFormatString ............................................................................................. 2-264
STRING_TO_** (Text String-to-Integer Conversion Group) ................................. 2-270
STRING_TO_** (Text String-to-Bit String Conversion Group) .............................. 2-272
STRING_TO_** (Text String-to-Real Number Conversion Group) ....................... 2-274
TO_** (Integer Conversion Group) ........................................................................ 2-277
TO_** (Bit String Conversion Group) .................................................................... 2-279
TO_** (Real Number Conversion Group) .............................................................. 2-281
TRUNC, Round, and RoundUp ............................................................................. 2-283
Bit String Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-285
AND (&), OR, and XOR ......................................................................................... 2-286
XORN .................................................................................................................... 2-289
NOT ....................................................................................................................... 2-291
AryAnd, AryOr, AryXor, and AryXorN .................................................................... 2-293
Selection Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-297
SEL ........................................................................................................................ 2-298
MUX ...................................................................................................................... 2-300
LIMIT ..................................................................................................................... 2-302
Band ...................................................................................................................... 2-304
Zone ...................................................................................................................... 2-307
MAX and MIN ........................................................................................................ 2-310
AryMax and AryMin ............................................................................................... 2-312
ArySearch .............................................................................................................. 2-314
Data Movement Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-317
MOVE .................................................................................................................... 2-318
MoveBit ................................................................................................................. 2-321
MoveDigit .............................................................................................................. 2-323
TransBits ............................................................................................................... 2-325
MemCopy .............................................................................................................. 2-327
SetBlock ................................................................................................................ 2-329
Exchange .............................................................................................................. 2-331
AryExchange ......................................................................................................... 2-333
NJ-series Instructions Reference Manual (W502)
9
CONTENTS
AryMove ................................................................................................................ 2-335
Clear ...................................................................................................................... 2-337
Copy**ToNum (Bit String to Signed Integer) ......................................................... 2-339
Copy**To*** (Bit String to Real Number) ............................................................... 2-341
CopyNumTo** (Signed Integer to Bit String) ......................................................... 2-343
CopyNumTo** (Signed Integer to Real Number) .................................................. 2-345
Copy**To*** (Real Number to Bit String) ............................................................... 2-347
Copy**ToNum (Real Number to Signed Integer) .................................................. 2-349
Shift Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-351
AryShiftReg ........................................................................................................... 2-352
AryShiftRegLR ....................................................................................................... 2-354
ArySHL and ArySHR ............................................................................................. 2-357
SHL and SHR ........................................................................................................ 2-360
NSHLC and NSHRC ............................................................................................. 2-362
ROL and ROR ....................................................................................................... 2-364
Conversion Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-367
Swap ..................................................................................................................... 2-368
Neg ........................................................................................................................ 2-369
Decoder ................................................................................................................. 2-371
Encoder ................................................................................................................. 2-374
BitCnt ..................................................................................................................... 2-376
ColmToLine_** ...................................................................................................... 2-377
LineToColm ........................................................................................................... 2-379
Gray ....................................................................................................................... 2-381
PWLApprox ........................................................................................................... 2-384
MovingAverage ..................................................................................................... 2-387
PIDAT .................................................................................................................... 2-393
DispartReal ............................................................................................................ 2-418
UniteReal ............................................................................................................... 2-421
NumToDecString and NumToHexString ............................................................... 2-423
HexStringToNum_** .............................................................................................. 2-426
FixNumToString .................................................................................................... 2-428
StringToFixNum .................................................................................................... 2-430
DtToString ............................................................................................................. 2-433
DateToString ......................................................................................................... 2-435
TodToString ........................................................................................................... 2-436
GrayToBin_** and BinToGray_** .......................................................................... 2-438
StringToAry ........................................................................................................... 2-441
AryToString ........................................................................................................... 2-443
DispartDigit ............................................................................................................ 2-445
UniteDigit_** .......................................................................................................... 2-447
Dispart8Bit ............................................................................................................. 2-449
Unite8Bit_** ........................................................................................................... 2-451
ToAryByte .............................................................................................................. 2-453
AryByteTo .............................................................................................................. 2-458
SizeOfAry .............................................................................................................. 2-463
Stack and Table Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-465
StackPush ............................................................................................................. 2-466
StackFIFO and StackLIFO .................................................................................... 2-475
StackIns ................................................................................................................. 2-478
StackDel ................................................................................................................ 2-480
RecSearch ............................................................................................................. 2-482
RecRangeSearch .................................................................................................. 2-487
RecSort ................................................................................................................. 2-492
RecNum ................................................................................................................ 2-497
RecMax and RecMin ............................................................................................. 2-499
FCS Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-503
StringSum .............................................................................................................. 2-504
StringLRC .............................................................................................................. 2-506
10
NJ-series Instructions Reference Manual (W502)
CONTENTS
StringCRCCCITT ................................................................................................... 2-508
StringCRC16 ......................................................................................................... 2-510
AryLRC_** ............................................................................................................. 2-512
AryCRCCCITT ....................................................................................................... 2-514
AryCRC16 ............................................................................................................. 2-516
Text String Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-519
CONCAT ............................................................................................................... 2-520
LEFT and RIGHT .................................................................................................. 2-522
MID ........................................................................................................................ 2-524
FIND ...................................................................................................................... 2-526
LEN ....................................................................................................................... 2-528
REPLACE .............................................................................................................. 2-529
DELETE ................................................................................................................ 2-531
INSERT ................................................................................................................. 2-533
GetByteLen ........................................................................................................... 2-535
ClearString ............................................................................................................ 2-537
ToUCase and ToLCase ......................................................................................... 2-538
TrimL and TrimR ................................................................................................... 2-540
Time and Time of Day Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-543
ADD_TIME ............................................................................................................ 2-544
ADD_TOD_TIME ................................................................................................... 2-546
ADD_DT_TIME ..................................................................................................... 2-548
SUB_TIME ............................................................................................................ 2-550
SUB_TOD_TIME ................................................................................................... 2-552
SUB_TOD_TOD .................................................................................................... 2-554
SUB_DATE_DATE ................................................................................................ 2-555
SUB_DT_DT ......................................................................................................... 2-556
SUB_DT_TIME ...................................................................................................... 2-558
MULTIME .............................................................................................................. 2-560
DIVTIME ................................................................................................................ 2-562
CONCAT_DATE_TOD .......................................................................................... 2-564
DT_TO_TOD ......................................................................................................... 2-566
DT_TO_DATE ....................................................................................................... 2-568
SetTime ................................................................................................................. 2-570
GetTime ................................................................................................................. 2-572
DtToSec ................................................................................................................ 2-574
DateToSec ............................................................................................................ 2-576
TodToSec .............................................................................................................. 2-577
SecToDt ................................................................................................................ 2-578
SecToDate ............................................................................................................ 2-580
SecToTod .............................................................................................................. 2-582
TimeToNanoSec ................................................................................................... 2-583
TimeToSec ............................................................................................................ 2-584
NanoSecToTime ................................................................................................... 2-585
SecToTime ............................................................................................................ 2-586
ChkLeapYear ........................................................................................................ 2-588
GetDaysOfMonth ................................................................................................... 2-589
DaysToMonth ........................................................................................................ 2-591
GetDayOfWeek ..................................................................................................... 2-593
GetWeekOfYear .................................................................................................... 2-595
DtToDateStruct ...................................................................................................... 2-597
DateStructToDt ...................................................................................................... 2-599
System Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-601
TraceSamp ............................................................................................................ 2-602
TraceTrig ............................................................................................................... 2-605
GetTraceStatus ..................................................................................................... 2-607
SetAlarm ................................................................................................................ 2-610
ResetAlarm ............................................................................................................ 2-615
GetAlarm ............................................................................................................... 2-617
NJ-series Instructions Reference Manual (W502)
11
CONTENTS
ResetPLCError ...................................................................................................... 2-619
GetPLCError .......................................................................................................... 2-622
ResetCJBError ...................................................................................................... 2-624
GetCJBError .......................................................................................................... 2-626
GetEIPError ........................................................................................................... 2-628
ResetMCError ....................................................................................................... 2-630
GetMCError ........................................................................................................... 2-634
ResetECError ........................................................................................................ 2-636
GetECError ............................................................................................................ 2-637
SetInfo ................................................................................................................... 2-639
ResetUnit ............................................................................................................... 2-641
GetNTPStatus ....................................................................................................... 2-645
Communications Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-647
ExecPMCR ............................................................................................................ 2-648
SerialSend ............................................................................................................. 2-658
SerialRcv ............................................................................................................... 2-665
SendCmd .............................................................................................................. 2-674
CIPOpen ................................................................................................................ 2-684
CIPRead ................................................................................................................ 2-692
CIPWrite ................................................................................................................ 2-696
CIPSend ................................................................................................................ 2-701
CIPClose ............................................................................................................... 2-704
CIPUCMMRead ..................................................................................................... 2-706
CIPUCMMWrite ..................................................................................................... 2-710
CIPUCMMSend ..................................................................................................... 2-716
EC_CoESDOWrite ................................................................................................ 2-726
EC_CoESDORead ................................................................................................ 2-729
EC_StartMon ......................................................................................................... 2-734
EC_StopMon ......................................................................................................... 2-740
EC_SaveMon ........................................................................................................ 2-742
EC_CopyMon ........................................................................................................ 2-744
EC_DisconnectSlave ............................................................................................. 2-746
EC_ConnectSlave ................................................................................................. 2-752
SktUDPCreate ....................................................................................................... 2-754
SktUDPRcv ........................................................................................................... 2-761
SktUDPSend ......................................................................................................... 2-764
SktTCPAccept ....................................................................................................... 2-767
SktTCPConnect ..................................................................................................... 2-770
SktTCPRcv ............................................................................................................ 2-777
SktTCPSend .......................................................................................................... 2-780
SktGetTCPStatus .................................................................................................. 2-783
SktClose ................................................................................................................ 2-786
SktClearBuf ........................................................................................................... 2-789
SD Memory Card Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-793
FileWriteVar ........................................................................................................... 2-794
FileReadVar .......................................................................................................... 2-799
FileOpen ................................................................................................................ 2-803
FileClose ............................................................................................................... 2-806
FileSeek ................................................................................................................ 2-809
FileRead ................................................................................................................ 2-812
FileWrite ................................................................................................................ 2-819
FileGets ................................................................................................................. 2-826
FilePuts ................................................................................................................. 2-833
FileCopy ................................................................................................................ 2-840
FileRemove ........................................................................................................... 2-848
FileRename ........................................................................................................... 2-852
DirCreate ............................................................................................................... 2-857
DirRemove ............................................................................................................ 2-860
12
NJ-series Instructions Reference Manual (W502)
Appendices
A-1 Error Codes Related to Instructions ......................................................................................A-2
A-2 Error Code Descriptions .......................................................................................................A-18
A-3 Error Code Details .................................................................................................................A-24
A-4 SDO Abort Codes ..................................................................................................................A-47
CONTENTS
Other Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-863
ReadNbit_** ........................................................................................................... 2-864
WriteNbit_** ........................................................................................................... 2-866
ChkRange ............................................................................................................. 2-868
GetMyTaskStatus .................................................................................................. 2-870
Task_IsActive ........................................................................................................ 2-873
Lock and Unlock .................................................................................................... 2-875
Get**Clk ................................................................................................................. 2-880
Get**Cnt ................................................................................................................ 2-881
Index
NJ-series Instructions Reference Manual (W502)
13
CONTENTS
14
NJ-series Instructions Reference Manual (W502)

Read and Understand this Manual

Read and Understand this Manual
Please read and understand this manual before using the product. Please consult your OMRON representative if you have any questions or comments.
Warranty and Limitations of Liability
WARRANTY
OMRON's exclusive warranty is that the products are free from defects in materials and workmanship for a period of one year (or other period if specified) from date of sale by OMRON.
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, REGARDING NON­INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR PARTICULAR PURPOSE OF THE PRODUCTS. ANY BUYER OR USER ACKNOWLEDGES THAT THE BUYER OR USER ALONE HAS DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE. OMRON DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED.
LIMITATIONS OF LIABILITY
OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED ON CONTRACT, WARRANTY, NEGLIGENCE, OR STRICT LIABILITY.
In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which liability is asserted.
IN NO EVENT SHALL OMRON BE RESPONSIBLE FOR WARRANTY, REPAIR, OR OTHER CLAIMS REGARDING THE PRODUCTS UNLESS OMRON'S ANALYSIS CONFIRMS THAT THE PRODUCTS WERE PROPERLY HANDLED, STORED, INSTALLED, AND MAINTAINED AND NOT SUBJECT TO CONTAMINATION, ABUSE, MISUSE, OR INAPPROPRIATE MODIFICATION OR REPAIR.
NJ-series Instructions Reference Manual (W502)
15
Read and Understand this Manual
Application Considerations
SUITABILITY FOR USE
OMRON shall not be responsible for conformity with any standards, codes, or regulations that apply to the combination of products in the customer's application or use of the products.
At the customer's request, OMRON will provide applicable third party certification documents identifying ratings and limitations of use that apply to the products. This information by itself is not sufficient for a complete determination of the suitability of the products in combination with the end product, machine, system, or other application or use.
The following are some examples of applications for which particular attention must be given. This is not intended to be an exhaustive list of all possible uses of the products, nor is it intended to imply that the uses listed may be suitable for the products:
• Outdoor use, uses involving potential chemical contamination or electrical interference, or conditions or uses not described in this manual.
• Nuclear energy control systems, combustion systems, railroad systems, aviation systems, medical equipment, amusement machines, vehicles, safety equipment, and installations subject to separate industry or government regulations.
• Systems, machines, and equipment that could present a risk to life or property.
Please know and observe all prohibitions of use applicable to the products.
NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO ADDRESS THE RISKS, AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
PROGRAMMABLE PRODUCTS
OMRON shall not be responsible for the user's programming of a programmable product, or any consequence thereof.
16
NJ-series Instructions Reference Manual (W502)
Read and Understand this Manual
Disclaimers
CHANGE IN SPECIFICATIONS
Product specifications and accessories may be changed at any time based on improvements and other reasons.
It is our practice to change model numbers when published ratings or features are changed, or when significant construction changes are made. However, some specifications of the products may be changed without any notice. When in doubt, special model numbers may be assigned to fix or establish key specifications for your application on your request. Please consult with your OMRON representative at any time to confirm actual specifications of purchased products.
DIMENSIONS AND WEIGHTS
Dimensions and weights are nominal and are not to be used for manufacturing purposes, even when tolerances are shown.
PERFORMANCE DATA
Performance data given in this manual is provided as a guide for the user in determining suitability and does not constitute a warranty. It may represent the result of OMRON's test conditions, and the users must correlate it to actual application requirements. Actual performance is subject to the OMRON Warranty and Limitations of Liability.
ERRORS AND OMISSIONS
The information in this manual has been carefully checked and is believed to be accurate; however, no responsibility is assumed for clerical, typographical, or proofreading errors, or omissions.
NJ-series Instructions Reference Manual (W502)
17
Read and Understand this Manual
18
NJ-series Instructions Reference Manual (W502)

Safety Precautions

Refer to the following manuals for safety precautions.
• NJ-series CPU Unit Hardware User’s Manual (Cat No. W500)
• NJ-series CPU Unit Software User’s Manual (Cat No. W501)
Safety Precautions
NJ-series Instructions Reference Manual (W502)
19

Precautions for Safe Use

Precautions for Safe Use
Refer to the following manuals for precautions for safe use.
• NJ-series CPU Unit Hardware User’s Manual (Cat No. W500)
• NJ-series CPU Unit Software User’s Manual (Cat No. W501)
20
NJ-series Instructions Reference Manual (W502)

Precautions for Correct Use

Refer to the following manuals for precautions for correct use.
• NJ-series CPU Unit Hardware User’s Manual (Cat No. W500)
• NJ-series CPU Unit Software User’s Manual (Cat No. W501)
Precautions for Correct Use
NJ-series Instructions Reference Manual (W502)
21

Regulations and Standards

Regulations and Standards
Conformance to EC Directives
Applicable Directives
• EMC Directives
• Low Voltage Directive
Concepts
z EMC Directive
OMRON devices that comply with EC Directives also conform to the related EMC standards so that they can be more easily built into other devices or the overall machine. The actual products have been checked for conformity to EMC standards.* Whether the products conform to the standards in the system used by the customer, however, must be checked by the customer. EMC-related performance of the OMRON devices that comply with EC Directives will vary depending on the configuration, wiring, and other conditions of the equipment or control panel on which the OMRON devices are installed. The customer must, therefore, perform the final check to confirm that devices and the overall machine conform to EMC standards.
* Applicable EMC (Electromagnetic Compatibility) standards are as follows:
EMS (Electromagnetic Susceptibility): EN 61131-2 and EN 61000-6-2 EMI (Electromagnetic Interference): EN 61131-2 and EN 61000-6-4 (Radiated emission: 10-m regulations)
z Low Voltage Directive
Always ensure that devices operating at voltages of 50 to 1,000 VAC and 75 to 1,500 VDC meet the required safety standards. The applicable directive is EN 61131-2.
z Conformance to EC Directives
The NJ-series Controllers comply with EC Directives. To ensure that the machine or device in which the NJ-series Controller is used complies with EC Directives, the Controller must be installed as fol­lows:
• The NJ-series Controller must be installed within a control panel.
• You must use reinforced insulation or double insulation for the DC power supplies connected to DC Power Supply Units and I/O Units.
• NJ-series Controllers that comply with EC Directives also conform to the Common Emission Stan­dard (EN 61000-6-4). Radiated emission characteristics (10-m regulations) may vary depending on the configuration of the control panel used, other devices connected to the control panel, wir­ing, and other conditions. You must therefore confirm that the overall machine or equipment complies with EC Directives.
22
NJ-series Instructions Reference Manual (W502)
Conformance to Shipbuilding Standards
The NJ-series Controllers comply with the following shipbuilding standards. Applicability to the ship­building standards is based on certain usage conditions. It may not be possible to use the product in some locations. Contact your OMRON representative before attempting to use a Controller on a ship.
Usage Conditions for NK and LR Shipbuilding Standards
• The NJ-series Controller must be installed within a control panel.
• Gaps in the door to the control panel must be completely filled or covered with gaskets or other material.
• The following noise filter must be connected to the power supply line.
Noise Filter
Manufacturer Model
Cosel Co., Ltd. TAH-06-683
Regulations and Standards
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products.
• Windows, Windows 98, Windows XP, Windows Vista, and Windows 7 are registered trademarks of Microsoft Corporation in the USA and other countries.
•EtherCAT is a registered trademark of Beckhoff Automation GmbH for their patented technology.
• The SD logo is a trademark of SD-3C, LLC.
Other company names and product names in this document are the trademarks or registered trade­marks of their respective companies.
Software Licenses and Copyrights
This product incorporates certain third party software. The license and copyright information associ­ated with this software is available at http://www.fa.omron.co.jp/nj_info_e/.
NJ-series Instructions Reference Manual (W502)
23

Unit Versions

Unit Versions
Unit Versions
A “unit version” has been introduced to manage CPU Units in the NJ Series according to differences in functionality accompanying Unit upgrades.
Notation of Unit Versions on Products
The unit version is given on the ID information label of the products for which unit versions are man­aged, as shown below.
Example for NJ-series NJ501-@@@@ CPU Unit:
ID information label
Unit model
NJ501 -1500 Ver.1.@@
PORT1 MAC ADDRESS: @@@@@@@@@@@@ PORT2 MAC ADDRESS: @@@@@@@@@@@@
Lot No. DDMYY@ xxxx
Unit version
Lot number and serial number MAC address
The following information is provided on the ID information label.
Item Description
Unit model Gives the model of the Unit.
Unit version Gives the unit version of the Unit.
Lot number and serial number
MAC address Gives the MAC address of the built-in port on the Unit.
Gives the lot number and serial number of the Unit.
DDMYY: Lot number, @: For use by OMRON, xxxx: Serial number
“M” gives the month (1 to 9: January to September, X: October, Y: November, Z: December)
24
Confirming Unit Versions with Sysmac Studio
You can use the Unit Production Information on the Sysmac Studio to check the unit version of the CPU Unit, CJ-series Special I/O Units, CJ-series CPU Bus Units, and EtherCAT slaves. The unit versions of CJ-series Basic I/O Units cannot be checked from the Sysmac Studio.
z CPU Unit and CJ-series Units
1 Double-click CPU/Expansion Racks under Configurations and Setup in the Multiview
Explorer. Or, right-click CPU/Expansion Racks under Configurations and Setup and select Edit from the menu.
The Unit Editor is displayed for the Controller Configurations and Setup layer.
NJ-series Instructions Reference Manual (W502)
Unit Versions
2 Right-click any open space in the Unit Editor and select Production Information.
The Production Information Dialog Box is displayed.
Simple Display Detailed Display
In this example, “Ver.1.0” is displayed next to the unit model.
The following items are displayed.
CPU Unit CJ-series Units
Unit model
Unit version
Lot number
Unit model
Unit version
Lot number
Rack number, slot number, and unit number
z EtherCAT Slaves
1 Double-click EtherCAT under Configurations and Setup in the Multiview Explorer. Or, right-
click EtherCAT under Configurations and Setup and select Edit from the menu.
The EtherCAT Configuration Tab Page is displayed for the Controller Configurations and Setup layer.
2 Right-click the master in the EtherCAT Configurations Editing Pane and select Display Produc-
tion Information.
The Production Information Dialog Box is displayed.
The following items are displayed. Node address Type information* Serial number
* If the model number cannot be determined (such as when there is no ESI file), the vendor ID, product
code, and revision number are displayed.
NJ-series Instructions Reference Manual (W502)
25
Unit Versions
Unit Version Notation
In this manual, unit versions are specified as shown in the following table.
Product nameplate Notation in this manual Remarks
“Ver.1.0” or later to the right of the lot number
Unit version 1.0 or later Unless unit versions are specified, the information in this manual
applies to all unit versions.
26
NJ-series Instructions Reference Manual (W502)

Related Manuals

The following manuals are related to the NJ-series Controllers. Use these manuals for reference.
Manual name Cat. No. Model numbers Application Description
NJ-series CPU Unit Hardware User’s Manual
NJ-series CPU Unit Soft­ware User’s Manual
NJ-series CPU Unit Motion Control User’s Manual
NJ-series Instructions Reference Manual
NJ-series Motion Control Instructions Reference Manual
CJ-series Special Unit Manuals for NJ-series CPU Unit
W500 NJ501-@@@@ Learning the basic specifi-
cations of the NJ-series CPU Units, including intro­ductory information, designing, installation, and maintenance. Mainly hard­ware information is pro­vided.
W501 NJ501-@@@@ Learning how to program
and set up an NJ-series CPU Unit. Mainly software information is provided.
W507 NJ501-@@@@ Learning about motion
control settings and pro­gramming concepts.
W502 NJ501-@@@@ Learning about the specifi-
W508 NJ501-@@@@ Learning about the specifi-
W490 W498 W499 W491 Z317 W492 W494 W497
CJ1W-@@@@ Learning how to use CJ-
cations of the instruction set that is provided by OMRON.
cations of the motion con­trol instructions that are provided by OMRON.
series Units with an NJ­series CPU Unit.
An introduction to the entire NJ-series system is provided along with the following information on a Controller built with an NJ501 CPU Unit.
• Features and system configuration
• Introduction
• Part names and functions
• General specifications
• Installation and wiring
• Maintenance and inspection
Use this manual together with the NJ-series CPU Unit Software User’s Manual (Cat. No. W501).
The following information is provided on a Con­troller built with an NJ501 CPU Unit.
• CPU Unit operation
• CPU Unit features
• Initial settings
• Programming based on IEC 61131-3 lan­guage specifications
Use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500).
The settings and operation of the CPU Unit and programming concepts for motion control are described. Use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Soft- ware User’s Manual (Cat. No. W501).
The instructions in the instruction set (IEC 61131-3 specifications) are described. When programming, use this manual together with the
NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Soft­ware User’s Manual (Cat. No. W501).
The motion control instructions are described. When programming, use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500), NJ-series CPU Unit Software User’s Manual (Cat. No. W501) and
NJ-series CPU Unit Motion Control User’s Man­ual (Cat. No. W507).
The methods and precautions for using CJ­series Units with an NJ501 CPU Unit are described, including access methods and pro­gramming interfaces. Manuals are available for the following Units. Analog I/O Units, Insulated-type Analog I/O Units, Temperature Control Units, ID Sensor Units, High-speed Counter Units, Serial Com­munications Units, and DeviceNet Units.
Use these manuals together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Software User’s Manual (Cat. No. W501).
Related Manuals
NJ-series Instructions Reference Manual (W502)
27
Related Manuals
Manual name Cat. No. Model numbers Application Description
NJ-series CPU Unit Built­in EtherCAT Port User’s Manual
NJ-series CPU Unit Built­in EtherNet/IP Port User’s Manual
NJ-series Troubleshoot­ing Manual
Sysmac Studio Version 1 Operation Manual
CX-Integrator CS/CJ/CP/NSJ-series Network Configuration Tool Operation Manual
CX-Designer User’s Manual
CX-Protocol Operation Manual
W505 NJ501-@@@@ Using the built-in EtherCAT
port on an NJ-series CPU Unit.
W506 NJ501-@@@@ Using the built-in Ether-
Net/IP port on an NJ-series CPU Unit.
W503 NJ501-@@@@ Learning about the errors
that may be detected in an NJ-series Controller.
W504 SYSMAC-
SE2@@@
W464 Learning how to configure
V099 Learning to create screen
W344 Creating data transfer pro-
Learning about the operat­ing procedures and func­tions of the Sysmac Studio.
networks (data links, rout­ing tables, Communica­tions Unit settings, etc.).
data for NS-series Pro­grammable Terminals.
tocols for general-purpose devices connected to CJ­series Serial Communica­tions Units.
Information on the built-in EtherCAT port is pro­vided. This manual provides an introduction and provides information on the configuration, fea­tures, and setup. Use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Software User’s Manual (Cat. No. W501).
Information on the built-in EtherNet/IP port is provided. Information is provided on the basic setup, tag data links, and other features. Use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Software User’s Manual (Cat. No. W501).
Concepts on managing errors that may be detected in an NJ-series Controller and informa­tion on individual errors are described. Use this manual together with the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500) and NJ-series CPU Unit Software User’s Manual (Cat. No. W501).
Describes the operating procedures of the Sys­mac Studio.
Describes operating procedures for the CX-Inte­grator.
Describes operating procedures for the CX­Designer.
Describes operating procedures for the CX-Pro­tocol.
28
NJ-series Instructions Reference Manual (W502)
Loading...
+ 960 hidden pages