Make an ARC Skill

Add Some Buttons

Now that the MainForm has been created with the example project, it will be the form that users see when using your plugin. The form is currently only containing a label with some text, making it a boring skill. In this step we will add two buttons to move servos between different positions.

  1. Locate the MainForm in the Solution Explorer and double click.

    User-inserted image

  2. When the MainForm designer loads, click on the text and press Del to remove the label from the form. This will leave you with a blank form.

    User-inserted image

  3. Locate the Button under All Windows Forms in the Toolbox. Drag two buttons anywhere onto your MainForm.

    User-inserted image

  4. Give the buttons readable text that tells the user what they will do. In this tutorial example, we will be programming the buttons to move a servo between two positions. Click on each button and locate the Text field in the properties window.

    User-inserted image

  5. Double click on each button in the Designer and code will automatically be generated for the Click event of each button. This means that when a user clicks on the button, the code within the function will be executed. The functions are automatically inserted into your code when you double click on them from the designer.

    User-inserted image

  6. Insert code into each of the button click events to move a servo. The command to move a servo is located within an EZB class. Because ARC allows more than one EZB connection, the list of EZB's available is an array. It is safe to assume that the first EZB is used the most. Here is the code which will move the servo connected on the EZ-B port D0 between position 10 degrees and 170 degrees when the buttons are pressed.


    private void button1_Click(object sender, EventArgs e) {
      EZ_Builder.EZBManager.EZBs[0].Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D0, 10);
    }

    private void button2_Click(object sender, EventArgs e) {
      EZ_Builder.EZBManager.EZBs[0].Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D0, 170);
    }

  1. When your code has been entered, it will now look like this.

    User-inserted image

  2. Let's compile your project to ensure there are no errors before continuing to the next step. Press CTRL-SHIFT-B and watch the Output window for any error messages. If everything compiles okay, you will see a similar message result to the screenshot below.

    User-inserted image

  3. Assuming you have no errors and everything compiles fine, press F5, the project will compile and load ARC. Add the robot skill plugin to your workspace and test it out!


ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

#17  

The error cannot read the COM file, I downloaded it and when I follow the instructions, I get an error, while other files read normally. .

User-inserted image

#18   — Edited

sorry for me but i tried many different ways but still show the error,I couldn't find EZ_B.dll file even though I downloaded it

PRO
Synthiam
#19  

None of the required references are in your list. Please follow the tutorial. It explains exactly how to click the browse button and navigate to the folder and select the files.

#20  

Sorry, but the reason I can't reference is because there is no file in the EZ_B folder and there is an error : this folder is empty , I am trying to solve it. I would like to thank DJ sure for answering my superfluous questions and I'm sorry for bothering you

Australia
#21   — Edited

I need to playback 5 Serial Bus servos in sequence.

PRO
Synthiam
#22   — Edited

What protocol is it? A "serial bus" is a generic term for anything using a UART that's chained together sharing the same RX line. Also, why did you add a photo with the question text added in your response?

Are you planning on making a skill control to do this? You wrote the question in the skill control thread in a comment - I'd like to make sure your question is in the right place to help you out.

To begin, I would recommend starting with servo Script control so you can make the serial bus protocol work - then consider making a skill control only if you're planning on distributing the effort to others: https://synthiam.com/Products/Controls/Scripting/Servo-Script-19068

#23  

He seems rather demanding as well.  I guess he needs the benefit of the doubt as English may not be his native language....

#24   — Edited

I have installed all the software dependencies and still ARC does not detect that I have Visual Studio installed. OS is Windows 10, .NET 4.8 or newer, Visual Studio Community 2019.