LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse generation

Hello.

I want to make a program to generate pulse for driving stepping motor.I was able to meke proguram to generate the output waveform.Then I am in trouble by outputting a waveform. I made a proguram by using DAXmx(Sample cloak and analog1D DBL 1Channel N sample ,etc) .But Error code 200462 is displayed on DAQmx Start Task.vi:4  when executed this program. Also, the waveform is created untill halfway. There is written that the output buffer is empty.How can I solve it?

I am using the multifunction I / O device of NI USB-6211.

Please give me an answer.

0 Kudos
Message 1 of 12
(4,548 Views)

Sounds like you havn't actually written any samples.

 

Have you found the example finder in LabVIEW? Go to: Help --> Find Examples... You can even filter by your hardware device. Look at the Analog and Digital Output examples. Read the 'Information' :

 

Example Finder.png

Nick
0 Kudos
Message 2 of 12
(4,531 Views)

What type of Stepper Motor controller are you using?

Are you directly controlling a H Bridge, or do you have a controller that takes step and direction inputs?

 

Is there a reason you are trying to use an analogue output channel? Digital output would be better for generating a pulse train.

 

0xDEAD

 

 

0 Kudos
Message 3 of 12
(4,517 Views)

Search the DAQmx help for Regeneration.  If your stepper frequency is constant, you can write a single cycle of data to the buffer and it will be repeated.  Writing a new cycle of data will replace the old data at the end of the buffer.  This process requires that you only use half the buffer for regeneration and half for new data.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 4 of 12
(4,497 Views)

1.png2.png

Yes,I have found the example finder in LabVIEW.

This program is generating samples halfway.It is proving that it is found.

The above images is the output program I made.

0 Kudos
Message 5 of 12
(4,471 Views)

1.png2.pngThe type of controller is Oriental motor AR series AC power input pulse train input type.

I do not know it because it is only a little control knowledge.

The above images is the output program I made.

Please tell me the mistake.

0 Kudos
Message 6 of 12
(4,465 Views)

It is not a pulse with a constant frequency.

I want to create a program that speed increases exponentially.

The below images are the program I made.

Please tell me the mistake.1.png2.png

0 Kudos
Message 7 of 12
(4,464 Views)

There are multiple mistakes.   

 

Tasks should be created once *before* your main iteration loop and then cleared once *after* the loop completes.  This is the approach found in all the shipping examples.   

   Your tasks are both created and cleared inside the loop.  This is wasteful of overhead though it can be functional.   In your case however, you aren't waiting for the step generation task to complete before you clear the task, thus stopping the pulses.

 

You are writing data to your task's buffer before having called DAQmx Timing to set up the buffer.  If you're getting *some* pulses out, then I guess DAQmx is smart enough to figure out your intentions, but you *should* call DAQmx Timing *before* writing to the buffer.

 

There's also some likely confusion between your "auto start" control and the fact that you always manually start the task later anyway.

 

Now something you got right:  while step pulses are normally generated with a counter task, you're right to recognize that your 6211 M-series board doesn't support the needed buffered pulse generation task on counters.  You *do* need to use AO (or possibly DO but it's more complicated since you'd also need to supply a separate sample clock) for this.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 8 of 12
(4,453 Views)

The program stopped halfway but the problem solved.

 

I called DAQmx Timing before writing data. But desire output is different.

How should I arrange DAQmxs?

 

 

0 Kudos
Message 9 of 12
(4,426 Views)

You'll need to describe the latest problem more clearly and with more detail.  "Different" doesn't really narrow down the possibilities much.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 10 of 12
(4,411 Views)