Gx3756PioSetGroupChannel

Purpose

Sets the specified group channel’s digital.

Syntax

Gx3756PioSetGroupChannel (nHandle, nGroup, nChannel, nValue, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3756 board.
nGroup
SHORT
Select the group to set:
0.      GX3756_PIO_GROUP0: Digital I/O group 0, group’s channels 0-3, board channels 0-3.
1.      GX3756_PIO_GROUP1: Digital I/O group 1, group’s channels 0-3, board channels 4-7.
2.      GX3756_PIO_GROUP2: Digital I/O group 2, group’s channels 0-3, board channels 8-11.
3.      GX3756_PIO_GROUP3: Digital I/O group 3, group’s channels 0-3, board channels 12-15.
4.      GX3756_PIO_GROUP4: Digital I/O group 4, group’s channels 0-3, board channels 16-19.
5.      GX3756_PIO_GROUP5: Digital I/O group 5, group’s channels 0-3, board channels 20-23.
6.      GX3756_PIO_GROUP6: Digital I/O group 6, group’s channels 0-3, board channels 24-27.
7.      GX3756_PIO_GROUP7: Digital I/O group 7, group’s channels 0-3, board channels 28-31.
8.      GX3756_PIO_GROUP8: Digital I/O group 8, group’s channels 0-3, board channels 32-35.
9.      GX3756_PIO_GROUP9: Digital I/O group 9, group’s channels 0-3, board channels 36-39.
10.   GX3756_PIO_GROUP10: Digital I/O group 10, group’s channels 0-3, board channels 40-43.
11.   GX3756_PIO_GROUP11: Digital I/O group 11, group’s channels 0-3, board channels 44-47.
12.   GX3756_PIO_GROUP12: Digital I/O group 12, group’s channels 0-3, board channels 48-51.
13.  GX3756_PIO_GROUP13: Digital I/O group 13, group’s channels 0-3, board channels 52-55.
nChannel
SHORT
Select the specified group channel, channel number can be follows:
0.      GX3756_PIO_GROUP_CH0: group digital I/O channel 0.
1.      GX3756_PIO_GROUP_CH1: group digital I/O channel 1.
2.      GX3756_PIO_GROUP_CH2: group digital I/O channel 2.
3.    GX3756_PIO_GROUP_CH3: group digital I/O channel 3.
nValue
SHORT
Sets the specified group channel’s:
0.      Channel is set to low.
1.    Channel is set to high.  
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

A logic high (‘1’) means the channels is set to high, logic low (‘0’) means the channel is set to low. There are 56 Digital I/O channels, channel’s direction control is set in groups of 4 channels, e.g. channels 0-3, channels 4-7, etc. Any group of channels can be programmed to be all in or all out. If a group of channels is direction is set to input, the user can use specific channel is set Gx3756PioReadGroup(), Gx3756PioReadChannel(), and Gx3756PioReadAllChannels() APIs to read back the actual logic input levels.

Channels 0-3 (Group 0) can be programmed to operate as serial-out transmitter. See Gx3756SerialOutSetMode() API for more details.

Channels 3-7 (Group 1) can be programmed as an external trigger source to channels 0-3 (Group 0), when they are set to serial-out operation mode. See Gx3756SerialOutSetMode(), and Gx3756SerialOutGetTriggerSource() APIs for more details.

Example

The following example sets group 0 channel 1 to high:

See the Gx3756PioSetGroupDirection() API for complete example.

 

SHORT nHandle, nStatus;

 

Gx3756PioSetGroupChannel (nHandle, GX3756_PIO_GROUP0, GX3756_PIO_GROUP_CH0, 0x1, &nStatus);

 

See Also

Gx3756PioGetGroupChannel, Gx3756PioReadAllChannels, Gx3756PioReadGroup, Gx3756PioReadGroupChannel, Gx3756PioResetGroup, Gx3756PioSetAllChannels,  Gx3756PioSetAllGroupsDirection, Gx3756PioSetGroup, Gx3756PioSetGroupDirection, GxFpgaGetErrorString