8 - programming the scanner, Programming the scanner – Rockwell Automation 6008-SV2R VMEbus remote I/O Scanner User Manual
Page 135
8
Chapter
8Ć1
Programming the Scanner
This chapter provides programming examples that illustrate the scanner
management commands.
If you want to read about: go to page:
using the semaphore
knowing when a command is complete
programming examples of each scanner
management command
programming blockĆtransfers
communicating with PLCĆ5 processor in
adapter mode
Important: The programming examples in this publication are examples
only. They will need modification before they can run correctly in
your application. These examples were developed for a Radisys EPC
computer; they were written in Microsoft C version 7.00. To use these
examples on other VME systems, search for and replace all “EPC” calls
with the appropriate functions for your system.
For more details on the structure of the scanner commands, see
chapter 5 or 6 for SV-compatible or SV-superset mode, respectively.
Before the VME master processor issues a command request to the
scanner, use a read-modify-write cycle to test and set the scanner’s
semaphore. If the semaphore bit is set (non-zero), the VME master
processor should not access the control/status and general data areas of the
scanner (except for the operating status word). If, however, the semaphore
is clear (zero), the VME master processor can then access the control/status
and general data areas and should set the semaphore bit to signify to other
master processors that these areas are in use.
Important: When the semaphore is set, other VME master processors can
still overwrite data in the global RAM with their own data if necessary.
The semaphore does not physically lock-out other VME master processors.
It is only a flag to warn other VME master processors that another
processor is accessing global RAM. When the scanner sees the semaphore
set, it won’t write to the global data area. The scanner waits until a VME
master processor resets the semaphore to zero. The scanner can never reset
the semaphore itself. The scanner continues to update the I/O image tables
and operating status words regardless of the status of the semaphore bit.
Using This Chapter
Using the Semaphore