01-27-2018 06:08 AM
Hello,
i have decided to create sipmle detect system in work area of the robotic arm. My task: detection system during operation robotic arm finds match well then robotic arm stop his operation. If after x seconds there are no matches robotic arm starts his operation again. I have tried find a solution:
first, i have split my project on 2 parts. Part 1 Autonomus sequence for robotic arm using arduino.
Part 2 sipmle template detection.
Next i combined 2 parts and have tried to implement my task as follows: i connected output of my comparison mode (gteater or equal) to loop condition like on image.
Ofc it was a stupid mistake and when i pressed run my robotic arm turned on the angle 110 and stopped before success matching. Maybe anyone have solution or somebody can to advice me?
Best regards
01-27-2018 03:47 PM
Don't embed pictures of code -- attach the actual VI so we can really see what you are doing. Don't use the Sequence structure (it is almost never needed). Do you understand the notion of Data Flow, the "Main Idea" behind LabVIEW? If so, then you should see that simply running error lines between functions "sequences" them! Also, having the same function run 12 times with 12 different sets of inputs cries out for a For loop (for the repetition, but with nothing wired to the "N" input) and a pair of Arrays holding the sets of inputs you want to use (even better would be to create a Cluster of your two inputs and have a single Array of Clusters, but I'm guessing you don't know about clusters ...).
Bob Schor
01-27-2018 11:27 PM
Thank you for reply,
I use the Sequence structure because don't know how to get the desired result as a aotunomous sequence. Also i don't know about clusters, so need to learn more about them. Attached th VI.
Best regards
01-28-2018 03:13 PM
Yes, the Timer functions are the "exception" to the rule "You (almost) never need the Sequence Structure". Sorry, I couldn't see your VI
But here's what I was hoping you'd do -- turn the Sequence into a Loop with arguments. I created a Servo Arg Cluster of two U8's, Servo and Arg (as your Servo VIs appear to have two U8 arguments and I'm guessing the first is the Server number), and a second Timed Servo Arg cluster that added a Duration parameter. I then built arrays of these clusters (it's easy to see the sequence by looking at the Array, and economical of Block Diagram space). Here's how it looks (I left the Cluster, unwired, on the Front Panel so you could see it).
I've also attached the code as LabVIEW 2016 (I can't safely install 2017).
Bob Schor
01-29-2018 01:33 AM
Thank you sir,
I've some modified your VI and replaced UTIL configure servo and servo write angle.Yes, you're right about "the first is the Server number". Sorry you can't see my code ( just deleted 2015 version and uses only 2017 now), so i've attached image:
It's very useful for me, now i can use clusters for my previous project and future projects i hope.
Now l'll search solution for stop servo when match template is detected.
Best regards,
N
01-29-2018 07:26 AM
One "side benefit" to this scheme is that if you have an algorithm for the servo sequence, you can build the array programmatically using a For loop or a Simple State Machine rather than manually creating an Array Constant.
Bob Schor
05-02-2018 11:10 AM
I'm still a beginner in the labview so can you explain to me how you did it
11-28-2019 06:24 PM
AIUUUUDAAAA!!!