DioRemapChannel

Applies To

GX5280, GX5290, GX5295,  File

Purpose

Remap the specified channel’s data in a DIO domain.

Syntax

DioRemapChannel (nHandle, nFirstChannel, nSecondChannel, nMode, dwMemory, dwStartStep, pdwNumSteps, dwOptions, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
DIO or File Board handle.
nFirstChannel
SHORT
Specified the first channel in the DIO domain or DIO File to remap.
nSecondChannel
SHORT
Specified the second channel in the DIO domain or DIO File to remap.
nMode
SHORT
Remap operation mode:
1. DIO_SWAP_CHANNELS: swap the data of the first and second channels.
2. DIO_MOVE_CHANNELS: move the first channel to the second channel location while pushing the channels in between up or down. E.g. passing first channel=3 and second channel=0, then the channels contents will be: 3,0,1,2.
3. DIO_COPY_CHANNELS: copy the first channel’s data to the second channel.
dwMemory
DWORD
Selects the target memories to be affected by the remap operation, if selecting memory target other then 0 (Auto mode), memories can be ORred. See comments for details:
0=DIO_REMAP_MEMORY_AUTO: will affect all required memories based on the remap operation and the board’s type. E.g. if the board type is Gx529x, then selecting the copy channels operation it will copy the output memory as well as the direction memory to the second channel.
1=DIO_REMAP_IN_MEMORY: Input memory apples to Gx529x board type only.
2=DIO_REMAP_OUT_MEMORY : Output memory apples to Gx529x board type only.
4=DIO_REMAP_DATA_MEMORY: Data memory apples to Gx528x board type only.
8=DIO_REMAP_CTRL_MEMORY: Control memory apples to Gx5055 board type only.
0x10=DIO_REMAP_DIRECTION_MEMORY: Direction memory apples to Gx529x board type only.
0x20=DIO_REMAP_RTC_EXPECTED_MEMORY: Expected memory apples to Gx529x board type only when in Real time compare operation mode.
0x40=DIO_REMAP_RTC_INPUT_MASK_MEMORY: Mask memory apples to Gx529x board type only when in Real time compare operation mode.
dwStartStep
DWORD
Specified starting step in the DIO board or File.
pdwNumSteps
PDWORD
Specified the number of steps, passing -1 selects all the steps in the DIO board or File from start step to the end.
dwOptions
DWORD
Currently not used, pass as 0.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Note: The board must be in HALT state before calling this function.

Note: Real Time Compare functionality is supported by GX529x boards with firmware versions 0x8A00 and above.

Example

The following example copies 124 steps of channel 0 to channel 3 using auto mode for memory selection:

 

DWORD dwNumSteps;

DioRemapChannel (nHandle, 0 , 3, DIO_COPY_CHANNELS, DIO_REMAP_MEMORY_AUTO 0, 124, 0, &nStatus);

 

See Also

DioReadCtrlMemory, DioWriteCtrlMemory, DioReadDirectionMemory, DioWriteDirectionMemory, DioReadInMemory, DioWriteInMemory, DioReadIOMemory, DioWriteIOMemory, DioReadOutMemory, DioWriteOutMemory, DioGetErrorString