What's Next - Allen-Bradley 1784-KTX Reference Manual

Table of Contents

Advertisement

What's Next

Allen-Bradley Parts
Example 6.A
Initialization
/**** ENABLE WATCHDOG TIMER OPERATION
*****
*****
ktx_alive = TRUE;
oldhandler = getvect(CLOCK_INTR);
wdg_accum = 0;
wdg_preset = 10;
dp–>host_dead_counter =
wdg_preset * WDG_SCALER;
setvect(CLOCK_INTR, KTX_watchdog);
The routine in Example 6.B performs the watchdog handshaking with the
scanner (if enabled). If the scanner is dead, this routine resets the clock
interrupt handler, prints a message, and exits.
Example 6.B
Interrupt Service Routine
void
interrupt
{
/**** If accumulated == preset, check alive_flag */
if (++wdg_accum == wdg_preset) {
if (dp–>alive_flag != KTX_ALIVE) {
/**** Setting this to FALSE will allow main routine ****/
/**** to drop out of its loop and cleanup the
/**** interrupt vectors before exiting
ktx_alive = FALSE;
} else {
/**** Let KTX know that the host is still alive ****/
dp–>alive_flag = HOST_ALIVE;
wdg_accum = 0;
}
}
/**** Call the old routine ****/
oldhandler();
}
Chapter 7 explains how to access the scanner I/O image tables to read and
modify discrete I/O.
Chapter 6
Reporting KTx Scanner Status
****/
/* local variable
/* save old vector
/* clear current wgd count
/* Host counts 10 interrupts
/* KTX counts 50
/* install new interrupt
/* service routine
KTX_watchdog()
*/
*/
*/
*/
*/
*/
*/
****/
****/
6-9

Advertisement

Table of Contents
loading

This manual is also suitable for:

1784-ktxd1784-kts

Table of Contents