05-06-2013 07:08 PM
Hello,
How can I use an array to provide a binary input for a motor input sequence? I attempted to do this but the numbers I put into the array are not the same as the ones coming out. Below is an example of what I tried. After probing the output, they both each output 16. Any help would be appreciated.
Solved! Go to Solution.
05-06-2013 07:21 PM
Did you try to link to an image on your computer? All we see is a small box with a ?
To insert images use the little "tree" button just above the box where you type your message. Better is to attach your VI with typical data saved as default. Look for "Attachments" below the text box and click on the Choose File button.
Lynn
05-06-2013 09:43 PM
This is what I tried to show earlier.
05-06-2013 09:49 PM
I don't understand what you are actually trying to do.
But your image shows arrays starting at element 8 with 8 elements showing. That means there are at least 16 elements in your array. You are checking the array size on each of those. So the "output of 16" makes sense. Those arrays have 16 elements.
So what do you mean by "binary input"?
05-06-2013 10:11 PM
On each switch I am trying to input the "on and off" sequence of a stepper motor for full step, half-step, clock-wise, counter-clock-wise, etc.
05-06-2013 10:12 PM
What "switch" are you talking about?
05-06-2013 10:25 PM
Each on of the arrays represents a switch or wire for a (4) wire stepper motor. In order for the motor to turn in the desired direction and speed the correct input sequence must be inputted to the motor. Which is what I am trying to do.
05-06-2013 10:50 PM - edited 05-06-2013 10:51 PM
You've barely shown any code. Where is your code where you send signals to the motor? Where is your loop?
Attach your entire VI instead of just a piece of a screenshot. Why are you using Array Size in the piece of screenshot you did show?
05-06-2013 11:21 PM
This is the code I am working with. I am obviously not perficient in using arrays, which is why I am seeking advice. Any of which will be appreciated.
05-06-2013 11:27 PM - edited 05-06-2013 11:37 PM
No, that's not "code". That's an image embedded in a word document. We cannot see what's outside the visible area, we cannot see what's in the other cases (In some cases, the output are apparently not wired), and we cannot see what these subVIs are.
All you seem to retain are the sizes of the arrays for further processing. That seems pretty useless.
Why don't you attach an actual VI?