LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating finite number of pulses to move motor

Solved!
Go to solution

Hi,

 

I am using old 6040E PCI cards to do some control and data acquisition and want to now move some motors that take a number of pulses to rotate a certain number of degrees. We'd like to move these motors one at a time, so I've started to put together bits of a sequence that will be incorporated into a larger program. 

 

I'm having trouble understanding how to properly setup  the generation of a finite number of pulses. In the attached VI, the program will stop sending pulses after only ~12 seconds and often throws an error. Is this the wrong way to setup what should be a simple task of sending X number of pulses?(eventually set by user in the front panel many) I've tried following the NI examples and changing them to suit my needs. 

 

0 Kudos
Message 1 of 6
(2,941 Views)
Solution
Accepted by topic author jtboik

It looks like you are trying to generate 10,000 pulses at 10 Hz frequency, which should take 1,000 seconds. But your "Wait Until Done" function has a default timeout of 10 seconds. You can fix this problem in several ways (mathematically at least, I'm not sure what your equipment is capable of):

  • Send less than 100 pulses
  • Set timeout to over 1,000 seconds
  • Set the frequency to 1,000 Hz

 

Message 2 of 6
(2,909 Views)

I increased the timeout on the wait.vi and it seems to be doing the trick. Does it matter what this timeout is set for?

 

 

 

I would like the dialogue box to pop up as soon as the movement is done and continue on with the rest of the progra, so I don't want to create any kind of delay between the pulse generation being done and wire flow to the next dialogue box or movement sequence. 

 

Thanks for catching that! Wasn't really sure how the timeout input worked. 

0 Kudos
Message 3 of 6
(2,905 Views)

@jtboik wrote:

 Does it matter what this timeout is set for?

 


If your task takes 10 seconds to execute, you can set it to anything over 10 (like 15 or 20 seconds) and it will still return when the task completes after 10 seconds. The only time it won't return is if the task is not running correctly, then it will wait until the timeout to tell you the task didn't complete. It's basically your "something must have gone wrong" time.

Message 4 of 6
(2,898 Views)

As a side note, if you are running this VI as a subVI, it will wait until the user closes the popup box before returning to your main code. Just wanted to mention that in case it's not the behavior you expected.

Message 5 of 6
(2,896 Views)

Thanks and yes that is the expected behavior. The operator will want to confirm before moving on the rest of the sequence. 

0 Kudos
Message 6 of 6
(2,882 Views)