From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Repeating pulse train with PG-522

I'm controlling a linear actuator driver with the PG-522 pulse generator and the DO-400 digital output module.  The PG-522 provides pulses for the actuator, and the DO-400 provides the direction signal.  I'm trying to write a VI that will supply a set number of pulses, pause, then switch the direction signal from low to high (or vice-versa).  I'm currently doing this by monitoring the Pulses Remaining value.  When it reaches zero, I read the direction signal, invert it, then write the inverted value back to the DO-400.  Then that process repeats.  However, I'm having trouble with the timing of this whole process.  I think the trouble lies in my while loop time delays and the delay associated with the pulse countdown.  Does anyone have any ideas on how to make this process run smoothly?

Thanks,
Eric
0 Kudos
Message 1 of 4
(5,137 Views)
Hi Eric,

What kind of timing issues do you get with regards to your program?  What kind of results do you expect from your application?  Furthermore, what kind of FP controller do you have?  Its hard to say what is the cause of your timing issues.  I would highly suggest you use the timed loop and read the output value called "finished late?"  If this while loop finishes late? it may mean that we have timing issues per iteration of your loop.

I hope this helps,

Regards,

Nadim
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(5,120 Views)
Nadim,

I'm using a cFP-2100 controller.  I've attached a picture of the portion of the VI I'm having problems with.  What I want to happen in this case structure is the controller will wait for the Wait Time amount, then toggle the Direction signal, then send the Generate Pulses signal.  However, that isn't exactly what is happening and I don't understand why.  Depending on the values I enter for # of Pulses and Wait Time, it might follow that sequence or it might not.

Would the Timed Loop still work for this application?

Thanks,
Eric
0 Kudos
Message 3 of 4
(5,116 Views)
Hi Eric,


What exactly happens when your sequence does not follow the pattern specified?  Furthermore, what are the 'good' values and 'bad' values for the wait and # of pulses.  I also see that you are using a local variable for the number of pulses, which may give a race condition if you are writing or reading in multiple places.  You may want to test your application by removing the local variable and replacing it with a control and verifying everything works. 


I hope this helps,

Regards,

Nadim
Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(5,097 Views)