Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make DAQmxGetTaskChannels command work

Solved!
Go to solution

I am trying to read the task attributes from MAX using various DAQmx commands with VB6.  I have found that a straight forward Load Task (DAQmxLoadTask) generates a valid taskhandle from a known taskname in MAX which can be used to get the measurement data using the analog in Read command (DAQmxReadAnalogF64).  The results appear to be already scaled according to my setup in MAX. What I would like to do is read the task names from the setup in MAX, select one in VB and then read the channel names and channel units from MAX as well as the measurement data. I tried the following commands without an error but always see a null result in the output string variable.

DAQmxGetTaskName

DAQmxGetTaskChannels

DAQmxGetAICustomScaleName

 

Curiously, the command, DAQmxGetTaskNumChans, successfully delivers the number of channels in the MAX setup.  With this information I can get the measurement data, but I do not have the engineering units or custom channel names for my output file header to include with my measured data.

I was wondering if the problem is related to any incompatibility with newer versions of daqmx? Or perhaps some other reason?

I am using Windows XP, VB6 with service pack 6, an NI DAQPAd 6015 and NI-DAQmx 9.2.2.

 

0 Kudos
Message 1 of 3
(7,500 Views)
Solution
Accepted by topic author hutchins2

Hi hutchins2,

 

Thanks for posting, check the link below which seems to be the reason of our problem:

 

Text-Based DAQmx Device Information Functions Return a NULL Result

 

Eric NI

0 Kudos
Message 2 of 3
(7,488 Views)

This does help and my commands can now return the desired information.  Specifying ahead of time the size of the unknown names in the receiving string name means there are plenty of trailing blank spaces which must be trimmed from the names to be useful.

Thanks for your input.

0 Kudos
Message 3 of 3
(7,485 Views)