LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separate daqmx setup for each analog input in two subvis

Hi Guys,

 

I was just wondering if it is possible to open analog channels separately in two subvi's that are running in parallel in main vi loop? I know that analog inputs are multiplexed and such. I am going to try it nonetheless, even though it is a big program that I have to modify.

 

Currently, I have all the analog channels setup in one of the two subvi's; The required information is passed to the second subvi by reference. Any help or suggestion in program modification would be appreciated with KUDOS... 🙂

 

Vj

I may not be perfect, but I'm all I got!
0 Kudos
Message 1 of 13
(3,193 Views)

Hello VJ,

 

From looking at your post, it looks like you want to configure two separate analog channels in different subVIs and this can be done. The only thing both subVIs will need is the reference to the Task because you can't create multiple Analog Input tasks on one DAQ card. Other than that you should be okay.


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 13
(3,157 Views)

HI Jim,

 

I was wondering if you could be more specific or provide some examples. Thanks!

I may not be perfect, but I'm all I got!
0 Kudos
Message 3 of 13
(3,136 Views)

Hi VeeJay,

 

Here's what Jim was talking about. May I ask what kind of analog input channels you're adding and why they're in separate subVIs? There may be an easier way to do this.

 

Forum1316877.png

 

Best,

 

Sean F.

Sean Ferguson
Application Engineering Specialist | RF and Reconfigurable Test
0 Kudos
Message 4 of 13
(3,112 Views)

Hi Sean,

 

I am using 3 differential analog inputs and measuring Voltages. I have two systems, elevation and speed. I have two subvi's because one system is independent of the other; except for the analog inputs. Since both require analog input voltage measurements to calculate parameters, I have to create task in one subvi and pass the value acquired to the other subvi. I wish i could just create separate tasks in both  subvi's but USB 6008 limits me from doing that.

 

VJ

I may not be perfect, but I'm all I got!
0 Kudos
Message 5 of 13
(3,104 Views)

Im pretty sure you cant use that "samples clock" with the USB-6008?

 

Alan

0 Kudos
Message 6 of 13
(3,097 Views)

Howdy VeeJay!

 

Are you performing single point acquisition or are using using a hardware timed continuous acquisition task?

 

Perhaps you could use something similar to the producer/consumer architecture by having one loop which performs the acquisition for all of the channels and then splits that data up ands send it to the appropriate subVIs (running in a differnt loop) via a queue or some other method.  Just a thought.

 

Regards,

Barron
Applications Engineering
National Instruments
0 Kudos
Message 7 of 13
(3,062 Views)

Hi Barron,

 

Please find attached my vi that shows the way I acquire analog voltage measurements from 3 channels (differential). Is this the right way of doing things? Here is where I face a problem.

 

When this acquisition vi is outside the main vi's state machine, it doesn't acquire the measurements; I don't know why. I assumed both are parallel loops and it should work.

 

When this acquisition vi is inside a state of main vi, it works and passes the values to the subvi's that require the data. But, what I notice is that the voltages read by some channels are not correct. For eg. I know ai0 should measure somewhere around 1.5V (in and around) but when the vi is running, the value reads between 1V and 2V which is causing problems in my calculations. Any help is appreciated. THanks!

 

Jay

 

P.S. Simple examples for queue method would help too 🙂 ANd, the image shows my main vi. Things are scattered around because I am trying to make this work before I spruce up. Oh yea, I am using references because I understand it so well but not sure if that is the way to go.

I may not be perfect, but I'm all I got!
Download All
0 Kudos
Message 8 of 13
(3,023 Views)

Also, how to use the sample clock for USB 6008 when three channels are read?

I may not be perfect, but I'm all I got!
0 Kudos
Message 9 of 13
(3,019 Views)

HEre is a screenshot when the program is running. The Acquisition vi is parallel to main vi state machine. But, The values read are all zeros. Why is this happening? My previous jpeg shows acquisition vi inside state of SM and the current jpeg shows it outside main and parallel.

 

 

I may not be perfect, but I'm all I got!
0 Kudos
Message 10 of 13
(3,012 Views)