LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Channel AI/AO/DI/DO with DAQ

I am unable to run my VI. I want the VI to run with 2 AI and 2 AO , 2 DI and 2 DO, as shown in the front panel.

There are no errors in the VI but when I run I want that when I put the Boolean vertical switch on the Boolean with green light should glow.

Also I want that the voltage I set with the slider can be checked at terminal board with a multi-meter.

As I have connected the wires in the terminal board on the basis on the channels I have chosen.

Please can someone modify the VI or give some suggestions.

I am using LV 2009 and DAQ 6251.

0 Kudos
Message 1 of 32
(5,632 Views)

Little updated VI is attached.

0 Kudos
Message 2 of 32
(5,624 Views)

Hi KRAZE4LV,

 

I think I may see what's causing that behavior: Your toggle switches are wired as indicators from your data and your LEDs are wired as controls for digital out.  Shouldn't it be reversed?

 

Also, in your inner while loop you are attempting to write both sliders to the same task.  You should probably only be doing one write to that task.

 

Hope this helps!

 

Chris

 

P.S. As a note, you need to join all of your error wires together with a merge error block (like you have at the end) and not use the build array boxes.

Applications Engineer
National Instruments
Message 3 of 32
(5,594 Views)

Hello,

Thanks for your reply.

I modified my program more as previosly I was using many loops which I think were making the VI more complicated.

Please see the modified VI also I added your suggestions.

But I am getting Error-200524, I checked the link in NI website Error , sometimes I get Error:200463.

I dont understand how can I solve this problem.

 

0 Kudos
Message 4 of 32
(5,581 Views)

Did you read the explanation for the error? If you have a single line in your task (i.e. Dev9/port0/line0), your Boolean array must have exactly one element in it. If you have two lines (i.e. Dev9/port0/line0:1), your Boolean array must have exactly two elements in it. Channels in Task = Channels in Data.

Message 5 of 32
(5,576 Views)

Thank you! I got rid off the error.

I understand that any array representing the data to read or write can be initialized depending on the number of channels or lines to be used.
One row of the array represents one port of digital I/O and each line is represented by one element.
But I have few questions:
1. In Analog Input/ output, one element represent one channel? If so then in my program why the analog numeric element in the array does not read second element set value? It is by default giving same value in both the numeric Analog indicator, even though I changed different value of Analog vertical slider. It reads only one value.
2. When I switch on the Digital vertical switch the LED doesn't glow?
3. Next program,  In the front panel I do not want the array format but want to control each switch independently N-channel, 1Sample? How can I do, should I make clusters?? ??

Please let me know the same.

0 Kudos
Message 6 of 32
(5,569 Views)

Hi,

See attached vi.Is this what you want?

For your questions you need to study about  task, channel, physical channel etc.

You can go through help for Daqmx or search on NI site.

I will post link if I find one, right now I do not have time to search.

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 7 of 32
(5,556 Views)

Hi,

 

Here are few links to the Tutorials for DAQmx as mentioned by Gaurav.

 

Getting Started with NI-DAQmx: Main Page

 

This one has information about programming with NI DAQmx including building Analog Output or Analog Input VI: Getting Started with NI-DAQmx: Getting Started with NI-DAQmx Programming in LabVIEW

This one will be most helpful to get your started with all the DAQmx functions:  Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

 

I hope this helps!

 

Kim W.

Applications Engineer
National Instruments
0 Kudos
Message 8 of 32
(5,545 Views)

Thank you for the links. I studied from the links which helped alot. But still I have question:

In my program I am using NsamplesNChannel Analog type, data-type is 2d Array on front panel, 1 row represents one channel when I use two channels, the indicator array of read DAQ only reads one value.

In my program now I can switch on/off with LED blinking, but I am unable to add the DI channels.

I do not want to use waveform or array in front panel, want to use Nchannel, Nsample for Digital and analog? Is there anyway? I can see each switches independantly.

Pls let me knw.

 

0 Kudos
Message 9 of 32
(5,530 Views)
0 Kudos
Message 10 of 32
(5,529 Views)