07-06-2009 05:48 PM
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.
07-06-2009 06:17 PM - edited 07-06-2009 06:17 PM
07-06-2009 06:56 PM
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?
07-06-2009 07:43 PM
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?
07-06-2009 09:37 PM
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?
07-07-2009 06:33 PM
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:
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?
05-14-2010 09:27 AM
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
05-14-2010 09:29 AM