Page 2
About Intellectual Property Rights and Trademarks Microsoft product screen shots reprinted with permission from Microsoft Corporation. Windows is a registered trademark of Microsoft Corporation in the USA and other countries. Company names and product names in this guide are the trademarks or registered trademarks of their respective companies.
Safety Precautions and Precautions for Safe Use in the manuals for each device which is used in the system. The table below lists the manuals provided by SHIMADZU CORPORATION (hereinafter referred to as "SHIMADZU") and OMRON Corporation (hereinafter referred to as "OMRON"), which pertain to this guide. Manufacturer Cat.
2.Terms and Definitions 2. Terms and Definitions The terms and definitions used in this guide are given below. Term Explanation and Definition protocol macro Data transfer procedures (protocols) with general-purpose external devices are created and stored in Serial Communications Boards or Serial Communications Units.
3.Precautions 3. Precautions (1) Understand the specifications of devices which are used in the system. Allow some margin for ratings and performance. Provide safety measures, such as installing a safety circuit, in order to ensure safety and minimize the risk of abnormal occurrence. (2) 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.
4.Overview 4. Overview This guide describes procedures for connecting a SHIMADZU Analytical Balance ATX-R/ATY-R series or Electronic Balance UPX/UPY/UW/UX series (hereinafter collectively referred to as the "Balance") to an OMRON CJ-series Programmable Controller + Serial Communications Unit (hereinafter referred to as the "PLC") via serial communications and for checking their serial communication connection.
The applicable devices are as follows: Manufacturer Name Model OMRON CJ2 CPU Unit CJ2□-CPU□□ OMRON Serial Communications Unit CJ1W-SCU□1-V1 CJ1W-SCU□2 SHIMADZU Analytical Balance ATX-R series ATY-R series SHIMADZU Electronic Balance UPX series UPY series UW series UX series Precautions for Correct Use In this guide, the devices with models and versions listed in 5.2.
(OS: Windows 10) ― ― USB cable (USB 2.0-compliant, USB-B connector) ― ― Serial cable (RS-232C) SHIMADZU Balance ATX324R SHIMADZU AC Adapter (supplied with the Balance) Precautions for Correct Use Contact OMRON to obtain latest versions of the CX-Programmer and CX-Protocol project files before proceeding.
Page 10
5.Applicable Devices and Device Configuration Additional Information For information on the serial cable (RS-232C) used in this guide, refer to 3-4 RS-232C and RS-422A/485 Wiring of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336). Additional Information The system configuration in this guide uses USB for the connection between the personal computer and the PLC.
― Handshake Hardware ― Data format Shimadzu standard (fixed) ― Delimiter CR (fixed) When setting the communication specifications to "MODE.2" (standard settings 2), the following items are all set at once: data (bit) length, stop bit (length), parity, baud rate (communication speed), handshake and data format.
6.Serial Communications Settings 6.2. Cable Wiring For details on cable wiring, refer to SECTION 3 Installation and Wiring of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336). Check the shapes and pin layouts of the connectors before wiring. Shape and pin layout of the connector Serial Communications Unit (CJ1W-SCU42) applicable connector: D-SUB 9-pin female Pin No.
Page 13
6.Serial Communications Settings UPX/UPY/UW/UX series applicable connector: D-SUB 25-pin female Terminal Pin No. Function name Protective ground or earth Data output Data input Internal connection to Internal connection to RS-232C Handshake (receive) Signal ground Undefined - 8 to 19 Handshake (send) Undefined -...
For information on initialization, refer to Section 8. Initialization Method. 7.1. Work Flow Take the following steps to connect the Balance and the PLC via serial communications and send and receive a message. Set up the SHIMADZU Balance. 7.2. SHIMADZU Balance Setup ↓ Set parameters for the Balance.
Page 15
7.Serial Communications Connection Procedure Start the send/receive processing and confirm that 7.4. Serial Communication Status serial communications is performed normally. Check ↓ Start tracing with CX-Protocol. 7.4.1. Starting the Trace ↓ Execute the communications sequence with 7.4.2. Executing the Communications CX-Programmer.
7.Serial Communications Connection Procedure 7.2. SHIMADZU Balance Setup Set up the SHIMADZU Balance. 7.2.1. Parameter Settings Set parameters for the Balance. The parameter settings vary depending on the model used. Use one of the following parameter setting procedures appropriate for your Balance's model.
Page 17
7.Serial Communications Connection Procedure Display panel shows "OFF". Press BREAK key. Display panel shows gram units. Press and hold PRINT key for about 3 seconds. Display panel shows "APL.PRN". Press MENU key once. Display panel shows "COMM.SET". Press PRINT key once. Display panel shows "MODE.1".
Page 18
7.Serial Communications Connection Procedure Display panel shows gram units. Press BREAK key. Display panel shows "READY". *Balance is in the standby mode. Turn OFF AC Adapter.
Page 19
7.Serial Communications Connection Procedure 2) Parameter settings for UPX/UPY/UW/UX series Set parameters for UPX/UPY/UW/UX series. Precautions for Correct Use Make sure the power supply is OFF before setting up. If it is ON, the settings described in the following steps and subsequent procedures may not be applicable.
Page 20
7.Serial Communications Connection Procedure Display panel shows "OFF". Press POWER key. Display panel shows gram units. Press CAL key on UPX/UPY series twice or on UW/UX series three times. Display panel shows "SEL:EAUS". Check that is blinking. Press CAL key six times. *The blinking of indicates the menu group 1.
Page 21
7.Serial Communications Connection Procedure Set handshake as follows. Display panel shows "-HFbPSd". Check that “H” is blinking. Press O/T key. Display panel shows "H-oFF". Press O/T key. *It allows you to set handshake to OFF. Check that the stability mark "→"...
Page 22
7.Serial Communications Connection Procedure Display panel shows "b-300". Press CAL key twice. Check that the stability mark "→" is displayed to the left of "b-1200". Press POWER key. *The baud rate (communication speed) is set to 1200 (bps). Display panel shows "-HFbPSd".
Page 23
7.Serial Communications Connection Procedure Check that the stability mark "→" is displayed to the left of "d-Cr". Press and hold POWER key for about 3 seconds. *The delimiter is set to CR. Display panel shows gram units. Press POWER key. Display panel shows "STAND-BY".
7.Serial Communications Connection Procedure 7.3. PLC Setup Set up the PLC. 7.3.1. Hardware Settings Set the hardware switches on the Serial Communications Unit and connect the cables. Precautions for Correct Use Make sure the power supply is OFF before setting up. If it is ON, the settings described in the following steps and subsequent procedures may not be applicable.
Page 25
7.Serial Communications Connection Procedure 7.3.2. Opening the Project File and Going Online with the PLC Start CX-Programmer, open the project file and go online with the PLC. Install CX-Programmer and the USB driver on your personal computer before proceeding. Turn ON PLC and AC Adapter on Balance.
Page 26
7.Serial Communications Connection Procedure Select Change Model from the PLC Menu. The Change PLC Dialog Box is displayed. Select the device type of PLC from the pull-down list in the Device Type Field. Click Settings. *CJ2M is selected in this guide. The Device Type Settings Dialog Box is displayed.
Page 27
7.Serial Communications Connection Procedure Check that the network type is set to USB in the Change PLC Dialog Box. Click OK. *If not, select USB from the pull-down list. *If you have changed the device type in step 8 or the CPU type in step 9, the dialog box on the right will be displayed.
Page 28
7.Serial Communications Connection Procedure The dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that CX-Programmer and PLC are online. *The icon is pressed down during online connection. Additional Information If the online connection to the PLC cannot be established, check the cable connection. After checking the cable connection, return to step 6, check the settings such as the connection type described in steps 7 through to 9 and then try online again.
Page 29
7.Serial Communications Connection Procedure 7.3.3. Creating an I/O Table Create an I/O table for the PLC. If the operating mode of PLC is Run Mode or Monitor Mode, change it to Program Mode by following the steps below. 1.Select Operating Mode – Program from the PLC Menu in CX-Programmer.
Page 30
7.Serial Communications Connection Procedure Precautions for Correct Use The PLC will be reset after creating and transferring an I/O table in steps 3 and 4. Always confirm safety before creating and transferring an I/O table. Select Create from the Options Menu of the PLC IO Table Window.
Page 31
7.Serial Communications Connection Procedure 7.3.4. Parameter Settings Set parameters for the Serial Communications Unit. Double-click [0000] Main Rack in the PLC IO Table Window to expand the tree. Right-click 00 [1500] CJ1W-SCU42 and select Unit Setup from the menu. The View Parameters Dialog Box is displayed.
Page 32
7.Serial Communications Connection Procedure The setting items of "Port2: Protocol macro Settings" are listed as shown in the figure on the right. (The figure shows the default values.) Select User settings from the pull-down list in the Port2: Port settings Field. Set the following parameters in the same way as step 5.
Page 33
7.Serial Communications Connection Procedure The dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that the transfer is complete as shown on the right. Click Close. The dialog box on the right is displayed.
Page 34
7.Serial Communications Connection Procedure Click Compare in the View Parameters Dialog Box. Check that a message is displayed stating "Compare successful" as shown in the figure on the right. Click Close. Click OK in the View Parameters Dialog Box. Select Exit from the File Menu to exit the PLC IO Table Window.
Page 35
7.Serial Communications Connection Procedure 7.3.5. Transferring the Project Data Transfer the project data to the PLC. Select Programs in the project workspace of CX-programmer. Select Transfer – To PLC from the PLC Menu. Select Program(s), Comments and Program index. Click OK. *You do not need to transfer I/O table and Special Unit Setup because they are already set in...
Page 36
7.Serial Communications Connection Procedure The dialog box on the right is displayed. Check that "Download successful" is displayed after the transfer is complete. Click OK. Select Programs in the project workspace. Select Transfer – Compare with PLC from the PLC Menu. Select Program(s) and click Check that a message is displayed stating "Compare...
Page 37
7.Serial Communications Connection Procedure 7.3.6. Starting CX-Protocol and Opening the Project File Start CX-Protocol and open the project file. Start CX-Protocol. *If the User Account Control Dialog Box is displayed at start, make a selection to start CX-Protocol. Start CX-Protocol. The following panes are Project displayed in the window.
Page 38
7.Serial Communications Connection Procedure 7.3.7. Going Online and Transferring the Protocol Data Place CX-Protocol online and transfer the protocol data to the Serial Communications Unit. Double-click P732_CJ_PMCR_SHIMADZU_ E-Balance_V100 in the Project Workspace to expand the tree. Select Edit PC-PLC Comms Settings from the PLC Menu.
Page 39
7.Serial Communications Connection Procedure Check that the network type is set to USB in the Change PLC Dialog Box. Click OK. *If not, select USB from the pull-down list. Select Connect to PLC from the PLC Menu. Check that the PLC status displayed next to the PLC Icon changes from Offline to the Program in the Project...
Page 40
7.Serial Communications Connection Procedure The Project Window on the right is displayed. Check that SCU [0] is selected in the Target Column. *If not, select SCU [0] from the pull-down list as shown in the figure on the right. Click New Protocol List in the Project Workspace and select Download Protocols from the Protocol Menu.
Page 41
7.Serial Communications Connection Procedure The dialog box on the right is displayed. Confirm that there is no problem, and click OK. Check that 100% is displayed in the Downloaded % Column, as shown in the figure on the right. Click Close. Select Compare Protocols from the Protocol Menu.
Page 42
7.Serial Communications Connection Procedure The compile is complete when 100% is displayed in the Complied % Column. Click Compare after checking that the compile is complete. The dialog box on the right is displayed. Check that Successful is displayed in the Result Column.
7.Serial Communications Connection Procedure 7.4. Serial Communication Status Check Start the send/receive processing and confirm that serial communications is performed normally. If the PLC memory is changed by malfunction during the process of monitoring power flow and present values in the Ladder Section Window or in the Watch Window, the devices connected to Output Units may malfunction, regardless of the operating mode of the CPU Unit.
Page 44
7.Serial Communications Connection Procedure Select the Trace 2 Icon ( ) in the Project Window. (Check that Trace 2 is highlighted as shown in the figure on the right.) *Trace 2 corresponds to Port 2 of Serial Communications Unit. Select Start Trace – One Shot Trace from the PLC Menu.
Page 45
7.Serial Communications Connection Procedure 7.4.2. Executing the Communications Sequence Execute the communications sequence with CX-Programmer. Expand the Programs tree in the project workspace of CX-Programmer and double-click Section1. The Ladder Section Window shows the Section1 ladder program. Ladder Section Window Press POWER key to show gram units on Display panel on Balance.
Page 46
7.Serial Communications Connection Procedure In the Ladder Section Window, right-click Input_Start and select Set – On from the menu. Check that the Input_Start contact is turned ON, as shown in the figure on the right.
Page 47
7.Serial Communications Connection Procedure 7.4.3. Checking the Trace Data Check with the trace data in CX-Protocol that correct data is sent and received. Select Upload Trace from the PLC Menu in CX-Protocol. *Once the trace data is stored, the menu item "Upload Trace" becomes selectable.
Page 48
7.Serial Communications Connection Procedure Check the send and receive messages in the trace data file as shown in the figure on the right. (In the example on the right, Balance's command ”D07” 0Dh(CR) (single output with stability information) is sent and the response "S␣126.5947g␣"...
Page 49
7.Serial Communications Connection Procedure 7.4.4. Checking Received Data With CX-Programmer, check that correct data is written to the I/O memory of the PLC. Select Edit – Memory from the PLC Menu in CX-Programmer. Double-click CIO in the Memory Tab of the PLC Memory Window.
Page 50
7.Serial Communications Connection Procedure Check the received data displayed in the CIO Area as shown in the figure on the right. *In the example on the right, the data stored in words from CIO 5501 is 5300 2000 3132 362E 3539 3437 6720 in hexadecimal, which equates to S␣126.5947g␣...
8.Initialization Method 8. Initialization Method The setting procedures in this guide are based on the factory default settings. Some settings may not be applicable unless you use the devices with the factory default settings. 8.1. Initializing a PLC To initialize a PLC, it is necessary to initialize a Serial Communications Unit and a CPU Unit. Change the operating mode of the PLC to PROGRAM mode before the initialization.
Select Initialize in the Confirm All Memory Area Clear Dialog Box and click OK. 8.2. Initializing a SHIMADZU Balance For information on how to initialize a SHIMADZU Balance, refer to the following manuals. - UW/UX series: 7.5.2. Returning to the Default Settings (menu reset) of the Electronic Balance Instruction...
9.1. Overview The specifications and functional components of the program are explained in this section, which are used to check the connection status between the SHIMADZU Balance (hereinafter referred to as the "Destination Device") and the PLC (Serial Communications Unit (hereinafter referred to as the "SCU")).
Page 54
9.Program 9.1.1. Outline of Processing The following figure shows the processing flow from when the PLC (SCU) sends the command data to the Destination Device until when the PLC receives response data from the Destination Device. 1) The ladder program specifies the communications sequence No. 900 and executes the PMCR instruction.
Page 55
9.Program 9.1.2. PMCR Instruction and Send/Receive Messages The basic operations of the PMCR instruction and send/receive messages are given below. Additional Information For details, refer to Serial Communications Instructions (PMCR) in SECTION 3 Instructions of the CJ Series Programmable Controllers INSTRUCTIONS REFERENCE MANUAL (Cat. No.
Page 56
9.Program C1: Control word 1 The following information on the SCU are set. ・ Communications port number (logical port): #0 to 7 ・ Serial port number (physical port): #1 and 2 (#1: PORT1, #2: PORT2) ・ Unit address of Destination Device: # unit number + #10 Wd+0 Wd: Word Control word: C1...
Page 57
9.Program Send/Receive messages Image of send/receive messages Send message Destination Device Data Terminator Receive message Data Terminator Relationship between send area S (PMCR instruction operand) and send message Wd: Word Wd+0 Wd+1 Wd+2 Wd+(n-1) CPU to SCU Send area: S The number of words SCU to Destination Device...
9.Program 9.2. Communications Sequence The communications sequence that is used for the PMCR instruction in this program is described below. 9.2.1. Communications Sequence No. The communications sequence that is registered in the SCU is identified by a communications sequence number. The command corresponding to the communications sequence number specified in the PMCR instruction is executed on the Destination Device.
Page 59
9.Program 9.2.3. Receive Data Format The receive data format is given below, which is used for receiving the value acquired from the Destination Device by using the command "single output with stability information". The following items are stored in order from R+1. (R: CIO 5500) Item Size Stability information...
9.Program 9.3. Error Detection Processing With this program, the error detection processing is performed according to the following descriptions (1), (2) and (3). For information on error codes, refer to 9.8. Error Processing. CJ2M-CPU12 Destination Device CJ1W-SCU42 Serial cable (1) Errors when executing the PMCR instruction (PMCR instruction error) An incorrect communications sequence number and an incorrect memory address, both of which prevent the execution of the PMCR instruction, are detected as PMCR instruction errors.
9.Program 9.4. Memory Maps The memory maps of this program are shown below. 9.4.1. List of Addresses The tables below list the addresses necessary to execute this program. You can change the allocations below to any addresses. Precautions for Correct Use When you change the addresses, make sure there is no duplication.
Page 62
9.Program Internal memory These addresses are used to operate this program only. Address Data type Variable name Description 5000.01 BOOL Local_PMCRExecuting Indicates the PMCR instruction execution status. Turns ON when the PMCR instruction is being executed, and turns OFF when the PMCR instruction is not executed.
Page 63
9.Program 9.4.2. List of Allocations The tables below list the addresses necessary to execute this program. CIO area These addresses are allocated in the CIO area according to the unit number (unit address) setting for the SCU. The unit number 0 is used in this program. Address Data type Variable name...
9.Program 9.5. Ladder Program 9.5.1. Functional Components of the Ladder Program The functional components of this program are given below. Major Minor classification Description classification 1. Initialization 1.1. Response code clear The area of use is cleared, and the processing 1.2.
Page 65
9.Program 9.5.2. Detailed Description of Each Functional Component The program used in this guide is shown below. 1. Initialization processing Name Description 1.1. Response code clear Clears the error code storage areas to zero. 1.2. Operand setting for Sets execution parameters (operands) of the PMCR PMCR instruction instruction.
Page 66
9.Program 2. PMCR instruction execution management Name Description 2.1. PMCR instruction Enters the PMCR instruction executing status. executing The executing state is reset at a normal end or an error end of the send/receive processing. 2.2. PMCR instruction Executes the PMCR instruction under the following execution processing conditions.
Page 67
9.Program Name Description 2.3. Normal/error judgement Detects a normal or error end of the send/receive processing processing. It is considered as a normal end when all the following conditions are met. (1) Normal end of the PMCR instruction (No PMCR instruction error) (2) Normal end of communications sequence (No communications error) (3) Normal messages received from the Destination...
Page 68
9.Program 3. Normal end state management Name Description 3.1. Normal end processing Turns ON the normal end flag when a normal end of the send/receive processing is detected in 2.3. Normal/error judgement processing. 3.2. Response code setting Sets response code "#0000" for a normal end in the response code storage area.
Page 69
9.Program 4. Error end state management Name Description 4.1. Error end processing Turns ON the error end flag when an error end of the send/receive processing is detected in 2.3. Normal/error judgement processing. 4.2. Response code setting When an error occurs, sets the response code corresponding to the error in the response code storage area.
9.Program 9.6. Protocol Data The protocol data consists of a sequence, steps, send/receive messages and a receive matrix. The structure is described as follows: - When there is only one receive message format for a step (send/receive once): One each of receive and send messages is set for a step. Sequence No.
Page 71
9.Program 9.6.2. Procedure for Protocol Data Processing The procedure for protocol data processing is shown below. Step No.00 Issues the send message “S_SVRGT” ↓ When step No.00 ends normally When step No.00 ends in error ↓ ↓ Next process: End Error process: Abort Terminates the communications Interrupts the step and terminates the...
Page 72
9.Program 9.6.3. Sequence Settings The command "single output with stability information" is executed by using the communications sequence No. 900 in the protocol data used in this guide. The time for monitoring the send and receive processing (monitoring time) is set for the communications sequence.
Page 73
9.Program 9.6.4. Step Settings The step settings for the communications sequence No. 900 are given below. The settings include retry count, send/receive message names, next process, and error process. The sequence of the protocol data used in this guide is composed of the step No. 00 only.
Page 74
9.Program Next process and error process settings The next process and the error process set in the step are shown below. The process set in the Next Column is executed when a previous step execution ends normally. If a communications error occurs, the process set in the Error Column is executed. Screenshot of step settings Setting Step No.
Page 75
9.Program 9.6.5. Send Message Settings The send message settings are shown below. Additional Information For details on send message settings, refer to 3-4 Communication Message Attributes of the CX-Protocol OPERATION MANUAL (Cat. No. W344). Screenshot of send message settings S_SVRGT send message setting Setting "D07"+<t>...
Page 76
9.Program 9.6.6. Receive Message Settings The receive message settings are shown below, which correspond to the response formats of normal and error messages. Additional Information For details on the receive message settings, refer to 3-4 Communication Message Attributes of the CX-Protocol OPERATION MANUAL (Cat. No. W344). Screenshot of receive message settings Normal and error message identification In the protocol data used in this guide, the normal and error messages can be identified by...
Page 77
9.Program Response format of normal message This is the response format of the normal message received by the SCU from the Destination Device according to the R_SVARGET receive message setting. Stability information Sign Absolute value Unit Command The number Remarks of bytes Stability Receives “S”...
9.Program 9.7. Timing Chart The timing charts are shown below. Normal end Input_Start (5000.00) Local_PMCRExecuting (5000.01) Receive data storage area (From 5501) Normal response Normal response Output_NormalEnd (5000.02) Output_ErrorEnd (5000.03) Output_PMCR_ErrorCode #0000 (H400) Output_DestinationDevice #0000 ErrorCode (H402) Error end (1) Error end (2) Error end (3) PMCR instruction error...
9.Program 9.8. Error processing The errors that may occur during the execution of this program are described below. 9.8.1. Protocol Macro Error Code The SCU detects an error while monitoring the macro operation. The error codes include either (1) PMCR instruction error or (2) Communications error (transmission error, etc.) and are stored in H400 Output_PMCR_ErrorCode.
Page 80
9.Program 9.8.2. Destination Device Error Code The Destination Device detects an error while executing the command on Destination Device. The error code is stored in H402 Output_DestinationDeviceErrorCode. Error code list Error code Description An error is detected in the Destination Device. #000F (overload or minus overload) Additional Information...
Need help?
Do you have a question about the OMRON CJ Series and is the answer not in the manual?
Questions and answers