LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Channels not recognized

I'm generating a VI to read two inputs from two channels. I've created two DAQ Aquisition blocks. One is set to channel 0, the other to 2. But when I run the program, the second channel (which should remain 2) get reset back to 0, and I endup reading the same thing in twice from channel 0. I can't seem to keep it from reverting back to channel 0. Any suggestions?

I'm using LabVIEW 8.0, and a LabJack U12 to collect the data. I'm using two analog inputs to measure voltage from two accelerometers.
0 Kudos
Message 1 of 8
(3,504 Views)

Hi,

Your Sub VI "EAnalogin.VI " is missing, so i am not sure how exactly you are acquiring in 2 loops.

from what i can see, you are running the same sub VI in both the loops.

Hence the " and I endup reading the same thing in twice from channel 0" problem Smiley Wink

Attach this VI and we can suggest a better alternative

Regards

Dev

 

0 Kudos
Message 2 of 8
(3,475 Views)
You will need the LabJack VI library to use the program. At least, I think that's how you can make it work. You can download the labjack VIs at http://www.labjack.com/files/U12SetupV118f.exe

0 Kudos
Message 3 of 8
(3,471 Views)
Hello SoLost,

I think the problem might be caused by the fact that the EAnalogIn.vi not being set to reentrant.  If the subVI is not set to reentrant, only one instance of that subVI is created in memory, and every time the subVI is called from your program, it accesses that same subVI.  By setting a subVI to reentrant, a unique instance of that subVI is created in memory everytime the subVI is called from your top-level program.  This allows each instance of the subVI to execute independently so as not interfere with each other.  You can change a subVI to have reentrant execution by opening the front panel of the VI, going to File >> Execution and selecting reentrant execution.  Make sure to save the VI after you make this change.  Let us know if that fixes the problem.

Regards,
Travis Gorkin
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 4 of 8
(3,466 Views)
Thanks for the reply! I tried the Reentrant Execution option as suggested, but it still continues to do the same thing. The 'reentrant execution' check box was simply checked for both  VIs, and both imitated each other.

I have noticed several things: In the window box next to where it usual says something like 'front panel', it says: EAnalogIn.vi:X  (clone), where the X pertains to which number of analog icon is selected. Also, when I bring up the control box for the VI, it's in run mode. I can bring up edit mode (with the grid pattern on the grey background), and if I change setting there, they seem to stick, but it does not affect what happens in run mode. Also, the chanes still seem to occur for both VIs simulataneously. Any more help would be greatly appreciated, thanks.
0 Kudos
Message 5 of 8
(3,466 Views)
I suppose I would ask if this is even supported using the LabJack drivers. Do the driver VIs support separate calls to the same board? For instance, with NI's data acquisition drivers, you can only setup one analog daq session at a time for a given board, but that session can acquire from multiple channels. Maybe their drivers are similar. The LabJack drivers come with pdf documents and examples, so I would check there first and get back to us.
Jarrod S.
National Instruments
0 Kudos
Message 6 of 8
(3,445 Views)
Hello SoLost,

In your Voltage_measure.vi, you do not have any data wired to the channel input of the EAnalogIn subVI.  Are you trying to set the channel to acquire from internally within the subVI?  It would probably be better to just wire the appropriate value to the 'Channel' input of that subVI from the block diagram of the top-level VI, rather than trying to specify the channel value on the actual front panel of the subVI.  Just a suggestion that I missed during my first glance at your program.  Let us know if that solves the problem.

Regards,
Travis G.

Message 7 of 8
(3,438 Views)
I think that did it! I did as you said, I input a constant value into the channel input of the VI. So far so good. Guess it's just a matter of time to see what other complications come up. Thanks for your help!
0 Kudos
Message 8 of 8
(3,428 Views)