background image

9. Program 

 40

 

9.4.  Variables 

The table below lists the variables used in this program.   
 

9.4.1.  List of Variables 

The data types, external variables (user-defined global variables/system-defined variables), 
and internal variables used in this program are listed below.   
 

Data type (Structure) 

[Communications processing status flags] 

Name 

Data type 

Description 

sStatus 

STRUCT 

Structure of the communications processing status flags 

Busy BOOL 

Communications processing in progress flag 
TRUE: Processing is in progress.   
FALSE: Processing is not in progress. 

Done BOOL 

Communications processing normal end flag 
TRUE: Normal end / FALSE: Other than normal end 

 

Error BOOL 

Communications processing error end flag 
TRUE: Error end / FALSE: Other than error end 

 

[Socket service instruction execution flags] 

Name 

Data type 

Description 

sControl STRUCT 

Socket 

service 

instruction execution flags 

 Send 

BOOL 

Send processing instruction 
TRUE: Executed / FALSE: Not executed 

 Recv 

BOOL 

Receive processing instruction 
TRUE: Executed / FALSE: Not executed 

 Open 

BOOL 

Connect processing instruction 
TRUE: Executed / FALSE: Not executed 

 Close 

BOOL 

Close processing instruction 
TRUE: Executed / FALSE: Not executed 

 Status 

BOOL 

TCP socket status read processing instruction 
TRUE: Executed / FALSE: Not executed 

 
[Timer enable flags] 

Name 

Data type 

Description 

sTimerControl 

STRUCT 

Time monitoring timer enable flags 

 Tfs 

BOOL 

Send processing time monitoring timer instruction 
TRUE: Enabled / FALSE: Not enabled 

 Tfr 

BOOL

 

Receive processing time monitoring timer instruction 
TRUE: Enabled / FALSE: Not enabled 

 Topen 

BOOL

 

Connect processing time monitoring timer instruction 
TRUE: Enabled / FALSE: Not enabled 

 Tclose 

BOOL

 

Close processing time monitoring timer instruction 
TRUE: Enabled / FALSE: Not enabled 

 Tr 

BOOL

 

Receive waiting time monitoring timer instruction 
TRUE: Enabled / FALSE: Not enabled 

 

Summary of Contents for V750 series

Page 1: ...Machine Automation Controller NJ series General purpose Ethernet Connection Guide TCP IP OMRON Corporation V750 series RFID System P543 E1 01...

Page 2: ...therCAT is registered trademark and patented technology licensed by Beckhoff Automation GmbH Germany Ethernet is a registered trademark of Xerox Corporation Java and all Java related trademarks and lo...

Page 3: ...9 6 2 Example of Checking Connection 10 7 Connection Procedure 11 7 1 Work Flow 11 7 2 Setting Up the RFID Reader Writer 12 7 3 Setting Up the Controller 18 7 4 Connection Status Check 25 8 Initializ...

Page 4: ...of manuals for each device which is used in the system Cat No Model Manual name W500 NJ501 NJ301 NJ series CPU Unit Hardware User s Manual W501 NJ501 NJ301 NJ series CPU Unit Software User s Manual W...

Page 5: ...a node as a client is called connect processing and the processing executed to open as a server is called accept processing Keep alive function When the keep alive function is used with TCP IP socket...

Page 6: ...provided in all Safety Precautions Precautions for Safe Use and Precaution for Correct Use of manuals for each device used in the system 3 The users are encouraged to confirm the standards and regula...

Page 7: ...to do and what not to do to ensure using the product safely Precautions for Correct Use Indicates precautions on what to do and what not to do to ensure proper operation and performance Additional Inf...

Page 8: ...ile beforehand For information on how to obtain the file contact your OMRON representative Name File name Version Sysmac Studio project file extension smc OMRON_V750_ETN TCP _EV101 smc Ver 1 01 Herein...

Page 9: ...ocedure for connecting devices and checking the connection You cannot use devices with versions lower than the versions listed in Section 5 2 To use the above devices with versions not listed in Secti...

Page 10: ...0 HS01CA OMRON Antenna cable V740 A01 M OMRON AC Adapter included Precautions for Correct Use Prepare the latest project file in advance To obtain the file contact your OMRON representative Precaution...

Page 11: ...figuration model and version If they are different from your configuration Contact your OMRON representative Additional Information In this document a USB is used to connect with the Controller For in...

Page 12: ...efault Subnet mask 255 255 255 0 255 255 255 0 Default Gateway 192 168 1 254 Default In this document the gateway setting is unnecessary because the connection is made in the same segment 6 1 2 Commun...

Page 13: ...GETR TYP FWV read the product type and firmware version of the memory data The following figure outlines the operation Controller Ethernet RFID Reader Writer Project file Local_ SrcData Variable Local...

Page 14: ...p the Controller 7 3 1 Starting the Sysmac Studio and Importing the Project File Start the Sysmac Studio and import the project file 7 3 2 Checking the Parameters and Building Check the set parameters...

Page 15: ...Precautions for Correct Use Set the parameters of the RFID Reader Writer by using the Ethernet communications of the personal computer Note that you may need to change the settings of the personal com...

Page 16: ...he IP address of the personal computer 1 Click Connect to the Internet View network status and tasks Change adapter settings on the Control Panel 2 Double click Local Area Connection on the Network Co...

Page 17: ...7 Connection Procedure 5 The Internet Options Dialog Box is displayed Select the Connections Tab 6 The Internet Options Dialog Box is displayed Click the LAN settings Button 14...

Page 18: ...l Area Network LAN Settings Dialog Box is displayed Confirm that the Use a proxy server for your LAN Check Box is cleared from the Proxy server Field and click the OK Button 8 Click the OK Button on t...

Page 19: ...the Save Button Host Name V750 BA50C04 US Domain Name Blank DHCP OFF IP Address 192 168 250 2 Subnet Mask 255 255 255 0 Gateway 192 168 1 254 TCP IP Port 7090 If the settings are different from the ab...

Page 20: ...tional Information In addition to changing the Ethernet settings on the web browser screen you can set and read the Ethernet parameters by using the setting commands SETR and GETR For information on t...

Page 21: ...oller Start the Sysmac Studio and click the Import Button If a confirmation dialog for an access right is displayed at start select to start 2 The Import File Dialog Box is displayed Select OMRON_V750...

Page 22: ...splayed in the Edit Pane Click the TCP IP Settings Button select the Fixed setting Option in the IP Address Field and confirm that the following settings are made IP address 192 168 250 1 Subnet mask...

Page 23: ...in the Edit Pane Confirm that 0 Errors and 0 Warnings are displayed 7 Select Rebuild Controller from the Project Menu A screen is displayed indicating the conversion is being performed 8 Confirm that...

Page 24: ...or machines may perform unexpected operation regardless of the operating mode of the CPU Unit 1 Select Change Device from the Controller Menu 2 The Change Device Dialog Box is displayed Confirm that...

Page 25: ...from Connection Type Click the OK Button 6 Select Online from the Controller Menu If the dialog on the right is displayed the model or version of the Controller does not match those of the project fil...

Page 26: ...essing The displayed serial ID differs depending on the device Additional Information For details on the online connections to a Controller refer to Section 5 Going Online with a Controller in the Sys...

Page 27: ...A screen stating Synchronizing is displayed A confirmation dialog box is displayed Click the Yes Button 12 Confirm that the synchronized data is displayed with the color specified by Synchronized and...

Page 28: ...rect Use Please confirm that the LAN cable is connected before proceeding to the following steps If it is not connected turn OFF the power to the devices and then connect the LAN cable 7 4 1 Executing...

Page 29: ...ck Input Name Program0 of the Name is omitted from the following descriptions Program execution status Receive data Send data 5 Click TRUE on the Modify Column of Input_Start The Online value of Input...

Page 30: ...Error changes to True When Input_Start changes to FALSE each Local_Status variable also changes to False For details refer to 9 6 Timing Charts 7 The response data received from the destination devic...

Page 31: ...the factory default setting If the device settings are changed from the factory default setting some settings may not be applicable as described in this procedure 8 1 Controller To initialize the set...

Page 32: ...r of the Internet Explorer The Safe Mode Window is displayed Click the Init All Settings Button The RFID Reader Writer will be initialized and restarted The firmware version in the safe mode is 010 00...

Page 33: ...or end of the TCP socket communications and an error end of the destination device detected with the response data from the destination device Additional Information OMRON has confirmed that normal co...

Page 34: ...nd message command data which is set in the program to the destination device 3 Receiving a response The Controller receives the receive message response data from the destination device and stores it...

Page 35: ...es a specified TCP socket Read TCP Socket Status SktGetTCPStatus Reads the status of a specified TCP socket By using this instruction this program checks if the receive processing is completed at the...

Page 36: ...een the destination device server and the Controller client in the following procedure Controller Client Accept processing Connection established Data receive request Data send request Next data send...

Page 37: ...read the information on the destination device by executing the GETR TYP FWV read the product type and firmware version of the memory data command Command format of the send message This is the comma...

Page 38: ...his program is returned Terminator 1 Fixed LF 16 0A The terminator is moved forward for an error message when there is no response data because the command is undefined or the parameter of the send co...

Page 39: ...receive buffer data Send Receive message Send message 47 45 54 52 20 74 79 70 20 66 77 76 0A G E T R t y p f w v LF Send command Terminator Receive message 1 at normal process 47 45 54 52 30 30 30 30...

Page 40: ...mpleted within the monitoring time it is detected as a timeout error An error is detected with the time monitoring function in the program For information on the time monitoring function of the timer...

Page 41: ...to the receive processing ends normally or in an error The TCP connection status variable TcpStatus of the SktGetTCPStatus instruction is used to detect whether the close processing ended normally Whe...

Page 42: ...rom the start of the processing until the TCP socket enters the close status TcloseTime 5 seconds UINT 500 Receive waiting function for divided packets multiple response data To repeat the receive pro...

Page 43: ...rol STRUCT Socket service instruction execution flags Send BOOL Send processing instruction TRUE Executed FALSE Not executed Recv BOOL Receive processing instruction TRUE Executed FALSE Not executed O...

Page 44: ...r code processing Name Data type Description uErrorFlgs UNION Error code processing union BoolData ARRAY 0 15 OF BOOL 2 byte error code is handled in units of 1 bit as 16 bit string TRUE Error FALSE N...

Page 45: ...ng and receive processing Normal end 16 0000 Output_SktCloseErrorID WORD An area that stores the error code for a communications error or a timeout error that is detected at the close processing Norma...

Page 46: ...on the user defined function blocks refer to 9 5 3 Detailed Description of Function Blocks Instances for timer Variable name Data type Description Topen_TON_instance TON Counts the time taken to perf...

Page 47: ...hat stores the receive data of the SktTCPRcv instruction 2000 bytes Local_ReceiveMessage STRING 256 An area that stores the receive data that was converted into a string 256 characters Local_ReceiveSi...

Page 48: ...ive data are set 3 Connect processing 3 1 Determining the connect processing status and setting the execution flag 3 2 Enabling the connect instruction monitoring timer 3 3 Executing the connect instr...

Page 49: ...ocessing The close processing is performed The processing is performed in the following cases When the receive processing required not required setting is set to Not required and the send processing e...

Page 50: ...communications settings send data command data setting and receive data response data check that must be changed according to the destination device For information on how to change these values refe...

Page 51: ...9 Program 2 Initialization processing 48...

Page 52: ...9 Program 49...

Page 53: ...9 Program 3 Connect processing 50...

Page 54: ...9 Program 4 Send processing 51...

Page 55: ...9 Program 5 Receive processing 52...

Page 56: ...9 Program 53...

Page 57: ...9 Program 6 Close processing 54...

Page 58: ...9 Program 7 Processing number error process 55...

Page 59: ...processing in increments of 10 ms TfsTime Output UINT Send processing monitoring time This variable sets the monitoring time of the send processing in increments of 10 ms TrTime Output UINT Receive w...

Page 60: ...9 Program Program 57...

Page 61: ...code Check code of the send message Send_Terminate STRING 5 Send terminator Terminator of the send message Input Output Name I O Data type Description Execute Input BOOL Execution flag The function bl...

Page 62: ...9 Program Program 59...

Page 63: ...ed when this variable changes to TRUE and it is stopped when this variable changes to FALSE tLength Input UINT Receive data length The byte length of the receive data Recv_Data In out STRING 256 Recei...

Page 64: ...9 Program Program 61...

Page 65: ...ction processing Send processing Receive processing Local_Status Error 16 Output_SktCmdsErrorID 16 0000 16 Output_SktCloseErrorID 16 0000 16 Outputl_ErrCode 16 0000 16 Input_Start Local_Status Busy Lo...

Page 66: ...nnect _instance Busy SktTCPConnect _instance Done SktTCPConnect _instance Error SktTCPConnect _instance Execute Topen_TON _instance Q Local_ErrCode BoolData 2 SktTCPSend _instance Execute Output_sktCm...

Page 67: ...tTCPSend _instance Busy SktTCPSend _instance Done SktTCPSend _instance Error SktTCPSend _instance Execute Tfs_TON _instance Q Local_ErrCode BoolData 0 SktClose _instance Execute Output_sktCmds ErrorID...

Page 68: ...No destination device error SktGetTCPStatus _instance Execute Output_sktCmds ErrorID 16 0000 Local_ErrCode WordData 16 0000 Receive waiting time SktTCPSend _instance Done SktTCPRcv _instance Busy SktT...

Page 69: ...ce Done SktTCPRcv _instance Error Tfr_TON_instance Q Local_ErrCode BoolData 9 SktClose _instance Execute SktTCPSend _instance Done SktGetTCPStatus SktTCPRcv _instance Execute SktGetTCPStatus _instance...

Page 70: ..._instance Error SktClose _instance Execute Tclose_TON _instance Q Local_ErrCode BoolData 3 Tr_TON_instance Q etc SktGetTCPStatus _instance TcpSta _XXXX SktGetTCPStatus _instance Execute To End proces...

Page 71: ...not end in time 16 0200 The receive processing did not end in time Including when an arrival of the response cannot be checked 16 0400 The connect processing did not end in time 16 0800 The close proc...

Page 72: ...ith the SrcTcpPort input variable is already connected The destination node that is specified with DstAdr input variable does not exist The destination node that is specified with DstAdr and DstTcpPor...

Page 73: ...CONNECTION_STATE Description _CLOSED Connection closed Normal status _LISTEN Waiting for connection _SYN SENT SYN sent in active status _SYN RECEIVED SYN sent and received _ESTABLISHED Already establi...

Page 74: ...CS value of the data received from the destination device is stored in Output_MErrCode When 16 1000 is stored in Output_ErrCode the error number is stored in Output_MErrCode as the destination device...

Page 75: ...s at Monza chip when it specified the lock bit which does not exist in its memory map Additional Information For details and troubleshooting the destination device errors refer to Section 7 Troublesho...

Page 76: ...ion is not received from the destination device It is not confirmed that the close processing is completed at the destination device Corrective actions The close processing may not be completed at the...

Page 77: ...10 Revision History 74 10 Revision History Revision code Date of revision Revision reason and revision page 01 2013 04 15 First edition...

Page 78: ...2013 0911 P543 E1 01...

Reviews: