Page 2
Microsoft product screen shots used with permission from Microsoft. Windows is a registered trademark of Microsoft Corporation in the USA and other countries. Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products.
To ensure system safety, make sure to always read and follow the information provided in all Safety Precautions and Precautions for Safe Use in the manuals for each device which is used in the system. The following OMRON Corporation (hereinafter referred to as “OMRON”) manuals are related to this document: Cat. No.
2. Terms and Definitions 2. Terms and Definitions Term Description/Definition IP Address Ethernet uses IP addresses to achieve communications. Each IP address (specifically, Internet Protocol address) identifies a specific node (host computer, controller, etc.) on an Ethernet network, IP addresses must be set and managed so that they are not duplicated. Socket A socket is an interface that allows you to directly use TCP or UDP functions from a user program.
(4) It is prohibited to copy, to reproduce, and to distribute a part or the whole of this document without the permission of OMRON Corporation. (5) The information contained in this document is current as of November 2023.
In this project file, the Ethernet connection is checked by sending a read trigger command to the code reader and receiving the read data from it. Obtain the latest version of the Sysmac Studio Project File from OMRON in advance. Name...
For details on the above products (other than communication connection procedures), please refer to the instruction manual for the product or contact OMRON. Note From among the above applicable devices, this document uses the devices listed in section 5.2 for the connection check.
USB cable Ethernet cable LAN cable V430-WE-3M PoE hub LAN cable 24 VDC power supply Manufacturer Name Model Version OMRON NJ Series CPU Unit NJ301-1200 Ver. 1.19 (Built-in EtherNet/IP Port) OMRON Power Supply Unit NJ-PA3001 OMRON Switching hub W4S1-05C OMRON Sysmac Studio SYSMAC-SE2...
Page 10
5. Applicable Products and Device Configuration Precautions for Correct Use Obtain the latest version of the Sysmac Studio Project File from OMRON in advance. (Contact OMRON for information on how to obtain this file.) Note The configuration may not be reproduced if the system component models or versions differ.
6. Ethernet Settings 6. Ethernet Settings This section shows the specifications of the communication parameter settings, variable names and other information provided in this document. Note This document and the project file only cover the operations that you can perform using the settings and commands described in this section.
6. Ethernet Settings 6.2. Example of Connection Check for Communications This document assumes that you use a program in structured text (hereinafter, ST) language to execute “socket open”, “send and receive”, and “socket close” from the controller to the code reader. Press the trigger button on the code reader to read the code.
Execute the project file and check that correct data Checking the Receive Data is written to controller variables. Precautions for Correct Use Obtain the latest version of the Sysmac Studio Project File from OMRON in advance. (Contact OMRON for information on how to obtain this file.)
7. Connection Procedure 7.2. Code Reader Setup Set up the code reader. Precautions for Correct Use Use a PC (personal computer) to set the parameters for the code reader. Note that you may need to change the PC settings depending on the condition of your PC. 7.2.1.
Page 15
7. Connection Procedure Static connection (Setting the fixed IP address) (1) Click the Start Button at the lower left corner of the screen, and then click Settings. (2) Select Windows Settings – Network & Internet. (3) Under Change your network settings, click Change adapter options. (4) In Network Connections, right-click on the Ethernet icon and select Properties.
Page 16
7. Connection Procedure Click on the gear icon on the upper right of the screen and select Advanced. The Advanced Settings Screen appears. Select the Communications Tab and check the settings for Ethernet shown in the red frame. To use the defaults, you do not need to change the settings.
Page 17
7. Connection Procedure Click on the icon shown in the red frame to save the settings to the code reader. Finally, check the version number of the code reader. Click on the gear icon on the upper right of the screen and select About WebLink.
OMRON_V460_NJ_ETN(TCP)_ V100.csm2 (Sysmac Studio Project File) and click Open. * Obtain the latest version of the Sysmac Studio Project File from the OMRON website. The OMRON_ V460_NJ_ETN(TCP)_V100 Project Window is displayed. The window consists of three panes: “Multiview Explorer” on the left side, “Edit Pane”...
Page 19
7. Connection Procedure 7.3.2. Checking Parameters and Executing Builds Check the setting parameters. Then, perform program checks and builds on project data. Double-click Built-in EtherNet/IP Port Settings under Configurations and Setup – Controller Setup in the Multiview Explorer. The Built-in EtherNet/IP Port Settings Tab Page is displayed in the Edit Pane.
Page 20
7. Connection Procedure Select Check All Programs from the Project Menu. The Build Tab Page is displayed under the Edit Pane. Confirm that 0 is shown for both Errors and Warnings. Select Rebuild Controller from the Project Menu. A dialog box showing the progress of conversion appears.
Page 21
7. Connection Procedure 7.3.3. Going Online and Transferring the Project Data Place the Sysmac Studio online and transfer the project data to the controller. Select Communications Setup from the Controller Menu. The Communications Setup Dialog Box is displayed. In Connection type, select the Direct connection via USB Option.
Page 22
7. Connection Procedure Note Refer to Section 6 Online Connections to a Controller in the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on online connection to the controller. When you are online, a yellow border appears in the upper part of the Edit Pane.
7. Connection Procedure Confirm that the synchronized data is now shown in the text color of Synchronized and the following message is displayed: The Synchronization process successfully finished. If there is no problem, click Close. * If synchronization fails, check the physical connections and redo the procedure.
Page 24
7. Connection Procedure Confirm that the RUN mode is shown in the Controller Status Pane of the Sysmac Studio. If PROGRAM mode is shown, select Mode – RUN Mode from the Controller Menu. A confirmation dialog box appears. Click Yes. Check that the controller is in a Monitor state by the Monitor and Stop Monitoring Buttons...
Page 25
7. Connection Procedure The Watch window Tab Page is displayed under the Edit Pane. Confirm that the variables shown in the figure on the right Start of input are listed in the Name column. Error codes * If any of the required variables are not listed, click Input Name and add them.
Page 26
7. Connection Procedure In addition, the Online value of Local_Status.Done indicating the program execution status is True. If the program ends with an error, the value of Local_Status.Error is True. * If you click FALSE for Input_Start, the values of Local_Status also change to False.
8. Initializing the System 8. Initializing the System This document assumes that each device uses the factory default settings. If you change their settings from the defaults, you may not be able to perform various setting procedures as described. 8.1. Initializing the Controller To initialize the controller, initialize the CPU Unit.
9.1. Overview This section describes the specifications and functions of the project file used for connecting a V460-H Series Code Reader (hereinafter referred to as “code reader”) to a controller’s built-in EtherNet/IP port (hereinafter referred to as “built-in EtherNet/IP port”).
Page 29
9. Project File 9.1.1. Communications Data Flow This is the flow from issuing a TCP socket communications command from the built-in EtherNet/IP port to the code reader and receiving response data from the code reader. The project file executes a processing sequence of TCP open to TCP close in a continuous manner.
Page 30
9. Project File 9.1.2. TCP Socket Communications Using Socket Service Instructions This section provides an overview of function blocks for TCP socket services (hereinafter referred to as “socket service instructions”) and the general movement of send and receive messages. Note For details, refer to EtherNet/IP Communications Instructions in Section 2 Instruction Descriptions of the Machine Automation Controller NJ/NX-series Instructions Reference Manual (Cat.
Page 31
9. Project File ● Send and Receive Messages Send message Header Command data Footer Controller Code reader Receive message (Response) Header Response data Footer Receive message (Error response) Header Response data (Error code) Footer ● Communications Sequence The figure below shows the processing flow of TCP communications between the code reader (server) and the controller (client).
9. Project File 9.2. Error Judgment Processing This section describes error judgment processing in the project file. 9.2.1. Error Judgment in the Project File In this project file, error judgment processing is executed for the following three types of errors (1) to (3).
Page 33
9. Project File 9.2.2. Time Monitoring Function This section describes the time monitoring function in the project file. The monitoring time settings can be changed by using variables in the function block ParameterSet. ● Time Monitoring Using Internal Timers of the Project File Assuming that processing has the executing status and does not end due to an error, the project file uses its internal timers to interrupted the processing (i.e., timeout).
9. Project File 9.3. Variables Used This section describes variables used in the project file. 9.3.1. Lists of Variables Used Below are lists of variables required in order to execute this project file. ● Input Variable The following variable is used to manipulate the project file. Variable name Data type Description...
Page 35
9. Project File ● Internal Variables The following variables are used only for the purpose of calculation in the project file. Variable name Data type Description Local_Status sStatus Program execution status (STRUCT) Busy BOOL Changes to TRUE when the project file is executed and to FALSE when it is not executed.
Page 36
9. Project File Variable name Data type Description Local_ExecFlgs sControl Socket service instruction execution flag (STRUCT) Send BOOL Send Processing instruction: Executed (TRUE)/Not executed (FALSE) Recv BOOL Receive Processing instruction: Executed (TRUE)/Not executed (FALSE) Open BOOL Open Processing instruction: Executed (TRUE)/Not executed (FALSE) Close BOOL Close Processing instruction:...
Page 37
9. Project File Variable name Data type Description Local_ComType sControl Sets whether or not send processing or receive (STRUCT) processing is required. Send BOOL Send processing: Required (TRUE)/Not required (FALSE) * If send processing is required, but receive processing is not required: The program will skip receive processing and go to close processing without waiting for receive data in send processing.
Page 38
9. Project File 9.3.2. Lists of Variables Used in User-defined Function Blocks/Functions Below are lists of function blocks that must be user-defined in programs in order to execute this project file. For information on the following function block variables, refer to 9.4.3. Detailed Explanation of Function Blocks.
9. Project File 9.4. Programs (ST Language) 9.4.1. Functional Components of the ST Language Program This project file is written in the ST language. The functional components of the project file are as follows. Category Subcategory Description 1.1. Communications Processing Executes communications processing.
Page 40
9. Project File Category Subcategory Description 6.1. Close Processing Status Executes close processing. 6. Close Processing Judgment and Execution Flag Processing starts in the following cases. Setting • Receive Processing Required Flag is 6.2. Close Processing Time set to Not required and send processing Monitoring Timer Execution has ended normally.
Page 41
9. Project File 9.4.2. Detailed Explanation of the Main Program A detailed explanation of the project file is given below. Communication settings that need to be changed depending on the code reader, send data (command) settings, and receive data (response data) are checked in function blocks (ETN_ParameterSet_instance, ETN_SendMessageSet_instance, and ETN_ReceiveCheck_instance).
Page 50
9. Project File 9.4.3. Detailed Explanation of Function Blocks This project file uses the following function blocks. In the printout of function blocks given below, data that is variable depending on the code reader is shown in red frames. ● Details of the ETN_ParameterSet_instance Function Block (ParameterSet) Graphic Instruction Name...
Page 52
9. Project File ● Details of the ETN_SendMessageSet_instance Function Block (SendMessageSet) Graphic Instruction Name FB/FUN ST expression expression Ethernet SendMessage ETN_SendMessageSet_instance Communications None (Execute, Send_Data, ComType); Sequence Setting • In-out Variable Table • Input Variable Initial Data type Name Description Valid range Unit name...
9. Project File 9.5. Timing Chart The timing chart for the ST language program is shown below. Start and Setup Input_Start Local_Status. BoolData[0](Busy) Send data **** Control data **** Common **** parameters Receive data 0000 Output_sktCmds 0000 ErrorID Local_Status. BoolData[1](Done) or Local_Status.
9. Project File 9.6. Error Processing 9.6.1. Error Code List This section lists error codes that can occur during the execution of the ST language program. ● TCP Connection Status Error (Output_EtnTcpSta) If the TCP connection status does not return to the normal state (_CLOSED) within the specified time after close processing, the TCP connection status code is set in the variable Output_EtnTcpSta.
Page 63
9. Project File ● Error Codes (Output_SktCmdsErrorID, Output_SkTcloseErrorID) If an error occurs in open processing, send processing, or receive processing, the error code is set in the variable Output_SktCmdsErrorID before execution of close processing. If an error occurs in close processing, the error code is set in the variable Output_SkTcloseErrorID and the processing ends.
Page 64
9. Project File ● Error Flags (Error End, Timeout) (Output_ErrCode) If open, send, receive, or close processing ends with an error or times out, an error flag is set in the variable Output_ErrCode, and an error code is stored in the variable Output_SktCmdsErrorID or Output_SkTcloseErrorID.
Page 65
9. Project File 9.6.2. TCP Connection Status Error Situation and Correction This section describes the situation and corrections if a TCP connection status error occurs. ● Effect of a TCP Connection Status Error If, after the occurrence of a TCP connection status error, you execute the project file again without taking any corrective action or without noticing the error, the following error may occur: The remote node specified by the input variable DstAdr (Destination Address) or DstTcpPort (Destination Port) is not waiting for a connect request.
Need help?
Do you have a question about the V460-H Series and is the answer not in the manual?
Questions and answers