07-15-2008 06:49 PM
However, when I try do do it in simulation mode I always get back an array of false/0. I don't have immediate access to hardware to try this with a live multifunction DAQmx device.
The application is that it would be very useful to know the initial state of the digital I/O lines prior to setting them in a DAQmx Digital Out task.
Thanks,
Dave Gladfelter
07-16-2008 08:28 PM
Dave,
I have verified the use of the VI mentioned in the developer zone with an e-series card. This method can be utilized to read the digital output at any point in the program. The following functions in C can be utilized in the same architecture as the LabVIEW example.
int32 DAQmxCreateDOChan (TaskHandle taskHandle, const char lines[], const char nameToAssignToLines[], int32 lineGrouping);
int32 DAQmxReadDigitalU8 (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, uInt8 readArray[], uInt32 arraySizeInSamps, int32 *sampsPerChanRead, bool32 *reserved);
I also verified that all values will be read as false when the hardware is simulated. If you would like to know what the power up state of the digital lines are, keep in mind that this is hardwired in some cards while others can programmatically change this. The power up state can be changed through Measurement and Automation Explorer by right clicking on the device and selecting properties>>power up states. This information can be found in the manual of your device.