Hi everybody,
I'm writing an application that controls robot arm and I need Your assistance.
Long story short robot arm is controller with telnet session. I was able to successfully connect to it using
and send defined commands like this:
but as the application develops I'm trying to put variables into sanded commands, i.e.:
I approached this challenge by defining my command as NSString:
and I'm trying to covert my command (NSString) to message format (UInt8 array) so it can be sanded the like before.
After couple of hours googleing and searching through forum I came to realize that I cant do it alone and I need help.
Any advice is greatly appreciated.
I'm writing an application that controls robot arm and I need Your assistance.
Long story short robot arm is controller with telnet session. I was able to successfully connect to it using
Code:
#import <CoreFoundation/CFSocket.h>
and send defined commands like this:
Code:
UInt8 message[] = "do home\r\n"; //returns arm to home possition
CFDataRef data = CFDataCreate(NULL, message, sizeof(message));
CFSocketSendData(s, NULL, data, 0);
CFRelease(data);
but as the application develops I'm trying to put variables into sanded commands, i.e.:
Code:
do drive 1,20
do drive 2,45
do drive 4,-10
I approached this challenge by defining my command as NSString:
Code:
int joint=1, value=45;
command = [NSString stringWithFormat: @"do drive %d,%d\r\n",joint,value];
and I'm trying to covert my command (NSString) to message format (UInt8 array) so it can be sanded the like before.
After couple of hours googleing and searching through forum I came to realize that I cant do it alone and I need help.
Any advice is greatly appreciated.