04-29-2024 08:33 AM
hello
I want to set the pull down of PCIe-6509 as shown in the picture above.
I want to use the DAQmxSetDigitalPowerUpStates() and DAQmxGetDigitalPowerUpStates() functions in the NI-DAQmx library.
1. For PCIe-6509, is there a sample program (C# or .net)?
2. What values should be entered in the deviceName, channelNames, and state items of the parameters below?
- For example, between P0.0 and P0.7
P0.0 -> Pull up, P0.1 -> Pull down, P0.2 -> Pull up, P0.3 -> Pull down, P0.4 -> Pull up, P0.5 -> Pull down, P0. 6 -> Pull up, P0.7 -> Pull down
best regard.
Parameters
Input | ||||||||||||||
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deviceName | const char [] | Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name. | ||||||||||||
channelNames | const char [] | The digital line or port to modify. You cannot set power-up states for dedicated digital input lines. You can specify a list or range of channels. | ||||||||||||
state | int32 | The power-up state to set for the channel(s) in channelNames.
|
||||||||||||
moreChannelsAndStates | any type (passed by value) | Pairs of additional channels and the states to set the channels to when the device powers up or when the device is reset. You must pass NULL at the end of the argument list. If you do not want to pass additional channels and states, the function call can be similar to the following example: DAQmxSetDigitalPowerUpStates ("Dev1", "Dev1/do0", DAQmx_Val_High, NULL); If you pass additional channels and states, the function call can be similar to the following example: DAQmxSetDigitalPowerUpStates ("Dev1", "Dev1/do0", DAQmx_Val_High, "Dev1/do1", DAQmx_Val_Tristate, NULL); |
Return Value
Name | Type | Description |
---|---|---|
status | int32 | The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. |
05-02-2024 10:21 AM
int32 __CFUNC_C DAQmxSetDigitalPowerUpStates (const char deviceName[], const char ChannelNames[], int32 state, ...);
int32 __CFUNC_C DAQmxGetDigitalPowerUpStates (const char deviceName[], const char channel name[], int32* state, ...);
int32 __CFUNC_C DAQmxSetDigitalPullUpPullDownStates (const char deviceName[], const char ChannelName[], int32 state, ...);
int32 __CFUNC_C DAQmxGetDigitalPullUpPullDownStates (const char deviceName[], const char ChannelName[], int32* state, ...);
For example, in the case of PXIe-6509, 8 bits are set as follows.
DAQmxSetDigitalPullUpPullDownStates("Dev1", "Dev1/do0", DAQmx_Val_PullUp, NULL);
or
DAQmxSetDigitalPullUpPullDownStates("Dev1", "Dev1/do0", DAQmx_Val_PullDown, NULL);
Q1) Is this the correct way to set only 1 bit out of 8 bits?
Pull-up to P1.0
Pull-down to P1.1
Pull-up to P1.2
Pull-down to P1.3
Pull-up to P1.4
Pull-down to P1.5
Pull-up to P1.6
Pull-down to P1.7
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do1_0", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do1_1", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do1_2", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do1_3", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do1_4", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do0_5", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do0_6", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/do0_7", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di1_0", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di1_1", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di1_2", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di1_3", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di1_4", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di0_5", DAQmx_Val_PullDown, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di0_6", DAQmx_Val_PullUp, NULL);
DAQmxSetDigitalPullUpPullDownStates ("Dev1", "Dev1/di0_7", DAQmx_Val_PullDown, NULL);