Running uArm Swift Pro using C#

Has anyone successfully operated the uArm Swift Pro using C#? I have set up the typical serial connection but I am not getting a response from the device.
serialPort1.PortName = “COM72”;
serialPort1.BaudRate = 115200;
serialPort1.Parity = Parity.None;
serialPort1.DataBits = 8;
serialPort1.StopBits = StopBits.One;
serialPort1.Open();

I can open the uArm Pro using putty and the arduino console and immediately get a response back and an audible beep. I receive nothing after trying to open the port through a C# Form.

Solved it.
I didn’t take into account flow control.

How did you solve it?

Hi,

Could you explain what you did exactly?
I am very interesting to use C# method for control the robot.
Could you share an exemple of your program.cs?
Thank you.

I also encountered the same problem, I want to ask how to solve it.

This will get the arm working for you.

    var serialPort = new SerialPort("COM7", 115200, Parity.None, 8, StopBits.One)
    {
        DtrEnable = true   
    };
    serialPort.DataReceived += this.DataReceived;
    serialPort.Open();
    .....
    serialPort.Write("G2210 S150 R90 H50 F10000\n");
    ....
    serialPort.Close();


    private void DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        var local = (SerialPort)sender;
        int lengthToRead = local.BytesToRead;
        byte[] rxBytes = new byte[lengthToRead];
        local.Read(rxBytes, 0, lengthToRead);

        var response = Encoding.ASCII.GetString(rxBytes);
        .... 
    }

Change “COM7” to whatever COM port your arm is reported as connecting to.

1 Like

Althought it can beep,but it can’t move to anywhere

I have the same problem. I get the arm to beep but no movement. Did you ever resolve the problem?

To close this out and post the “fix” for everyone: In gparris code sample is one mistake. The move command must be:

serialPort.Write(“#G2210 S150 R90 H50 F10000\n”);

Cheers