DioGetOutputDataFormat

Applies To

GX5055, File.

Purpose

Returns the channel output data format.

Syntax

DioGetOutputDataFormat (nHandle, nChannel, pnDataFormat, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
DIO Master board handle, Board handle or File board handle.
nChannel
SHORT
If Board Handle was passed:
Channel number in the DIO board, each board has 32 I/O channels. I/O channels number range is 0-31.
If Master Board Handle was passed:
Channel number in the DIO domain, each DIO board adds 32 I/O channels. I/O channels number range is 0-991 (1 master and 30 slaves).
pnDataFormat
PSHORT
Output data format can be as follows:
0. DIO_OUTPUT_DATA_FORMAT_NR: No Return
1. DIO_OUTPUT_DATA_FORMAT_R0: Return to Zero
2. DIO_OUTPUT_DATA_FORMAT_R1: Return to One
3. DIO_OUTPUT_DATA_FORMAT_RZ: Return to Hi-Z
4. DIO_OUTPUT_DATA_FORMAT_RC: Return to Complement
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

DIO_OUTPUT_DATA_FORMAT_NR: No Return, the output logic level stay either high or low for the duration of the clock period.

DIO_OUTPUT_DATA_FORMAT_R0: Return to Zero. The signal returns to zero between consecutive data clocks at 50% of the specified output frequency clock duty cycle. This takes place even if a number of consecutive 0's or 1's occur in the signal. The signal is self clocking and does not require any additional settings.

DIO_OUTPUT_DATA_FORMAT_R1: Return to One. The signal returns to one between consecutive data clocks at 50% of the specified output frequency clock duty cycle. This takes place even if a number of consecutive 0's or 1's occur in the signal. The signal is self clocking and does not require any additional settings.

DIO_OUTPUT_DATA_FORMAT_RZ: Return to Hi-Z .The signal returns to hi-z between consecutive data clocks at 50% of the specified output frequency clock duty cycle. This takes place even if a number of consecutive 0's or 1's occur in the signal. The signal is self clocking and does not require any additional settings.

DIO_OUTPUT_DATA_FORMAT_RC: Return to Complement (RC). In Return to Complement (also called Manchester code) each transmitted data bit has at least one transition at 50% of the specified output frequency clock duty cycle. It is, therefore, self-clocking, which means that a clock signal can be recovered from the encoded data. Return to Complement ensures frequent line voltage transitions, directly proportional to the clock rate, this helps clock recovery. Logic low is expressed by a low-to-high transition. Logic high is expressed by high-to-low transition. The transitions which signify logic high or low occur at the midpoint of a period, the direction of the mid-bit transition indicates the data.

Note: the channel data format will be applied to all the channels’ steps that are set as outputs. Input data will not be formatted.

Channels data format can be read back and set dynamically at any time even while the DIO is running mode.

Example

The following example returns channel 0 input data format:

 

SHORT nDataFormat;

DioGetOutputDataFormat (nHandle, 0, &nDataFormat, &nStatus);

 

See Also

DioSetupOutputDataFormat, DioSetupInputLoadCommutatingVoltage, DioSetupInputLoadResistance, DioSetupInputThresholdVoltages, DioGetErrorString