LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage output of an impulse/square wave using DAQmx Base and USB 6009

Howdy,
What i'm trying to do is.... use my USB6009 to generate an impulse or square wave voltage output (from AO0). This 5V output is recieved by a Servo Amp to produce a corresponding 12V signal with the same characteristics. So it's basically an amplifies of the voltage level. This 12V signal needs to run a DC motor with a solenoid and ratched setup (basic stepper motor). Once this signal has been recieved and the stepper motor moves to the next positon I need to aquire analoge data for about 30 seconds and then start the cycle again. Make sense?
 
So my problem is that
1) i can only get a sine wave which is not good for precise voltage inputs to the stepper motor (makes it sluggish in parts since the motor will click over as soon as enough voltage is supplied... which means i would like the signal to be as sharp as possible)
2) I'm not all that good at programing (not without lack of trying) and i can't seem to get the loop (while loop) to execute the voltage output then signal input in a continuous cycle or at least for a designated number of measurements. I've taken the example Gen Mult Volt Updates-SW Timed.vi and tried to modify it but without luck
 
If anyone out there can help (especially with the coding!) that would be great. I'm sure it's not to difficult, I just cant seem to work it out.
 
Cheers,
Sarah.
 
0 Kudos
Message 1 of 4
(4,368 Views)
If you are using Gen Mult Volt Updates-SW Timed.vi, what is the data array you are providing? Did you replace the existing one? The existing one is a sine wave as explained on the block diagram. The 6009 has a very slow AO rate but I would think that just switching from 0 to 5 volts wouldn't present a problem at all. For that matter, you could also use one of the digital outputs to provide the signal. Whichever one you use though, your update rate is going to be slow. The update rate for analog out is 150 Samples/sec and I think the digital out is about the same. If you need  pulses of shorted duration or better resolution, you'll have to find a different board.
0 Kudos
Message 2 of 4
(4,355 Views)

Hi Dennis, thanks for your reply.

The Data Array i'm using is the one that was given in the example. I've had a look at the Properties but I can't see a way to change the parameters to impulse or square wave or even change the frequence or amplitude.

As far as timing goes I am looking for the pulse to output about every 30 seconds or so (0.0333 Hz). Which is not at all a problem, the problem is getting the voltage to switch the mechanical solenoid and then have the device take some simple reading for about 30 seconds and then shoot off another voltage output to switch the solenoid to the next position and continue in this way for a certain number of cycles.

If anyone out there has an example program that i could work off that would be fantastic.

 

0 Kudos
Message 3 of 4
(4,341 Views)
 

Replace the data array with something you create. Each time the loop iterates, it takes a value out of the array and passes it to the DAQmx Write as the output voltage. Since the array contains a sine wave, that is what you are seeing on the output. Drag the side of the numeric control inside of array container to see the whole numbers that are in the array. All that you want in your array are 0.0 and 5.0. Creating an array constant and array indexing are pretty basic tasks in LabVIEW, you might want to go to http://zone.ni.com/devzone/cda/tut/p/id/5054  and click on the Getting Started with LabVIEW link. Information on courses can be found at https://www.ni.com/en/shop/services/education-services/labview-courses.html.

0 Kudos
Message 4 of 4
(4,338 Views)