11-17-2010 12:53 PM
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
11-18-2010 03:18 PM
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.
11-19-2010 01:15 PM
HI Jim,
I was wondering if you could be more specific or provide some examples. Thanks!
11-22-2010 12:30 PM
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.
Best,
Sean F.
11-22-2010 01:02 PM
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
11-22-2010 01:14 PM
Im pretty sure you cant use that "samples clock" with the USB-6008?
Alan
11-23-2010 06:39 PM
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,
12-02-2010 08:06 AM
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.
12-02-2010 08:12 AM
Also, how to use the sample clock for USB 6008 when three channels are read?
12-02-2010 09:37 AM - edited 12-02-2010 09:39 AM
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.