08-25-2017 09:24 AM
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.
Solved! Go to Solution.
08-25-2017 11:06 AM
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):
08-25-2017 11:30 AM
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.
08-25-2017 11:53 AM
@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.
08-25-2017 11:55 AM
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.
08-25-2017 12:21 PM
Thanks and yes that is the expected behavior. The operator will want to confirm before moving on the rest of the sequence.