C Programming - SSC32 communication

I don’t like the RIOS interface for what I want to do, so I figured I’d just write it in C because I’m already familiar with it.

But I’ve never done this before and the search function gave me only snippets that didn’t all quite make sense, so I need some help with the basics. I’m using Visual Studio 2005 Express edition.

  1. Serial Communication… is there a standard library for this in C or if I have to download one, is there anything I might want to look for?

  2. I think I understand sending the information through a write command to the serial port function, but how would I read requested information? (ie. I send the string “ssc-32:ver”)

I assume this is all in ASCII too right?

Hi Josh,

If you’re talking to an SSC-32, it’s in ASCII.

You’ll want to check out System.IO.Ports if you’re using the .NET framework with C++ or C#.

Otherwise, there’s an good description of serial communications in a Win32 environment (but very, very old) here.

A serial port library for C++ here

There’s another straight forward implementation & tutorial of serial comms in C here (its for file transfer, but most, if not all, should apply.

I’ve implemented this class in VB.NET for my Scout, however it could be easily adapted to C# if you’d like codeworks.it/net/VBNetRs232.htm

thanks guys :slight_smile:

Hi, I’m an student of Computer Engineering, I am doing a project with the arm lynx 6, but I don’t like the RIOS interface.

I have the same problem, Could you solve your problem Josh?

I need a program that I send an array of positions and the arm take this configuration, or something to stablish a communication with the arm and send the positions.

Thanks.

If you have already calculated the servo positions that you want, you need to setup serial communications between your PC and the arm (SSC-32). Then all you have to do is output ASCII SSC-32 commands to tell the different servos to go to your calculated positions.

However if what you have are X,Y,Z positions that you want the arm to go to, that is a whole different problem. You would need to write all of the code to convert the positions into servo angles and that is a lot more work!

Kurt

Hi Kurt, thanks for your reply.

I must make a program that converts the X,Y,Z positions in servo angles, but this is another problem that I review later.

First I need an application that I send a angle of servo and the servo take this like the lynxterm, but that can be call from another application and sends the angles.

You say that only needs is output ASCII SSC-32 commands but with what application I send this.

In fact this application would be the link between my program that converts X,Y,Z positions, and the arm.

I have another question.

The commands that I put in the command window of lynxterm are the commands that the ssc-32 accepts.

If I sends for example "#0 P1500 " with another application by the serial port, will the arm moves?

Yes, the same Ascii command lines that you send/type in lynxterm are the same commands that your program needs to generate. So yes if you send the #0P1500 through your application to the serial port and the serial port is connected to the SSC-32 with the right baud rate, parity. And if a servo is connected to pin 0 of the SSC-32, that servo should move to about it’s mid point.

Kurt

Ok, thanks for your reply kurte. Now I have clear that I must to do.

You can use matlab to send serial commands to the arm. use the serial function in matlab.