Download TelePACE C Tools User Manual

Transcript
ioWriteSP100Outputs
Write to SCADAPack 100 Outputs from I/O Database
Syntax
#include <ctools.h>
unsigned ioWriteSP100Outputs(unsigned startCoilRegister);
Description
The ioWriteSP100Outputs function writes data to the digital outputs of the SCADAPack
100 I/O. Digital data is read from 6 consecutive coil registers beginning at
startCoilRegister, and written to the 6 digital outputs.
The function returns FALSE if startCoilRegister is invalid, or if an I/O error has
occurred; otherwise TRUE is returned.
startCoilRegister is any valid Modbus coil register between 00001 and (NUMCOIL - 5).
Notes
To write data to an I/O Module continuously, add the module to the Register Assignment.
The IO_SYSTEM resource must be requested before calling this function.
See Also
ioReadSP100Inputs
Example
This program turns on all 6 digital outputs.
#include <ctools.h>
void main(void)
{
unsigned reg;
request_resource(IO_SYSTEM);
/* Write digital data to I/O database */
for (reg = 1; reg <= 6; reg++)
{
setdbase(MODBUS, reg, 1);
}
/* Write data from I/O database to SCADAPack 100 I/O */
ioWriteSP100Outputs(1);
release_resource(IO_SYSTEM);
}
TelePACE C Tools User and Reference Manual
May 9, 2007
317