LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading and visualising multiple voltage signals simultaneously 6001 USB nidaq

Solved!
Go to solution

Hi Labview experts!

 

I have the following problem: the attached code switches periodically on and off a group of laser diodes and detects/records their signals passing though four optical fibre bobbins. It basically works as I log one signal at a time but as I try with more than one simultaneously, I detect and visualise the nth with an additional offset on the wave graph chart. Could anyone please advise?

 

  

 

0 Kudos
Message 1 of 7
(1,584 Views)

I point out that by carrying out the measurement with a code based on the use of the DAQ assistant I succeed to visualise and read simultaneously multiple signals (in the uploaded example I have two signals).  In this case, signals are read by input ports 0 and 7 (and both are grounded). As I try to do the same thing with the code above I get the 2nd signal with an extra offset of 0.3 V. Where am I wrong?

 

0 Kudos
Message 2 of 7
(1,573 Views)

Can anyone please advise me?

0 Kudos
Message 3 of 7
(1,496 Views)

So in the "working" VI, you use Referenced Single Ended physical connections.

In the first VI, you don't specify the "input terminal configuration".

This means you'll get the default.

 

From the detailed help:

NI 60xx (E Series), NI 62xx (M Series), NI 63xx (X Series), NI ELVIS II, NI PCI-6010, NI USB-6001, NI USB-6002, NI USB-6003, NI USB-6008, NI USB-6009, and NI TC01 For devices with eight channels: differential for the first four channels, referenced single-ended for the next four channels. For devices with 16 channels or more: differential for eight channels followed by referenced single-ended for eight channels. For instance, channels 0-7, 16-23, and 32-39 are differential. Channels 8-15, 24-31, and 40-47 are referenced-single ended.

 

The USB-6001 has 8 channels, so channels 0-3 are differential by default.

If you want to use RSE, then you need to specify this at the DAQmx Create Virtual Channel node.

 

As follow-on notes, if you're going to use DAQmx rather than DAQ Assistant (generally a good choice to do so), then you shouldn't go back to using the Dynamic Data Type (DDT, the thick blue wires).

You can split an array of waveforms using Index Array, and removing the DDT wires will remove a lot of opportunities for unexpected and difficult to "immediately see" bugs.

Beyond that, you're carrying out the same operation on each of your 4 channels - you could replace your separate Offset <N> (and perhaps Reader <N>) controls/indicators with arrays, and then directly process (perhaps with a for loop).

The operation you're carrying out can be done using Mean.vi (or Add Array Elements, rather than the For loops).

If you're autoindexing a For loop (the [ ] marks on the input tunnel) then you don't usually need to also wire N, in this case it makes no difference (and in some cases it produces undesired behaviour - a For loop will execute until the first stop condition is reached - so the shortest autoindexed array, or N, even if other conditions are 'larger').


GCentral
0 Kudos
Message 4 of 7
(1,489 Views)
Solution
Accepted by topic author nicop92

Here's a version with a somewhat tidied top loop. I didn't change any of the functionality except by moving the controls/indicators into arrays as I mentioned in the previous post, and setting the configuration to RSE.

 

Note that although I could have the Offsets be autoindexed, that could give an unexpected behaviour if there are fewer than 4 offsets set (for 4 input channels).

That's because then the For loop would iterate fewer times (shortest autoindexed array) and the output would only be a subset of the input waveforms.

With this code (manually Indexing the Offsets array) you get an offset of 0 by default.

cbutcher_0-1617154935651.png

 

You could also change the Waveform Graph displays and put them all on one graph, if you wanted...


GCentral
0 Kudos
Message 5 of 7
(1,483 Views)

Thank you cbutcher!

 

Very clear!

I'll try it out and let you know!

0 Kudos
Message 6 of 7
(1,465 Views)

 

 

 

0 Kudos
Message 7 of 7
(1,434 Views)