LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

duty cycle

Hi all,
 
I am trying to use USB 6009 to control a stepper motor. I am trying to supply a pulse to the motor through the analog output of the device on labview. It has come to my attention that this DAQ does not have a clock or a counter to produce a pulse so i am trying to do that  now using software timing. I need this pulse to have a duty cycle higher than 50% to give the motor time to respond to the rising edge of the pulse and consequently move. How do you do that on LabView?
I am completely new to Labview so any ideas or any example VI's would be much appreciated.
 
Thank you
 
Myriam
0 Kudos
Message 1 of 10
(4,366 Views)
Hi Myriam,
 
Here is some information about performing continuous analog output with a USB 6009 device,
 
There is an example vi referenced in this, which will show you how to set this up, you can find this in the example finder under 'Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage>>Gen Mult Volt Updates-SW Timed'. To get your pulses, you'll just need to generate the correct waveform for the output. Take a look at the simulate signal express vi to generate a square wave which you could use.
 
I hope this helps
Regards
Hannah
NIUK & Ireland
0 Kudos
Message 2 of 10
(4,334 Views)

Thank you hannah for your help. Where do i get the simulate express vi from? and i am also trying to produce the pulse now by swithcing a digital line on and off continuously using a while loop for the USb 6009. but i am a total and complete beginner in Labview, so is it possible to send me an example of how you can do that on Labview (an example VI)?

 

Thank you for your help,

 

Myriam

0 Kudos
Message 3 of 10
(4,314 Views)
Hi Myriam,
 
Please see the attached vi for an example of switching a digital line on and off. I've put some comments in so you can see how it works.
 
The simulate signal express vi can be found on the following palette "Express>>Input"
 
Hope this helps
Hannah
NIUK & Ireland
0 Kudos
Message 4 of 10
(4,290 Views)
Hi Hannah,
 
Sorry to be such a pain but is it possible to send the file again. Whenever I open it it does not go beyond the first window where it asks you to either create new, open, configure or help.
I am using Labview 7.1. Could it be a difference in versions?
 
Sorry again and thanks a lot for your help.
 
Myriam
0 Kudos
Message 5 of 10
(4,276 Views)

Hi Myriam,

Here's the vi in version 7.1 of LabVIEW.

Good Luck

Hannah
NIUK & Ireland

0 Kudos
Message 6 of 10
(4,254 Views)
Hannah,
 
Thank you very much for your vi. It helped me to understand this a lot better. The problem now is that the frequency that it produces is very low (too low to run my stepper motor). The motor operates at a frequency of 100 Hz. What is the frequency of the digital line on the USB 6009?  Is there any way of adjusting the frequency of the pulse in the VI that you send me other than changing the timing (different from 100ms)?
Also is it possible to use the Write Dig Port. vi to get the pulse using software timing like in Gen Mult Volt Updates SW. Vi? I tried that but the DAQwrite to port vi would not take any arrays (arrays with the 0 and 1 pulses like for the analog output). Is there any way round that if it is possible at all?
 
Thank you very much in advnace of your help
 
Regards,
 
Myriam
0 Kudos
Message 7 of 10
(4,234 Views)

Hi Myriam,

Changing the wait time is the only way to change the timing in the vi I sent you (so the time between each value change).

As for the WriteDigPort example, you can modify this to write multiple samples by changing the polymoprhic selector to read 'Digital 1D U16 1 Chan 1 Samp' by selecting the polymorphic selector and navigating to 'Digital>>Single Channel>>Multiple Samples>>1D U16 (port format)'

This will allow you to write an array of data (you'll have to change the front panel control to an array first).

Hope this helps

Hannah
NIUK & Ireland

0 Kudos
Message 8 of 10
(4,204 Views)

Hi Hannah

Thanks a lot for your help. I am trying to use the shift register now to generate a pulse on a digital line but the output is very slow. Is there anyway of making this quicker? I have three main questions about this:

1- Can I use the onboard counter on the USB 6009 to generate the pulse instead?

2- If i use the digital line would a pull up resistor connected in series make it go quicker?

3- is it possible to use software timing to write the pulse to a digital line? I can use the analog one (Gen MultVolt Updates-SW TIMED.vi) to prodcue the pulse at the frequency i want on an analog output. Is there  no way of doing the same thing on a digital line?

I need to get the pulse at a frequency of at elast 100 Hz to operate a stepper motor so is there no way of producing a pulse of a quicker frequency using the USB 6009?

 

Thank you in advance for your help

 

Regarrds,

 

Myriam

Message 9 of 10
(4,171 Views)
Hi Myriam
 
To answer your questions:
 
1. The counter on the USB-6009 can only do event counting so you won't be able to generate your pulse on that channel.
 
2. Using a pullup resistor with the digital line may make a difference to your transition times but I that isn't the limiting factor in this case.
 
3. You are using software timing to write values to the digital line. As these lines have no timing hardware whatsoever, software timing is the only type of timing you can use with them. Because it is software timed, you're limited by the speed of your operating system. Windows will only reliably give you timing of about 50ms (approx) which is only 20Hz. You could try using a timed loop which may be slightly more accurate then a while loop with a wait function. The best way to get accurate timing of at least 100Hz would be to use a device with the facility to generate hardware timed digital data. If you need a USB device your best bet would be to use a counter on one of our USB M Series.
 
Regards,
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 10 of 10
(4,142 Views)