Language Dictionary - 6
When an output signal is programmed, the pin is driven by an open collector transistor. Writing a word to the port using cfSetDigitalPort will turn the transistor on or off based on the word and the polarity of the bit. Reading the port using cfGetDigitalPort returns the last value written to the bit.
When an input signal is programmed, the state of the input can be read using cfGetDigitalPort. Writing to the port has no affect on the bit.
When CF_DIG_INOUT is programmed, the bit can be used as both an input and an output. Writing a word that causes the output to go high turns the output transistor off and allows an external device to drive the port high or low. Writing a word that causes the output to go low turns the transistor on and drives the port bit low. Reading the port returns the actual state of the port, not the programmed value.
NOTE: If an even bit that was previously configured as CF_ISOLATED is set to CF_GROUNDED, the attributes of its adjacent paired bit (the odd bit) default to CF_GROUNDED, CF_DIG_INOUT, and CF_LOW_TRUE, unless otherwise programmed.
CF_ISOLATED Operation
When the reference argument is set to CF_ISOLATED, each even numbered bit and the odd numbered bit that immediately follows it form a pair. The pins on the output connector that correspond to each
CF_ISOLATED.
Any
CF_EXT_FAULT_OUT CF_DIG_OUT CF_POWER_FAIL_OUT CF_DIG_OUT_AND_NOT_
FAULT_IN
External Fault output (has the same logical value as External Fault input) General purpose output
External Power Fail output.
Combines a CF_DIG_OUT function with enabling logic from CF_EXT_FAULT_IN.
The polarity of an CF_ISOLATED pair is set using the polarity argument. If the polarity is CF_HIGH_TRUE, then a 1 sent to the pair’s even numbered bit by cfSetDigitalPort will be output as a high level at the connector. If the polarity is CF_LOW_TRUE, then a 1 sent to the pair’s even numbered bit will be output as a low level at the connector.
Any pair that is set to CF_ISOLATED cannot be used as a digital input. The data returned by cfGetDigitalPort for a CF_ISOLATED pair consists of the programmed value in the even numbered bit and a 0 in the odd numbered bit.
See Also
cfSetDigitalPort, cfGetDigitalConfig
91