LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring DAQ channels through LabView program

I think I know what the problem is.

By default, the "Physical Channels" control will only display analog input channels. If you are selecting and analog input channel and trying to configure a digital out task, you're going to get an error.

Looking at the VI you posted, the "Physical Channels" control is only displaying the analog input channels it sees on your system. So if you are selecting one of the items in the drop down list, that's your problem. Right click on hte control and select "I/O Name Filtering...". In the dialog that opens is another drop down menu to let you choose what types of cahnnels you want to see in that control. Open that list and select "Digital Output". On the right, another drop down menu will activate. OPen this one and select "Lines and Ports" and hit OK.

You should now be able to select the digital lines and ports in the list and your configure should work.

Let me know if this fixes it.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 11 of 20
(2,298 Views)
Hi Sharmila-

Is it possible that you were seeing error -200488? This might be caused if you are trying to create analog channels on your digital-only PCI-DIO-96.

In the example you posted, the front panel control "physical channels" is only polling for analog channels. You can change this to a digital setting by right-clicking on the control, choosing "I/O Name Filtering," and changing the I/O type to either digital input or output. You can then follow the naming convention for configuring digital ports as Ed illustrated in his example programs.

The task output name did not show up when using the create channel VI alone. Once you actually start the task, this output will show up as "_unnamed task."

Please let me know if changing the setting to reflect a digital output channel works for you. Keep in mind that ai or ao in channel names correspond to analog input and output, respectively, and that any name that mentions ports of lines corresponds to digital operations.

Thanks,
Tom W
National Instruments
0 Kudos
Message 12 of 20
(2,297 Views)
It looks like Ed beat me to the solution by just a few seconds. Thanks again for your input Ed!
Tom W
National Instruments
0 Kudos
Message 13 of 20
(2,295 Views)
Interestingly, I don't get the error anymore. But I still don't get a task name assigned to this configuration. The output I get is _unnamedTask<2>.

I even tried adding a task to the task input. The result is the same task name in the task out indicator but error -200014. I need a task name as I need to build an array of all tasks created so that I can use them later on in the code.

Also, where can I find all DAQmx error codes?

Thanks,
Sharmila
0 Kudos
Message 14 of 20
(2,282 Views)
Hi Sharmila-

The task name input only refers to tasks created in MAX. When you wire a Task In to the DAQmx Create Virtual Channel VI, the Task Out is just a repeat of this. This explains why your output task was repeated from the input.

When creating channels dynamically (i.e. programmatically in LabVIEW) the task name will never be descriptive- it will always be some variation of "_unnamedtask." Rather than creating an array of tasks, the best method is to just have a continuous flow between each DAQmx VI after the virtual channel is created using the method as illustrated in Ed's examples. You will see that there is a continuous "flow" of task name from start to finish for each task that is being performed.

A manual of all DAQmx error codes is not readily available, but the most common codes and possible solutions are listed in these two Knowledge Base entries:

http://digital.ni.com/public.nsf/allkb/8A0E097385A4269586256DBA0054E668
http://digital.ni.com/public.nsf/websearch/001DA4DB6A31CF8886256D33006FA857?OpenDocument

Regards,
Tom W
National Instruments
0 Kudos
Message 15 of 20
(2,274 Views)
I don't think you can assign a specific name to a task whe you dymanically build them like this. At least I can't figure out how.

You can still put the "_unnamedTask<2>" task in an array and use it later. If you need to search the array for a specific task, use a 2D array with one column being what you would name the task so you can search on that, then pull the actual task name from the other column.

I don't know of a complete listing of error codes. Maybe NI could provide this to you.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 16 of 20
(2,267 Views)
Hi guys, I am attaching my VI. I am getting error at Digital Output configuration (-200170). I don't know what this error code means. However, if I create a physical channel list control and use IO Filtering I don't get this error. But the VI that Ed had attached (which creates channel name) works well. I don't know what I am doing different. I don't want to hardcode any channel name as this application needs to be fully portable.

So can one of you please check and let me know. I really appreciate all the help you guys are putting forth.

I am not attaching any other subVI, but that should be insignificant.
Thank you,
Sharmila
0 Kudos
Message 17 of 20
(2,258 Views)
Hi Sharmila-

I believe the problem with your program is the way that you're constructing the digital line names. You are using the format "DevX/py/linez." The actual syntax should be "DevX/porty/linez." I was able to replicate the error and correct it by making this change.

Thanks,
Tom W
National Instruments
0 Kudos
Message 18 of 20
(2,254 Views)
The name correction certainly solved the problem.

I am stuck at the following point though. I have a digital output device configured such that I have one channel per port. Now I want to set one line in one of these ports and I can't seem to find the appropriate DAQmx Digital Write for that. The options I see are 1 Boolean, N Boolean values or (U8/U32) port value. 1 Boolean doesn't have input to specify which line to write to.

Please let me know how I can achieve this.

Thank you,
Sharmila
0 Kudos
Message 19 of 20
(2,235 Views)
Hi csi-

It will be necessary to specify "One Channel for Each Line" if you want to operate on one line at a time. Also, keep in mind that the syntax for physical channel in this case will be "DevX/portY/lineZ" where X, Y, and Z will be replaced with the appropriate values.

Thanks,
Tom W
National Instruments
0 Kudos
Message 20 of 20
(2,221 Views)