Omron WS02-SIMC1-E - V1.9 REV 12-2009 Operation Manual page 172

Table of Contents

Advertisement

Examples of Serial Communications Debugging
Creating and Using Serial Data Files
Example of Debugging Program using Barcode reader
The whole data in the file is read for a single receive operation. For send
operation, send data is appended at the end of the file.
Use a commercial text editor or a binary editor to edit a Serial Data File.
Example: Input (Receiving)
Use the following procedure to create and use a serial data file.
1,2,3...
1. Create a text file with a user-set name to be used for the receive data.
2. Input the receive data text in the text file created in step 1.
3. Copy the text input as receive data, and paste in the input (receive) file
(COM port name In.txt) under the Log Folder (LOG) in the PLC Data
Folder.
Text can also be input directly into an input (receive) file, omitting steps 1
and 2.
4. Save the input (receive) file. (The file's update time will change, and be
considered as a received file.)
5. All the data in the file is stored in the reception buffer of the virtual PLC.
6. Input is completed.
This procedure can be used, for example, to receive data in the reception
buffer using the virtual PLC's RXD instruction.
Note Read the whole data in the input (receive) file when the file update time
changes, which is regarded as a receive operation.
Note For Host Link communications, a single issue of instruction causes a com-
mand send (write to the output file) and a response receive (read from the
input file). In this case, it is necessary to create a response data in advance
assuming a command to be sent.
The followings show an example of debugging No-protocol communications
using a Serial Data File.
1,2,3...
1. Display the [Serial Comm. Setting] window by [Status] | [Settings] | [Serial
Comm. Setting].
2. Select a serial port for the Serial Communications Unit to be used, fol-
lowed by pressing [Edit] button to display [Serial Communications Regis-
tration] window.
3. Set the communications settings to "File" to select a COM port name.
Note Select a COM port name that does not overlap with one allocated in actual
communications or another file. Also, a COM port name to be allocated to the
Serial Data File can be one that does not actually exist.
4. Press the [OK] button to exit [Serial Communications Registration] win-
dow and to return to [Serial Communications Settings] window.
5. After confirming the communications settings and the COM port name are
identical to the contents set in procedure 3, press the [OK] button.
6. Create receive data for debugging. Use a commercial text editor or a
binary editor to create data conforming to the format of data to be received
from the barcode reader. Prepare multiple data according to debugging
patterns.
Section 5-5
133

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-simc1-eCx-simulator 1.9

Table of Contents