8ć22, Sample code for utility routines – Rockwell Automation 6008-SV2R VMEbus remote I/O Scanner User Manual
Page 156
![background image](/manuals/580456/156/background.png)
Chapter
Programming the Scanner
8
8Ć22
sample code for utility routines
/*
**
** UTILS.C –– sample code utility routines
**
*/
#include ”6008sv2.h”
#include ”bus.h”
#include ”utils.h”
/*
**
** ASSERT_CMD() –– touch scanner channel location monitor
**
**
This function does a word–write to the base of a 6008–SV2 channel VME–ID/Scanner
**
interrupt area. This triggers a local interrupt on the 6008–SV2, alerting it
**
that a command has been placed in the channel’s control/status area for processing.
**
**
parameters:
pointer to channel structure
**
return value:
none
**
*/
void
assert_cmd (channel far *chan)
{
unsigned short far
*vid;
/* map channel & establish pointers */
map_channel(chan);
vid = (unsigned short far *) chan–>VmeIdArea;
/* touch the scanner’s channel location monitor */
*vid = (unsigned short) 0x0000;
/* unmap the channel */
unmap_channel(chan);
return;
}