National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference SCXI_Get_State
©
National Instruments Corporation 2-341 NI-DAQ FRM for PC Compatibles
When channel = –1, data contains the pattern of an entire port. Bit 0 corresponds to the state
of channel 0 in the port, and the states of the other channels are represented in ascending order
in data so that bit n corresponds to channel n. If the port is less than 32 bits wide, the unused
bits in data are set to zero.
When channel = n, the least significant bit (LSB) (bit 0) of data contains the state of channel
n on the specified port.
For relay modules, a 0 bit indicates that the relay is closed or in the normally closed position,
and a 1 indicates that the module is open or in the normally open position. For SCXI digital
modules, a 0 bit indicates that the line is low, and a 1 bit indicates that the line is high.
Note For a discussion of the NC and NO positions, see your SCXI module user manual.
Note C Programmers—data is a pass-by-reference parameter.
Using This Function
The SCXI-1160 is a latching module; in other words, the module powers up with its relays in
the position they were left at power down. Thus, at the beginning of an NI-DAQ application,
there is no way to know the states of the relays. The driver will retain the state of a relay as
soon as a hardware write takes place.
The SCXI-1161 is a nonlatching module and powers up with its relays in the NC position.
After you call
SCXI_Load_Config or SCXI_Set_Config, an actual hardware write to the
relays must take place before the driver can obtain the state information of the relays, just like
the SCXI-1160. You can call
SCXI_Reset to do this.
The SCXI-1163 and 1163R are optocoupler output modules with 32 digital output channels
and 32 solid state relay channels, respectively. NI-DAQ can read the states of the module only
if the module is jumper configured and operating in Parallel mode. When operating in Serial
or Multiplexed mode, the driver retains the states of the digital output lines in memory.
Consequently, a hardware write must take place before the driver can obtain the states of the
module.
You should call
SCXI_Reset after a call to SCXI_Set_Config or SCXI_Load_Config for
the SCXI-1160, SCXI-1161, SCXI-1163, and SCXI-1163R modules.
Remember that only on the SCXI-1162, SCXI-1163, SCXI-1162HV, and SCXI-1163R in
Parallel mode does NI-DAQ read the states from hardware. On both the SCXI-1160 and
SCXI-1161, the driver keeps a software copy of the relay states in memory.