40
Program Examples
Section 3-1
Section Overview
This section contains example programs that illustrate data transfer between
the ID Sensor Unit and the CPU of the PC. Six communication commands
(Write, Auto Write, Read, Auto Read, Clear-all, and Auto Read/Write Abort)
can be used.
Also included in this section are a description of Monitoring functions and an
explanation of Command Processing Time and Turnaround Time.
3-1
Program Examples
The following conditions apply to the example programs in this section:
1,2,3...
1.
The ID Sensor Unit unit number switch is set to 0.
2.
The command data is stored in the DM area of the CPU.
Refer to
2-3 The User Program
for an overview of program operation.
3-1-1
Writing to the Data Carrier
This section illustrates program examples of the Write, Auto Write, and Clear-
all commands.
Program Example 1:
The Write Command
10900
ID busy
MOV (21)
#0007
101
10900
10900
10400
Sets the number of words in the
command data (7 in this example)
Word n+1
Sets the beginning word where the
command data is stored (DM 0000
in this example).
Word n+2
(Bit in IR area) Holds the status
until the ID Sensor Unit begins ex-
ecuting the command.
Command execution flag
Command
execution input
MOV (21)
#0000
102
10000
Command data in CPU
15
DM 0000
DM 0001
DM 0002
DM 0003
DM 0004
DM 0005
DM 0006
57
54
48
31
00
06
10
11
12
13
14
2A
0D
00
00
WT (Write)
H1 (Hexadecimal, Head 1)
Beginning address in which data is
to be written in Data Carrier
Data to be written to Data Carrier,
numbers 10 through 14 (5 bytes)
If the number of bytes to be written to the Data
Carrier is odd, shift codes 2A and 0D forward
one byte and write 00 into the last 8 bits.
Write is executed.
10
12
14
11
13
0006
0007
0008
0009
000A
Data to be written
to Data Carrier
Address
7
0
Data cannot be written to
write-protected areas.
Содержание SYSMAC C200H-IDS01-V1
Страница 1: ...OPERATION MANUAL ID Sensor SYSMAC C200H IDS01 V1 IDS21 Cat No W153 E1 04...
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ...viii TABLE OF CONTENTS Glossary 89 Index 91 Revision History 95...
Страница 9: ......
Страница 15: ...xvi Application Precautions 5...
Страница 25: ......
Страница 95: ......
Страница 97: ......
Страница 98: ...83 Appendix C ASCII Code List ASCII Code List Lower digit lower 4 bits Higher digit higher 4 bits...
Страница 99: ......
Страница 103: ......
Страница 109: ......
Страница 111: ......
Страница 114: ...SYSMAC C200H IDS01 V1 IDS21 ID Sensor Cat No W153 E1 04 OPERATION MANUAL...