Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxGetNthTaskDevice is UNDOCUMENTED but used in an example

I have NI-DAQmx 8.3 installed and have used the included example "ANSI C Example program: ContGen-IntClk.c".  Within the example there is a function called GetTerminalNameWithDevPrefix that calls the NI-DAQmx function DAQmxGetNthTaskDevice. I tried to get further information on DAQmxGetNthTaskDevice in both the online documentation and the NI website, but in both places came up with "not found".  The example works so I know the function exists in the library.  Has this function been replaced?  Should it not be used?
0 Kudos
Message 1 of 7
(4,105 Views)

Hello. 

Thank you for posting to the NI Discussion Forums. 

I have searched for the example that you are referencing and have come across 4 instances of a file with that name on my harddrive that are ANSI C.  After searching all of them for GetTerminalNameWithDevPrefix, I have come up dry.  So, could you please post where this example resides in your directory structure?  This would help me track down this example much faster.  I am currently running DAQmx 8.5 (the latest version) so this may explain why I didn't see this function. 

That said, are you seeing any unexpected behavior with this function or are you just curious about what this function offers? 

Let us know and we will be happy to help you further!

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 2 of 7
(4,091 Views)
This is the example I used C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\Continuous AI\ContinuousAI.c

I was looking for this in relation to another post I also made, " PCI-6281 How to use80 mHZ timebase for A/d and D/A sample clocks".  Since I had used this to get the device name in a program I derived from the above example, I was looking into the various NI-DAQmx properties to see if I could set up the 80 mHZ internal clock as my timebase.  Many of the property function calls use essentially unexplained parameters, especially "const char device[]" it seemed that this function might come in handy.

Since the post, I think I have figured out the parameters and have looked at many values returned from the property function calls.  Unfortunately, I still have not discovered a way to use the 80 mHZ clock as my timebase.

The documentation on the property functions is very, very slim.  I was irrationally hoping someone might point me in the direction of more complete documentation, but I rate my chances as very, very slim also.  I have been using NI hardware and software for over twenty years and the documentation has always been the achilles heel.

It would be nice to know if this function is obsolete or just left out.  If left out, maybe this post could go in the suggestion box to fix for the next update.

I have not upgraded to version 8.3.1 or 8.5 becuase after reading the release notes for both it appears there is nothing added except for new hardware and Vista.  Since you could not find this function, it appears they have not documented it as of yet.  Do you recommend upgrading anyway?

0 Kudos
Message 3 of 7
(4,085 Views)
Hi CyberSmith,

The lack of documentation for DAQmxGetNthTaskDevice() is an oversight, since the NI-DAQmx C Reference Help contains documentation for the nearly identical DAQmxGetNthTaskChannel() function. I recommend looking at the documentation for that function.

That said, here's a quick overview: DAQmxGetNthTaskDevice() is a version of DAQmxGetTaskDevices() that does not require you to parse a comma-delimited string. Instead, you can use DAQmxGetTaskNumDevices() to find out the number of devices, then use DAQmxGetNthTaskDevice() to get the name of each device in the task separately. I just sent a bug report about this to our documentation team.

As for when to upgrade to the latest software, everyone seems to have a different opinion on that. Personally, I would upgrade if a new version had something I need (new features that I think I will use, new platform support for an OS or development environment that I use, bugfixes that affect me, etc.). Of course, if you ask for help on the forums, don't be surprised if the first response you get is "are you running the latest version?". 🙂

Brad
---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 7
(4,078 Views)
Hi Brad,

Thanks for the reply.  I think my question is answered now.  The one thing I would like to point out is that the function DAQmxGetNthTaskDevice is also not in the documentation that I have.  And without one of these two functions I don't know how to get the character string form of the device name that is required in many function calls.

Thanks,
CyberSmith
0 Kudos
Message 5 of 7
(4,071 Views)
Hi David,

Here's the documentation for DAQmxGetNthTaskChannel() from the DAQmx 8.5 version of the NI-DAQmx C Reference Help. DAQmxGetNthTaskDevice() should be the same except instead of virtual channel names it returns device names.

DAQmxGetNthTaskChannel

int32 DAQmxGetNthTaskChannel (TaskHandle taskHandle, uInt32 index, char buffer[], int32 bufferSize);

Purpose

Returns the Nth channel. This function takes the taskHandle, index, and bufferSize you specify and returns the Nth channel.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
index uInt32 The Nth channel you want to return. The index starts at 1.
bufferSize int32 The size, in bytes, of buffer. If you pass 0, this function returns the number of bytes needed to allocate.
Output
buffer char [] The Nth channel in the index. If you pass NULL, this function returns the number of bytes needed to allocate.

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 negative value indicates an error.

For this function, if you pass NULL for the buffer or 0 for the buffer size, this function returns the number of bytes needed to allocate.

Brad
---
Brad Keryan
NI R&D
0 Kudos
Message 6 of 7
(4,060 Views)
Thanks Brad.

It seems like I should at least download 8.5 for the docs.  As far as the update goes, well you know, if it ain't broke don't fix it.
0 Kudos
Message 7 of 7
(4,054 Views)