03-19-2018 04:19 PM
Hello,
I am trying to control a motor's direction of turn by sending a high (CW) and low (CCW) signal using LabVIEW. I am reading the encoder values from this motor and I thought of using either a case structure or sequence to control when the direction signal will be activated.
To provide some background, this is how I plan on operating the motor:
I run into an issue at item 3. I'm unable to come up with a method of keeping that digital signal at high until the lower angle has been reached. The signal returns to low once the angle from the encoder reading is back under the upper limit.
I tried using case structures and sequences, but I wasn't very successful. Unfortunately, when I started over I did not save my most recent iteration of my VI, but I've attached what I have now. If there are other methods besides case structures or sequences, I'm open to exploring those as well.
Any assistance would be greatly appreciated. Please let me know if I have to provide more details, and I apologize if this is in the wrong section.
Device: USB-6212 with Screw Terminals
Software: LabVIEW 2015 SP1 (32-bit)
03-20-2018 08:06 AM - edited 03-20-2018 08:10 AM
I assume you have not taken any of the "Learn LabVIEW" Tutorials mentioned on the first page of this Forum. Please do so. Pay attention when they discuss loops (like the While Loop). Learn about Shift Registers. Something that they might not say is that you should almost never (need to) use a Sequence Structure (there are some rare cases, but you are not there, yet).
Write yourself a description, similar to what you posted, but with a few more details, like how often you want to run the check (you probably do not want to run at maximum speed, i.e. "as fast as I can" -- possibly 100 times per second is adequate). If you write the description well enough, you should be able to code directly from it (once you learn and understand the concepts in the LabVIEW Basics 1 tutorials).
Bob Schor