EasyManuals Logo

Omron NJ501-1500 User Manual

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #717 background imageLoading...
Page #717 background image
2-669
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
SerialRcv
• The instruction is executed only when there is an available port. Therefore, use the system-defined
variable _Port_isAvailable (Network Communications Instruction Enabled Flag) in an N.O. execution
condition for the instruction.
• Execute the instruction only when the Reception Completed Flag (P#_NopRcvCompleteSta) is
TRUE.
• The instruction is not executed while Busy is TRUE. Therefore, use Busy in an N.C. execution condi-
tion for the instruction.
• If the instruction is used in ST, make sure that the instruction is processed each task period as long
as instruction execution continues. Otherwise, normal processing is sometimes not possible.
• An error occurs in the following cases. Error will change to TRUE.
• The serial communications mode is not set to No-protocol Mode when the instruction is executed.
• The value of _Port_isAvailable is FALSE.
• The value of Port.UnitNo or Port.PhysicPortNo is outside of the valid range.
• There is no CJ-series Serial Communications Unit with the specified unit number.
• The value of Size is outside of the valid range.
• The value of Size exceeds the size of DstDat[].
• Communications fail.
• The instruction is executed during a Unit restart.
• For this instruction, expansion error code ErrorIDEx gives the communications response code. The
values and meanings are listed in the following table. An expansion error code is output to ErrorIDEx
when the value of error code ErrorID is WORD#16#0800.
In this sample, data that was read by the barcode reader that is connected to serial port 2 of a CJ-series
Serial Communications Unit (unit number 0, device name ‘Barcode’) is received. The receive data is
stored in array variable RecvDat[]. There is no start code and the end code is 16#OD (CR).
Value Meaning
16#00000401 The serial communications mode is set to Protocol Macro, NT Link, Echoback Test, or
Serial Gateway Mode.
16#00000205 The serial communications mode is set to Host Link Mode.
16#00001001 The command is too long.
16#00001002 The command is too short.
16#00001004 The command format is incorrect.
16#0000110C This is another parameter error.
16#00002201 The SerialSend or SerialRcv instruction is already in execution.
16#00002202 The protocol is being switched, so execution is not possible.
Sample Programming
Serial Communications Unit
with unit number 0
Barcode reader
Serial port 2
Read data received.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals