Omron CS Series Operator's Manual page 144

Cx-simulator
Hide thumbs Also See for CS Series:
Table of Contents

Advertisement

Examples of Serial Communications Debugging
Example of Debugging Program using Barcode reader
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : info@audin.fr
The whole data in the file is read for a single receive operation. For send op-
eration, 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.
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. Display the [Serial Comm. Setting] window by [Status] | [Settings] | [Serial
1,2,3...
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 re-
ceived from the barcode reader. Prepare multiple data according to de-
bugging patterns.
7. Copy the data file created in procedure 6 in the input file (COM port
name In.txt).
8. Changing in the file update time causes automatic reception of data from
the input file.
9. Execute Step Run, etc. to confirm the process of data received.
10. Repeat the debugging procedures 7 to 9 depending on the contents of
serial input data.
Note Escape sequences contained in the send/receive data are handled as '\n' (n is
a lower-case alphanumeric character.) in the file. For example, the delimiter
for Host Link is '\r'.
Section 5-5
129

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents