Impulse 463E User Manual

Page 87

Advertising
background image

© Sealevel Systems, Inc.

- 84 -

SeaI/O User Manual

Changing the Programmable I/O Configuration

For SeaI/O modules featuring programmable IO, it may be necessary to configure the
IO direction and presets from a custom application, rather than through MaxSSD.
In such a case, the holding registers hold the module IO configuration. Specifically,
holding registers 4 – 9 contain the bit presets for the module. However, these
registers must be written singly, rather than performing a multi-register write (i.e.
only one register should be written to at a time). Please note that holding registers
are two bytes wide, each.
After the bit presets have been written, the IO direction can be set by writing to
holding register three. For more information, consult the section labeled “Set PIO
Config” and the appendix section titled “Model 462/463 Holding Registers.”

result = cw32.Write(slaveId, HOLDINGREG, 4 + index, 1,
&writeHoldRegs[index]);

result = cw32.Write(slaveId, HOLDINGREG, 3, 1, &writeHoldRegs[0]



The following is an example of how to set the holding registers within a Visual Basic
application.

returnValue = SeaMaxW32Write(seaMaxPointer, slaveId, HOLDINGREG, 4 +
Counter, 1, writeHoldRegs(i))

returnValue = SeaMaxW32Write(seaMaxPointer, slaveId, HOLDINGREG, 3, 1,
writeHoldRegs(0))



NOTE:

Each group of 8 PIO is considered a port. Ports may be set either as
a group of inputs or a group of outputs – with bit selectable presets
for ports configured as outputs.

NOTE:

The output port presets do not define a constant state for the output
ports. Rather, the presets indicate the default state for when the
ports change IO directions (i.e. from input to output) or when the
device is reset.




Advertising