03-10-2017 01:33 AM - edited 03-10-2017 01:36 AM
Hi Rolando,
Let's say I want to save these two "positions" and then hit the play button and they start changing in an automatic way.
Then you need to program it that way!
When your setup should follow some certain states (stop, run, play) I strongly suggest a state machine.
When you want to run some automatic tests I also suggest to look at QMH (queued message handler)…
when the "low period" is 19000 and the "high period" is 1000 the servo move to one side, when the "low period" is 18000 and the "high period" is 2000 the servo move to the other side.
I would use some conversion VI or a lookup table to convert "move one side"/"move other side" into corresponding PWM values. (It's like creating a device driver: you provide a library of VIs to control your device while hiding the ugly details…)
On your VI:
- I would set the "Load" button to FALSE in the FPGA inside the TRUE case of the case structure to mimic latching behaviour.
- Instead of a FOR loop I would just use a sequence of 4 frames. No need for a Select, no comparison, no FOR loop overhead…