Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Device name from physical channel in DAQmx

I need to get the device name from a specified physical cahnnel with DAQmx.  Can't seem to do it.

 

Is there a property I am missing?  The physical channel properties don't help, and other than recursively walking the tree of all the daq channels on my system and looking for a match, I can't figure out how to do it.

 

Note:  Parsing the string will not work, I am using a cDAQ module.

 

0 Kudos
Message 1 of 8
(5,958 Views)
Have a look at Task Node in the DAQmx Palette. In there, you will see the Devices property which gives the name of the device.
Message Edited by Adnan Z on 07-06-2009 07:17 PM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 8
(5,956 Views)

OK, so I had seen that.  But...

 

I am retrieving the device names in order to reset the boards.  If I configure the tasks I need, then reset the boards, won't I have to reconfigure the tasks?

0 Kudos
Message 3 of 8
(5,950 Views)

Not sure about the configuration. Using DAQmx Reset, immediately aborts all active tasks associated with a device, disconnects any routes, and returns the device to an initialized state. Aborting a task immediately terminates the currently active operation, such as a read or a write. Aborting a task puts the task into an unstable but recoverable state. To recover the task, use DAQmx Start to restart the task or use DAQmx Stop to reset the task without starting it.

 

May I ask, why do you want to reset the board right after you have created a new task?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 8
(5,947 Views)

Adnan Z wrote:

...

May I ask, why do you want to reset the board right after you have created a new task?


We're getting confused.  I want to reset the board BEFORE I start any tasks, to make sure that no other DAQ Task is running.  I figured that's the easiest way.

 

But as this is a cDAQ and it's kinda hard for a layman to understand the DAQ setup, I just want to scan through the specified channels, figure out what the module/devices are, and reset each module on its own (resetting the chasis does not seem to reset the individual modules).

 

Since the DAQ is set up using Physical Channels, I can't seem to get the devices from the DAQ Channels until I create a task!.  So it looks as though I have to create a task, get the chassis device, get the modules, close the task and then reset the board.  AND that will only work if there is not already a conlficting task set up, right?

 

 

0 Kudos
Message 5 of 8
(5,943 Views)

Hi, Jed.

 

Yes, you can reset each module individually without creating a task.  I've attached a VI (in version 8.6.1) that will not only reset your device, but also deliver all of the Device names that are on your machine, as well as all of the device names associated with a particular cDAQ chassis.  Below is a screenshot of the Block Diagram of the attached code:

 screenshot.JPG

If you need to individually reset more than one module within your cDAQ chassis, you can use multiple DAQmx Reset Device VIs.  (FYI:  If there were tasks associated with the device that is being reset, the tasks would be aborted, but the existence of a task is NOT required in order to use the DAQmx Reset Device VI.)

 

I understand that in your first post, you said that you wanted to be able to get the device name from a specific physical channel.  Since the name of the device is usually incorporated with the name of the channel, did you actually mean to get the module device name from the name of the chassis?

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
Message 6 of 8
(5,909 Views)

Hi Jed,

 

I have been having the same issue. I would like to have the user specify the phsyical channels to be used in the data acquisition and from this information I figured I could identify the modules that are embedded in that channel description and reset those modules. Doing this would start with a clean environement. Then I would define the tasks. I have had a hard time, like you, getting the device name which is clearly visible as the output of the physcial IO channel control (at the beginning followed by a backslash). I have found that you can flatten the names to a string and extract it this way. But there should be a build device name that bahaves like the build path functions - it seem to be an identical format.

 

The solution already presented doesn't really work because the device name is given manually at the beginning of the code.

 

-Brad 

0 Kudos
Message 7 of 8
(5,591 Views)
Never mind starting at DAQmx system it does work!
0 Kudos
Message 8 of 8
(5,590 Views)