Asked — Edited

Need Help Sending Data To ARC With Tcp

Ok, I'm working on an app in C# that will send a variable to ARC via TCP/IP telnet style. The ARC side work with a script I can send data to it manually via telnet. Now I need for my app to send the data.

I took the example out of the latest SDK, Tutorial 30 in C# SDK Client.

The main code is as follows:

   
private void Form1_Load(object sender, EventArgs e) {

      ezB_Connect1.Port = "127.0.0.1:6666";

      trackBar1.Value = EZ_B.Servo.SERVO_MIN;
      trackBar1.Minimum = 0;
      trackBar1.Maximum = EZ_B.Servo.SERVO_MAX;
    }

    private void trackBar1_Scroll(object sender, EventArgs e) {

      ezB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D0, trackBar1.Value);
    }

  • Code

The TrackBar is a track bar for servo control - I'm not interested in that. But I do like the connection string. And I like the command that is sent, but I need to figure out how to redo it to just send a variable or string


// This is what I'm going for in my C# code
       private void btn_Open_Telnet_Click(object sender, EventArgs e)
        {
            ezB_Connect1.Port = "192.168.0.100:6666";
        }

        private void btn_sendname_Click(object sender, EventArgs e)
        {
            ezB_Connect1.EZB.ToString(EZ_B.TCPServer ,names);

        }

  • Code

I click on the first button to make a connection. I click on the second button to send the data, but it's not formatted corrected. I do of course have the EZ-B.dll in the debug folder and the correct references.

If I were to the string manually to ARC with Telnet I uses this: $FaceName = "DJ Sures" - this replicates as if the variable "names" in my C# app held a string value of "DJ Sures" and was sent to ARC to fill the varable of $FaceName.

I just want to send my names string in my C# to ARC.


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

#1  

You don't neex the ezb sdk for this tcp/ip is a control within visual studio. Unfortunately, I can't give much more help than that. If this was VB6 I could tell you exactly what control to use and the commands to use, but haven't had time to learn C# or even vb.net yet.

Basically though, you need to establish a socket to the ezb telnet port (23 by default) and then just send text across the port

Alan

#2  

DJ Sures actually fix this for me in the past via Tutorial 52 for Scripting and this thread: https://synthiam.com/Community/Questions/4952&page=1

IT WORKS! CHa-CHING! Thank you DJ. I was just using the wrong sample.

#3  

Awesome. I was sure if DJ didn't jump on one of the handful of C# developers here would help fill in the gaps. Good to see that the question was already answered.

Alan