05-17-2005
11:51 AM
- last edited on
08-10-2026
01:16 PM
by
Content Cleaner
Hi,
I'm using a 6025E DAQ on a Windows 2000 system with Labview 7.0 to control a stepper motor. To control the motor I am using a counter implementation to generate a continuous pulse train with varying frequency. I used this example [link removed; example no longer available] which allows for the variation of duty cycle and frequency in real time.
This example seems to work but I periodically receive this error:
Error -200301 occurred at Property Node DAQmx Channel (arg 1) in Pulse Width Modulator-daqmxb.vi
Possible reason(s):
Cannot update the pulse generation property.
The pulse generation with previous property settings must complete a full cycle before the property can be updated.
Task Name: _unnamedTask
It seems that the program is trying to overwrite a counter property before a single cycle has completed. However this error occurs even when i'm not changing the frequency or duty cycle inputs. When I use the cpu for other tasks such as browsing the internet, this problem seems to occur more frequently.
Is there anyway around such a problem? Are there other ways to control a stepper motor with my particular control setup? Thank you in advance.
~Himesh P.
05-18-2005 07:29 AM
05-18-2005
02:13 PM
- last edited on
08-10-2026
01:16 PM
by
Content Cleaner
Hi himesh-
I'm not able to see the example you're mentioning- the link is broken. Despite this, it seems like you might be experiencing the problem described in KnowledgeBase Error -200301 When Using Property Node to Update Counter Pulse Output [link removed; article no longer available]
Please let us know if you have any additional questions.
Thanks,
05-18-2005 02:32 PM
03-29-2007 10:53 AM
Hi,
I've been using the example you linked as a stepping stone to creating a Pulse Width Modulation program that will control a DC motor by means of Pulse postitioning: is there a way to make this setup send a finite number of pulses as opposed to the continous/infinite number of pulses it does just now?
Any help would be greatly appreciated
Thanks,
John
03-30-2007 12:55 PM - edited 03-30-2007 12:55 PM
Hi,
You can create a finite pulse train with custom frequency and duty cycle by simply using the LabVIEW example program, “Gen Dig Pulse Train-Finite.vi”. During the creation of the virtual channel, you can set the duty cycle and frequency before starting the task. However, these parameters cannot then be modified during the actual output.
On the other hand, you could still use a continuous counter output, but use software to stop the task after a certain time period. For instance, in the example posted above, the frequency and duty cycle can be changed once per second according to the execution timing of the while loop. Instead of stopping the loop when the Stop button is clicked or when an error is received, consider stopping the while loop after a certain number of iterations, giving it similar functionality to a for loop. You can include the execution timing, and you will still be able to change the frequency and duty cycle during the output.
If you decide to take this approach, I would recommend using a while loop instead of a for loop because you can include the error cluster as a stop condition – for loops don’t have easily implemented break statements in LabVIEW. There is a picture of this below.
I hope this helps. Post back if you have any further questions.
Ed W.
Applications Engineer
National Instruments
Message Edited by Ed W on 03-30-2007 12:56 PM
03-30-2007 03:29 PM
04-03-2007 06:03 AM
Hi,
Thanks for responding so quickly; and thankyou for the suggestion: I've taken the vi and made a couple of small modifations.
As you may have guessed, I'm something of a novice with Labview, so forgive me if this next question sounds stupid!
How do I implement a "Go" button into the program so that when the program is run, the pulses are not generated until the user clicks the "Go" button? I presume a structure of some description is required (case or stacked/flat?), but I can't seem to get any structures to work properly.
Any help would be greatly appreciated,
Thanks,
John
04-04-2007
09:49 AM
- last edited on
08-10-2026
01:17 PM
by
Content Cleaner
Hi John,
To implement this functionality, you’ll probably want to use an event structure around your code. The event structure will allow you to execute code when a specific event has taken place. In this case, the event will be a button press and the code will be your data acquisition. There is a nice example program that demonstrates this functionality, along with a PPT presentation that goes into more detail about event structures.
Using the Event Structure in LabVIEW with a Boolean [link removed; example no longer available]
I would recommend going through the presentation to make sure you fully understand the subtleties of event structures. Event structures do not follow LabVIEW’s dataflow paradigm, so be sure to not overuse them as it may introduce bugs into your program that are difficult to troubleshoot.
I hope this helps.
Ed W.
Applications Engineer
National Instruments
04-04-2007 10:16 AM