Publication No. 980824-114 Rev. A 1260-114 User Manual
Astronics Test Systems Module Operation 3-13
Writing to a port location is a straightforward process. Setting a bit
high in a port register causes the port to output a high logic level
on the port pin corresponding to that bit. In the case of an open-
collector version, this same operation would cause the pull-down
transistor to activate.
It is especially important to realize that a single write operation
controls eight separate control lines or output devices
simultaneously. Therefore if only a single bit change is desired,
the following process must be observed.
1. Read the register first, inverting the bit pattern if necessary
2. Mask the appropriate bit with an ‘AND’ operation and a byte
mask with all undesired bits set to a ‘1’ and the desired bit set
to a ‘0’ or ‘1’ depending on whether the bit is to be set or
cleared in the desired register
3. Write the masked data back into the register
As simple as this may seem, a number of products reported as
faulty and sent back for repair are nothing more than the result of
inappropriate register accesses.
Reading a 1260-114 register has a few details that must also be
considered. Depending on what version of the 1260-114 is used,
some registers when read, provide data that is inverted from that
written to the register in an earlier operation.
Tables 3-1 through
3-8
indicate whether bit inversion occurs for a particular register
and whether it occurs in all versions of the 1260-114 or for only
select versions.
The VISA I/O library may be used to control the module. The VISA
function
viOut8()
is used to write a single 8-bit byte to a control
register, while
viIn8()
is used to read a single 8-bit byte from the
control register. The following code example shows the use of
viOut8()
to update the 1260-114 module.
Содержание 407661-001
Страница 6: ......
Страница 7: ...This page was left intentionally blank...