LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 USB devices

Solved!
Go to solution

Hi

 

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.

 

Thanks

 

 

0 Kudos
Message 1 of 7
(2,942 Views)

Post your code, preferably saved in LabVIEW version 2012 or earlier.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 7
(2,921 Views)

Post your code, preferably saved in LabVIEW version 2012 or earlier.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 3 of 7
(2,921 Views)

Hi tone5,

 

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.

 

Best Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 4 of 7
(2,879 Views)

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.

 

Thanks

0 Kudos
Message 5 of 7
(2,878 Views)
Solution
Accepted by topic author tone5

Hi,

 

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.

 

Best Regards,

 

Chris

National Instruments - Tech Support
Message 6 of 7
(2,868 Views)

Thanks Chris

 

Those sound like good suggestions. I'll give them a try over the next few days.

 

Cheers 

0 Kudos
Message 7 of 7
(2,834 Views)