From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usb6009 dc generation

Hi,

 

I'm trying to generate DC using usb6009 which would power the device connected to its output for 1 - 10 seconds
(in the meantime I should measure voltage on the AI) and than generate new value of voltage  (one step higher).
My question is: would my code work? I have no oscilloscope to check the output. Connecting AO to AI gives satisfactory results however I am not sure if it would work
Sorry for questioning about some base problems however I have never programmed and I lack in general knowledge.
My concern is if the generated voltage would stay on the same level till the next iteration or would it go back to 0 or default. I was not able to configure in MAX any output mode but Sample on demand (continuous, N samples, produce error, hardware timing does not work as the usb6009 does not support inner triggering (is that correct btw?))

I have also tried to make the same thing with State MAchine however it seems that it would not work as the task will end anyway after the stae passes to another.
<the first code attached - under concern is case 10 (the other ones are to be modified anyway)>

 

Thank you in advance

Download All
0 Kudos
Message 1 of 7
(2,202 Views)

First thing you need to understand how the data acquisition works.

 

1. Since you have already created a task you can just read/write the values without stopping it until your whole software is executed.

 

2. When you send a command (Voltage) through the AO/DO logically it will be staying at the same value until the new value is written (I had the same confusion but still not tested it)

 

3. Finally you have to look into the LabVIEW examples where you can find lot of examples that uses DAQ.


@rotstocksonne wrote:

My question is: would my code work?


 

Even if are able to achive what you expect its not the right way to continue with the way you coded it so better take the example and use it.

good luck.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 7
(2,200 Views)

You also asked about powering an external device.  The Analog Outputs can only source a few milliamperes. That probably will not be neough to power your device.

 

Post more about your device and perhaps we can offer some suggestions.

 

Lynn

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

funny as it may sound but.. I do not know the device yet
however it does not matter for the time being. It should not be the problem to amplify the output voltage
(as well as to decrease the input voltage so that the usb is not damaged)
my real problem is to deal with LV which I am now struggling with since the manuals do not answer all my questions ...
The problem with powering the external device was whether the usb puts out only one sample (pulse) or holds it till next value is set by thefollowing iteration. The voltage that I set should hold for some time to become stable so that man can take the measurment of the voltagewhich is ananswer for the set voltage.
(sorry... i guess it is king of basics however I am fighting with manuals but no explicite answer is given and I still feel like a child lost in a fog, which is embarrasing...
Thanks a lot for help

0 Kudos
Message 4 of 7
(2,182 Views)

Don't be embarassed!

 

(you should see the first vi I ever wrote) The manuals are not enough!  dig into the example finder and see how its been done.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(2,180 Views)

With the USB-6009 the output voltage is maintained until changed by the software or until the device power is turned off.  This is also true of the digital outputs.  These outputs are called "software timed" and only change when a new value is written to the device by the software.

 

Jeff gave you good advice.  Start with examples.  Make copies of them with new names and then modify them.  Write little test VIs to see how things work.  Many, perhpas most, experienced LV developers still do those things regularly when we need to do something different from what we have done before.

 

Lynn

0 Kudos
Message 6 of 7
(2,178 Views)

thank you all!

 

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