[. . . ] Designation of the start and break points Debugs in connection with display devices and serial communications devices *1 Regarding the serial communications port of a PC as the communications port of a PLC, it is possible to debug a program in combination with display devices or serial communications devices (barcode reader, ID sensor, etc. ). Display of the send messages of serial communications and network communications *1 It is possible to check the send messages issued by TXD instruction (communications port output), SEND instruction (network send), and CMND instruction (command send). It is useful for the debugs of serial communications and network communications. *1: You need to start CX-Simulator from the Windows [Start] menu and set a virtual PLC. 5 and the operation manual of CX-Simulator for the detailed operations. See Chapter Chapter 2 Creation of Sample Program This chapter explains basic functions such as programming and comment entry of a simple ladder by using CX-Programmer. Here, a sample program "a program of car entry control by opening/closing shutters" is created as an example. [. . . ] (At this point, the lower limit SW (000002) is off. ) (2) The lower limit SW (000002) is turned on in three seconds after the reverse rotation motor (000501) is turned on. (At this point, the upper limit SW (000001) is actually off. ) Setting in I/O Condition Tool The following section explains how to set virtual external input by using I/O Condition Tool: 4-2-2 Starting I/O Condition Tool Select [Replay] | [IO Condition] from the menu in the Debug Console screen. Select [I/O Condition] from the Debug Console screen. I/O Condition Tool starts up. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Select [File] | [Configuration] from the menu in the I/O Condition tool. Select [File] | [Configuration] in the I/O Condition tool. The [Configuration] screen of the I/O Condition tool is displayed. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions 4-2-3 Setting I/O Conditions How to set I/O conditions is explained in the following example: In three seconds after the normal rotation motor (000500) is turned on, the upper limit SW (000001) is turned on. (At this point, the lower limit SW (000002) is actually turned off at the same time. ) In this example, the following formulas are set: Condition: The normal rotation motor (000500) is turned on. Delay time: 3 seconds (3000ms) Output: The lower limit SW (000002) is turned off. In three seconds, the upper limit Condition Settings (1) Click "Bit Condition" in the "Logical Expression" field. (6) Click the register button . SW (000001) is turned on. (1) Click "Bit Condition". (5) Set "ON". (6) Click the register button. Delay Time Setting Enter 3000 (3 seconds) in the text box of "Delay time". Enter 3000(ms) (=3 seconds) in the text box of "Delay time". Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Output Settings (1) Click "Bit Condition" in the "Logical Expression" field. (2) Set "IO" to "Type" (3) Set "0. 1" to "Address". (8) Click "Bit Condition" in the "Logical Expression" field. (13) Click the register button . (1)(8) Click "Bit Condition". (12) Set "OFF". (6)(13) Click the register button. (7) Click "and". Click the "Register" button. Double-click the registered formula The "Run" column is changed from "N" to "D". It means this formula will be executed. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Select [Edit] | [Insert line] from the menu in "I/O Condition ­ [Configuration]". Add a new line to enter the second formula. Like the registration operation of the first formula, set the followings. The lower limit SW (000002) is turned on three seconds after the reverse rotation motor (000501) is turned on. (At this point, the upper limit SW (0000001) is actually turned off at the same time. ) In this example, the following formulas are set: Condition: The reverse rotation motor (000501) is turned on. Delay time: 3 seconds (3000ms) Output: The upper limit SW (000001) is turned off. In three seconds, the upper limit SW (000002) is turned on. After the two formulas are registered, the set screen is displayed as follows: You can enter the conditions and output formulas in each column directly from the keyboard. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions 4-2-4 Saving and Ending I/O Condition Settings Select [File] | [Save As] from the menu in "I/O Condition ­ [Configuration]". Enter "sample" in "File name". Select [File] | [Exit] from the menu in "I/O Condition ­ [Configuration]". End I/O Condition [Configuration]. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Prepare the external input debug by I/O Condition Configuration. 4-2-5 Debug by Virtual External Input Execute the followings before starting debug: Load the sample program (Sample. cxp) created in Chapter 2 in CX-Programmer). Follow the procedure in Chapter 4 to connect CX-Programmer and the CX-Simulator virtual PLC. Start running the ladder of the virtual PLC. Now you are ready to start debugging. Select [File] | [Open] from the menu in "I/O Configuration ­ [Run] " and select "Sample. csv". Execution of I/O Condition Tool Load the file (Sample. csv) set in "I/O Condition [Configuration]". Click the check box of "Synchronized" to deactivate it. Remove the check of "Synchronized". Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Click the [Start] button. I/O condition watching is started to check whether the set conditions are established. After I/O condition watching is started, the screen shows the message "Executing IO Condition Watching" and the number of cycles gradually increases. If the ladder of a virtual PLC has not started running yet, the screen shows the message as follows. In this case, start running the ladder of the virtual PLC. By the above procedure, the following two formulas are established and the output operation after the establishment is started. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Show "Shutter Elevating Processing" of the ladder of CX-Programmer and start monitoring. Or select [PLC] | [Monitor] | [Monitoring] from the menu in CX-Programmer. By the procedures so far, the ladder is running and the condition set in IO Condition Configuration is monitored by the virtual PLC. After this, pseudo input of car arrival and gate passing is executed and debug of a ladder program is executed. Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Waiting for car arrival 4-2-6 Program Debug Operation Using Virtual External Input Check the following processing flow in order. (1) Waiting for car arrival (2) Car arrival Car arrival The arrival detection sensor (000000) is set from CX-Programmer. (3) Start of shutter up (4) After 3 seconds Shutter up (5) End of shutter up The normal rotation motor (000500) is turned on by the conditions and output formulas set in IO Condition Configuration, and in 3 seconds (after the shutter is completely pulled up), the upper limit SW is turned on. (6) Car passing Car passing The arrival detection sensor (000000) is reset from CX-Programmer. (7) After 2 seconds The ladder program counts 2 seconds after car passing. (8) Start of shutter down Shutter down (9) After 3 seconds (10) End of shutter down The reverse rotation motor (000501) is turned on by the conditions and output formulas set in IO Condition Configuration, and in 3 seconds (after the shutter is completely brought down), the lower limit SW is turned on. End of car entry The ladder program counts the number of car entries. (11) End of car entry Debug with a sample program Debug by virtual external input Debug by I/O break settings Other debug functions Waiting for car arrival Operation Check by Pseudo Input of Car Arrival After this, program debug is proceeded according to the processing flow. [. . . ] - Serial communications for connecting with PT - Network communications by network communications instructions - Measurement of I/O refresh time with an I/O unit registered - Display of message instructions or network communications instructions on your PC screen - Record of the communications log of FINS Commands sent/received by a virtual PLC Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator 3-1 Starting CX-Simulator [Start] [Programs] [Omron] [CX-Simulator] [CX-Simulator] Or double-click the CX-Simulator icon. Start up CX-Simulator from Windows. The [Select PLC] and [CX-Simulator Debug Console] screens show up. Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator 5-2 Creating Virtual PLC Create a virtual PLC according to the contents of the [Select PLC] screen. Check [Create a new PLC]. Select a directory to create data. Select a directory to save data. Use the default directory this time. Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator Select a PLC type. Select a CPU unit type. Select "CS1H-CPU63" this time. Register PLC Unit. You can register IO Units and Special IO Units. Register the units to be used in the actual case, and you'll improve the accuracy of the advance verification of cycle time. Do not register any unit in this example. Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator Set network communications. Network settings for connecting to a virtual PLC. Normally, do not change. Set serial communications. Regarding the serial port of you PC as the built-in serial port of CPU Unit, you can connect with external equipment such as Programmable Terminal. Do not set anything Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator Contents List Starting CX-Simulator Creating a virtual PLC Saving/ending CX-Simulator After checking that a virtual PLC is created, you can close the window. It is the end of creating a virtual PLC. [. . . ]