User Programming Examples
Example 1: WRITE Data
Memory to the Unit Memory
Map
Execution
condition
Q000102
Q000102
Q000202
Q000100
Latch
96
• If the temporary pointer value is greater than 46, the Unit writes the data
following the temporary pointer value into the Unit memory map beginning
at the location specified by the temporary pointer value. The temporary
pointer value is then discarded.
Example:
Execute a 10-word I/O write to the Unit. The value of the first word trans-
ferred is 0047.
The Unit sees the number of words is greater than one, and reads the first
word as the temporary pointer value. The Unit then updates its memory map
with the remaining nine words beginning at location 47.
Note
1. Whenever data is written to the Unit using WRIT, the validity of all the data is
checked. If there are any errors in the data, none of the data will be written. It
is thus best to write only the required data to reduce the chance of errors.
When writing data that includes values for functions not being used, be sure
to set the values for unused functions to the defaults in advance.
2. When executing the WRITE instruction with the First Cycle Flag, there is a
possibility that the Analog I/O Unit's internal processing may not be com-
pleted, and the WRITE instruction is not executed. When executing the
WRITE instruction immediately after operation is started, use either of the
following as the execution condition of the WRITE instruction:
• Bit 2 of word n+1 (A/D Write Completed Flag)
• A timer of at least 3 s.
This example show how to write the entire Unit Memory Map Write area (Loca-
tions 47 to 150). These are the user configurable locations in the Unit Memory
Map that enable the various Unit functions. The Data Memory in the CPU Unit
can be set up using the Unit configuration worksheet in Appendix A. The first
word is the temporary write pointer.
Q000101
Write
complete
(191)
Q000101
[
WRIT
Write
complete
A50006
= Flag
Q000102
( )
Write 105 words to the
#0105
D00246
Q0002
]
Unit memory map
beginning with Unit
memory map location
47. This example
Q000100
writes the entire write
( )
area of the Unit
memory map.
Latch
D00246 = 0047
(pointer) or 0000
Q000101
defaults to 0047.
D00247 to D00351 =
( )
values to be entered in
Unit memory map.
Section
5-7
Need help?
Do you have a question about the SYSMAC C Series and is the answer not in the manual?