I need to run 2 USB devices to acquire a voltage and output a voltage. I'm using a USB-6000 to acquire a 0-10V signal and a NI 9263 (with NI USB-9162 carrier) to outup a voltage. The output need to accurately replicate a sine wave up to 150Hz. The input just need to respond to a user turning a dial (a response time of 200ms would be fine)
I have created seperate applications for each of these devices and managed to get these to run as I want. However when I try to combine the code into a single vi the speed of of the resulting application is much slower (I get about 1 iteration per second in the vi's main while loop).
Is there any reason these 2 devices should not work together in a single application a the sort of speed I require?
If required can send a copy of the vi I have created. I am a Labview newbie so it's likely that the problem is that my program is inefficient.
Solved! Go to Solution.
As moderator has posted, it would be helpful to see your code. If you are running two hardware timed tasks in one loop then you will likely run into timing conflicts which could cause the slow behaviour. I would recommend switching to two loops and passing data with queues as seen in this example.
If your application does not need the input and output to be linked then you can use separate loops without passsing data between the two.
Code attached, saved in version 2012. I could not attach all the sub vi's as well, but hopefully you'll be able to see what I have tried (and see where I've gone wrong).
Basically, I have a 0-10V signal from a circuit. The user manually controls this signal with a potentiometer.
I would like to Labview to read this signal (using the USB-6000) and use it as an the frequency input to "Basic Function Generator.vi". So, as the user adjusts the potentiometer, the frequency generated by "Basic Function Generator.vi" changes.
I then need this frequency signal to be output via the NI 9263 (with NI USB-9162 carrier) to drive an external device. The maximum frequency required is about 150Hz.
How are you timing the input task? Unless both input and output tasks are using the same clock and the same sample rate then you will see strange timing behaviour. Especially when you are programmatically modifying the frequency with property nodes.