LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

1. Connect Your outputs and inputs the following way:

ao0 >> 10 kOhms >> ai0

ao1 >> 10 kOhms >> ai1

2. Build and run the block diagram attached

3. What values do You see in "1,5 Volts" and "3 Volts" indicators?

 

Regards.

0 Kudos
Message 21 of 32
(1,450 Views)

Thank you Terra Nova!

 

Thank you Ravens Fan! Can you clear me the fact?

 

f we select the channels PXI1Slot4/ai1:2? or PXI1Slot4/ai3:4? This means two channels are slected so if I have to select 5 channels I write PXI1Slot4/ai1:2:3:4:5 or If I choose channels 2, 5, 6 how can I write?If I have 50 channels to select? Do I have to write again and again?

Similarly, what is the configuration for ports? PXI1Slot4port0:7 means all lines of port0 are selected?But what about choosing some selected lines on port? 

0 Kudos
Message 22 of 32
(1,421 Views)

 


@KRAZE4LV wrote:

 

f we select the channels PXI1Slot4/ai1:2? or PXI1Slot4/ai3:4? This means two channels are slected so if I have to select 5 channels I write PXI1Slot4/ai1:2:3:4:5 or If I choose channels 2, 5, 6 how can I write?If I have 50 channels to select? Do I have to write again and again?

Similarly, what is the configuration for ports? PXI1Slot4port0:7 means all lines of port0 are selected?But what about choosing some selected lines on port? 


 

DAQmx Help Chapter:


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 Dev1/ai1, the device identifier is Dev1, 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:

Dev1/ai0:4

Dev1/ai0: Dev1/ai4

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

Dev1/port0:1

You also can specify a range of lines:

Dev1/port0/line0:4

Dev1/line0:31

You can specify channel ranges in reverse order:

Dev1/ai4:0

Dev1/ai4: Dev1/ai0

Dev1/port1/line3:0

Physical Channel Lists

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

Dev1/ai0, Dev1/ai3:6

Dev1/port0, Dev1/port1/line0:2

 

 

Message 23 of 32
(1,417 Views)

Thank you Terra Nova!

 

I want to use N Channel N Sample or N Channel 1 Sample, Instead of using 2D array or 1D array I want to use basic numeric control or indicator/ or boolean.

I do not want arrays/clusters on front panel. I tried to design the VI but I am unable to do the same for indicators. Please see the VI and modify the same. 

0 Kudos
Message 24 of 32
(1,401 Views)

Then again:

1. Connect Your outputs and inputs the following way:

ao0 >> 10 kOhms >> ai0

ao1 >> 10 kOhms >> ai1

2. Build and run the block diagram attached.

 

Regards.

Message 25 of 32
(1,394 Views)

Thank you! my VI is working well now.

how can I know the sampling rate of the VI I have developed??

generally sampling rate is the number of samples/ time and we can identify the sampling frequency,But I didnt use any time factor/sample clock except the wait until next to 100ms.

As I set the value it is automatically read at the indicator.

I am using one sample per channel.  how can I calculate the sampling rate/frequency of the VI I have developed?

0 Kudos
Message 26 of 32
(1,369 Views)

In my VI in order to calculate the sampling frequency:

1. number of samples per channel: 1

2. Time:?       wait until next : 100ms

3. Voltage

  Min:-5V

  Max.:+5V

4. set value: changeable

sampling frequency:?what is factor affecting the sampling frequency?sampling rate of the DAQ 6251 is 1.25MS/s

0 Kudos
Message 27 of 32
(1,354 Views)

Your sample rate is no less than 100 msec but could be much longer since you are not using timed I/O. Single sampling is software timed and is subject to a large amount of jitter because of the OS. It's really not an appropriate question for the way you are doing the acquisition. You might as well be using a random number generator to determine the rate.

 

And please clean up your block diagram. Neatness does count.

Message 28 of 32
(1,351 Views)

Thank you for the suggestion. I will clean-up the Block Diagram in the VI.

But I am also confused sampling frequency =number of samples per channel / seconds. Yes it seems lil strange without timing clock, I need to know the sampling frequency?

So as per the VI I have developed the set value is immeditely read in output indicator. So if you say it is software timed (T) how much millisecond?

if number of samples=1, because I am setting one value at a time.or if 1000values?

1/T

If I use 100ms which I have taken up for the wait function, it is just kept in the loop to show the number of times to iterated? 

Should I use 1/100msec or 1/T?What is T?

0 Kudos
Message 29 of 32
(1,342 Views)

Sorry for last message!!!!!!!!!!!!!i understood the concept. Thanks to Dennis!

0 Kudos
Message 30 of 32
(1,338 Views)