LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i enter multiple channels using the DAQmx AI Voltage VI

i'm trying to write a programme that allows me to enter multiple channels to acquire different waveform voltages, at the moment i am using the Daqmx AI voltage VI but this only allows for one input, how do i change it to allow it to accept multiple inputs or do i need to use a different VI and if so which one? i've attached the current programme i'm working with
0 Kudos
Message 1 of 9
(4,644 Views)
to read multiple channels, example channels 0 to 5, device number Dev 1

use the synatx for physical channels :

Dev1/ai0:5
0 Kudos
Message 2 of 9
(4,640 Views)
thank you very much for your reply, i can't believe i spent so much time trying to figure out something so simple!!

maybe you can help me in another matter, the programme curently writes the data to a file, however, it only writes the last X amount of samples once the stop button has been hit. how do i allow it to write the total number of samples from the start to the finish?
0 Kudos
Message 3 of 9
(4,627 Views)
This is from NI's DAQmx Help (under key NI-DAQmx concepts\physical channel syntax) in case you need more information on the channel syntax.
-Dave




Physical Channel Syntax
Use this syntax to refer to physical channels and groups of physical channels in NI-DAQmx.

Physical Channel Names
Physical channel names consist of a device identifier and a slash (/) followed by a channel identifier. For example, if the physical channel is Dev0/ai1, the device identifier is Dev0, and the channel identifier is ai1. MAX assigns device identifiers to devices in the order they are installed in the system, such as Dev0 and Dev1. You also can assign arbitrary device identifiers with MAX.

For analog I/O and counter I/O, channel identifiers combine the type of the channel, such as analog input (ai), analog output (ao), and counter (ctr), with a channel number such as the following:

ai1

ctr0

For digital I/O, channel identifiers specify a port, which includes all lines within a port:

port0

Or, the channel identifier can specify a line within a port:

port0/line1

All lines have a unique identifier. Therefore, you can use lines without specifying which port they belong to. For example, line31—is equivalent to port3/line7 on a device with four 8-bit ports.

Physical Channel Ranges
To specify a range of physical channels, use a colon between two channel numbers or two physical channel names:

Dev0/ai0:4

Dev0/ai0:Dev0/ai4

For digital I/O, you can specify a range of ports with a colon between two port numbers:

Dev0/port0:1

You also can specify a range of lines:

Dev0/port0/line0:4

Dev0/line0:31

You can specify channel ranges in reverse order:

Dev0/ai4:0

Dev0/ai4:Dev0/ai0

Dev0/port1/line3:0

Physical Channel Lists
Use commas to separate physical channel names and ranges in a list as follows:

Dev0/ai0, Dev1/ai0:3, Dev1/ai6

Dev0/port0, Dev0/port1/line0:2




See Also

E Series Physical Channels

E Series Internal Channels
0 Kudos
Message 4 of 9
(4,623 Views)
I am not sure how your data are being saved. But I will assume the Array-to-spread-sheet.vi is used to save data.
One of the terminals can be set to append, meaning each time data are saved, it will append to the existing file if it exists. This value has to be set to append.

If your data set is relatively small, data can be appended to an array, and at the end of data collection, it can be saved (save once only)

Or, append data to an array, and once in a while save data, and empy the array, append again, .... etc. The idea is not to create large arrays

If you are collecting large amount of data (like the case of high scan rate), save data after each read, with the append option set of the vi.
0 Kudos
Message 5 of 9
(4,622 Views)
Hi Ru,

I assume that you have the channel syntax sorted out from the other posts. I have looked at the example program you posted, the behavior you are seeing is simply because you have the write LVM file express VI outside of the while loop. The only data that will be passed to it will be the last set of values you acquired and passed to the tunnel on the while loop.

In order to correct this simply place the express VI inside the while loop. However be aware that the file size could get large as the acquisition is continuous.

Kind Regards

Tristan
Applications Engineer
National Instruments UK & Ireland
www.ni.com/uk
0 Kudos
Message 6 of 9
(4,610 Views)
i've tried that before, but what happens is that every time the while loop is run the previous data gets written over, is there another way to write the data to a file? thanks for the help
0 Kudos
Message 7 of 9
(4,608 Views)
Ru,

Inside the Express VI ypu will also need to set the "append to file" option, this will prevent the data from being overwritten.

Regards

Tristan
Applications Engineer
National Instruments UK & Ireland
www.ni.com/uk
0 Kudos
Message 8 of 9
(4,604 Views)
again, something so simple....thanks a million
0 Kudos
Message 9 of 9
(4,596 Views)