GX5055, GX5295, File
Sets the channels range with the programmed PMU forced current value and the PMU forced current range.
DioPmuSetupForcedCurrent (nHandle, nChannelListMode, nCountOrFirstChannel, panChannelList, nLastChannel, dCurrent, nCurrentRange, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
DIO Master board handle, Slave handle or File board handle. |
nChannelListMode |
SHORT |
Channel list mode dictates how nCountOrFirstChannel and panChannelList parameters are used. Channel list mode options are as follows:0 DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS: The user specifies an array of channels where nCountOrFirstChannel is the number of elements in the list array and panChannelList is an array contains the channels numbers. In this mode nLastChannel is ignored.1 DIO_CH_LIST_MODE_ALL_BOARD_CHANNELS: Apply the settings to all the board’s channels associated with this board handle. In this mode nCountOrFirstChannel, panChannelList and nLastChannel variavles are ignored.2 DIO_CH_LIST_MODE_ALL_DOMAIN_CHANNELS: Apply the settings to all the channels in the domain, e.g. if there are two boards in the domain (Master and a Slave), then all 64 channels will be set. In this mode nCountOrFirstChannel, panChannelList and nLastChannel variavles are ignored.3 DIO_CH_LIST_MODE_RANGE_OF_CHANNELS: Apply settings to a range of channels where nCountOrFirstChannel is the first channel number and nLastChannel is the last channel number. In this mode panChannelList variavle is ignored. |
nCountOrFirstChannel |
SHORT |
If nChannelListMode parameter is set to DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, then it is specifying the number of elements in the panChannelList array parameter.If nChannelListMode parameter is set to DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, then it is specifying the first channel number to apply the settings to,otherwise it is ignored and should set to zero.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).Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves). |
panChannelList |
PSHORT |
Array of channels numbers. Channels numbers can be from 0 to the last channel in the domain. E.g., if the domain has two boards then the last channel is 63.This parameter is only used if nChannelListMode parameter is set to DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, otherwise is should be passed as NULL.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).Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves). |
nLastChannel |
SHORT |
If nChannelListMode parameter is set to DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, then it is specifying the last channel number to apply the settings to,otherwise it is ignored and should set to zero.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).Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves). |
dCurrent |
DOUBLE |
Programmed PMU forced current value. PMU forced current value depends on the current range settings. |
nCurrentRange |
SHORT |
Programmed PMU forced current range. PMU forced current range can as follows:GX5055:0 GX5055_PMU_CURRENT_RANGE_N200MA_TO_P200MA: forced current range is between -200mA to +200mA.1 GX5055_PMU_CURRENT_RANGE_N25MA_TO_P25MA: forced current range is between -25mA to +25mA.GX5295:0. GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA: PMU forced current range is between -32mA to +32mA.1. GX529X_PMU_CURRENT_RANGE_N8MA_TO_P8MA: PMU forced current range is between -8mA to +8mA.2. GX529X_PMU_CURRENT_RANGE_N2MA_TO_P2MA: PMU forced current range is between -2mA to +2mA.3. GX529X_PMU_CURRENT_RANGE_N512UA_TO_P512UA: PMU forced current range is between -512uA to +512uA.4. GX529X_PMU_CURRENT_RANGE_N128UA_TO_P128UA: PMU forced current range is between -128uA to +128uA.5. GX529X_PMU_CURRENT_RANGE_N32UA_TO_P32UA: PMU forced current range is between -32uA to +32uA.6. GX529X_PMU_CURRENT_RANGE_N8UA_TO_P8UA6: PMU forced current range is between -8uA to +8uA.7. GX529X_PMU_CURRENT_RANGE_N2UA_TO_P2UA7: PMU forced current range is between -2uA to +2uA. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The board must be in the PMU Forced current prior calling this function otherwise the function returns an error.
The following Gx5295 example uses an array of channels list to set programmed PMU forced current to 25mA and the current range to -32mA to +32mA:
SHORT anChannelList[]={0, 2, 5, 7, 9, 13, 14, 27};
DioPmuSetupForcedCurrent (nHandle, DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, 8, anChannelList, 0, 25.0, GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA, &nStatus);
The following example sets all the board’s channels to set programmed PMU forced current to 25mA and the current range to -32mA to +32mA::
DioPmuSetupForcedCurrent (nHandle, DIO_CH_LIST_MODE_ALL_BOARD_CHANNELS, 0, NULL, 0, 25.0, GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA, &nStatus);
The following example sets all the boards’ channels to set programmed PMU forced current to 25mA and the current range to -32mA to +32mA:
DioPmuSetupForcedCurrent (nHandle, DIO_CH_LIST_MODE_ALL_DOMAIN_CHANNELS, 0, NULL, 0, 25.0, GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA, &nStatus);
The following example sets channels 5 to 10 to set programmed PMU forced current to 25mA and the current range to -32mA to +32mA:
DioPmuSetupForcedCurrent (nHandle, DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, 5, NULL, 10, 25.0, GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA, &nStatus);
DioSetupChannelMode, DioPmuSetupForcedCurrent, DioPmuSetupForcedVoltage, DioGetErrorString