Multiple inputs using LabJack U3 | LabJack
 

Multiple inputs using LabJack U3

19 posts / 0 new
Last post
aishwaryag27
aishwaryag27's picture
Multiple inputs using LabJack U3

Hi,

I am using LabJack U3 to obtain pressure and audio sensor data in LabVIEW. I saw the examples of using LabJack with LabVIEW. I used "U3 eAIN Loop with Chart .vi" to read pressure sensor data and "U3 Stream with FFT.vi" example to read audio sensor data. Now, I am required to combine these two to 1 labVIEW file. Is this possible?. Also, I would like to know where to set the channel number in the stream mode example. Please help me with this.

Thank you

LabJack Support
labjack support's picture
Stream takes over the analog

Stream takes over the analog input system, so while streaming you can't use command-response to read your pressure AIN.  Rather, you will have to add the pressure sensor to your stream scan list and acquire it with the audio signal.  See the following about command-response and stream mode:

https://labjack.com/support/datasheets/u3/operation

"Scan List (+)" is the list of positive channels you are going to scan in that stream example.  See the following for details about the UD driver handles stream mode:

https://labjack.com/support/datasheets/u3/high-level-driver/example-pseu...

aishwaryag27
aishwaryag27's picture
Thank you for your response.

Thank you for your response. But, can't I use these both as 2 seperate sub vi's and bring them together as 1 labVIEW program?

LabJack Support
labjack support's picture
No.  Try it now.  Start the

No.  Try it now.  Start the stream example and leave it running.  Then go to the eAIN loop example and try running it at the same time.  I would expect an error.

aishwaryag27
aishwaryag27's picture
Hi, as you said, I couldn't

Hi, as you said, I couldn't run stream and command response mode simultaneously. It gives me a communication error.

aishwaryag27
aishwaryag27's picture
Also, I am looking to read 6

Also, I am looking to read 6 sensors' values in stream mode using scan list + in labVIEW. I would give AIN0-AIN3 as channels 0-3 in scan list +. For FIO4 and FIO5, should I give them as channel 4 and 5 respectively or is there a seperate procedure for FIOs. And what is the use of scan list -  ?. 

LabJack Support
labjack support's picture
Use channel 193:

Use channel 193:

https://labjack.com/support/datasheets/u3/operation/stream-mode/digital-...

ScanList- is specifying the negative channels, which is usually used with differential AIN:

https://labjack.com/support/datasheets/u3/hardware-description/ain/chann...

Use Ch- = 199 for single-ended channels.  Ch- does not matter for Ch+ = 193.

aishwaryag27
aishwaryag27's picture
Hi,

Hi,

I tried reading voltage from 6 channels (AIN0-AIN3,FIO4-FIO5) in stream mode by adding the channels to scan list+. I used the U3 Stream with FFT.vi example. But, it doesn't allow me to read more than 3 channels. Is there a way to achieve this?. Please let me know.

LabJack Support
labjack support's picture
What do you mean by "it doesn

What do you mean by "it doesn't allow me to read more than 3 channels"?  Are you getting an error?  Please post a screenshot showing the problem.

aishwaryag27
aishwaryag27's picture
Thank you. I am really new

Thank you. I am really new with this. I couldn't understand completely. It would be helpful if you could send a screenshot or a program describing the procedure.

LabJack Support
labjack support's picture
If you are having some

If you are having some problem with the example, please post a screenshot showing the problem.

Perhaps start with a simpler example such as "U3 easy Stream Example.vi".

aishwaryag27
aishwaryag27's picture
It might be because of the

It might be because of the scan rate too. I am required to set the scan rate to 20000 Hz. I have attached the screenshot for your reference.

File Attachment: 
LabJack Support
labjack support's picture
In your screenshot you are

In your screenshot you are attempting to scan 6 analog inputs (AIN0-AIN5) at 20 kscans/second.  That is 120 ksamples/second which is too fast:

https://labjack.com/support/datasheets/u3/operation/stream-mode

aishwaryag27
aishwaryag27's picture
Should I reduce my scan rate?

Should I reduce my scan rate?.

And I would like to know if I have entered the channel numbers correctly  ( for AIN0-AIN3, FIO4,FIO5) in scan list+ ?

LabJack Support
labjack support's picture
Yes, you need to keep

Yes, you need to keep NumChannels*ScanRate to <=50k.  See post #13 above.

No, you have entered the channel numbers for AIN0-AIN5.  See post #7 above.

aishwaryag27
aishwaryag27's picture
I kept the scan rate as 10000

I kept the scan rate as 10000 and gave the same channel list and I was able to get the values. Is it like it won't work for a long run?

LabJack Support
labjack support's picture
5 channels at 10 kscans

5 channels at 10 kscans/second is 50 ksamples/second, so that is fine.  That is the limit, but should run continuously.

aishwaryag27
aishwaryag27's picture
Not 5 channels. I have used 6

Not 5 channels. I have used 6 channels. AIN0-AIN3, FIO4,FIO5. But it is still working with scan rate of 10000 Hz and the channel list as given in the screenshot.

LabJack Support
labjack support's picture
Okay, but again channels 4

Okay, but again channels 4 and 5 are AIN4 and AIN5, not FIO4 and FIO5.  See post #7 above.

If you are acquiring 6 channels at 10 kscans/second, that is 60 ksamples/second.  The spec is 50k, but 60k might work fine.  I would tweak your scan rate up to find the actual limit where you start to get overlap errors, then back off by 5% or so.