we_ReadBack

long we_ReadBack(
     long Handle,   //handle returned by we_OpenCard
     long Port,   //identifies the port from which the value will be read back
     long *Value   //receives the value which is read back from the port
     );

Summary

The we_ReadBack function may be used with the output ports on an I/O card. The function reads back the last value that was written to an output port.

Parameters

Handle:
    Identifies the card to be read.
Port:
    Identifies the port on the card that should read back.
Value:
    Points to a variable which will receive the last value written to the port.

Return Values

If the value was successfully read back, the function will return 0 to indicate success and the variable pointed to by Value will be loaded with the value that was read back. If an error occurs, a negative error code will be returned. Errors that may be returned include:

More Information

This function actually reads the current state of an output port from the I/O card itself. By using this function, you can essentially recall the last value that was written to a particular port.

This function must be used with a port that is configured for output. If you fail to configure the port for output, an error will be returned.

If the function fails and returns an error code, the variable pointed to by Value will not have any meaningful data in it because the port was never successfully read back. If this happens, the value of Value will be undefined.

Related

we_OpenCard, we_ConfigureCard, we_OutputValue


Copyright 2004 Winford Engineering.