Using National Instruments LabView, I have a program that is designed to control a single servo motor. I want to be able to set the servo position from an outside data source–I send “#0 P2500 S700 ” (last char is ASCII 13) and have no result. When I use the ssc-32 terminal, everything works properly. My serial port is setup at 115.2k baud, 8 data bits, 1 stop bit, no parity, and no flow control. Any suggestions for how to get this up and running?
the problem is the ‘Last char’ which is not the ascii character corresponding to the ascii code 13 (CR)…it’s a general purpose character which is show if trying to display an ascii code < 32.
there’s no display character for code < 32 and if it exist, it’s just because the current font have it’s own correspondance.
many programming language use another way to send control code,
C and C++ use “\r” the “” mean “control code” (escape sequence in fact)and the “r” mean “return”, using “\r” in C++ will send the ascii code 13.
so “#0P1500\r” is the C/C++ syntax
you can also send directly code values in decimal, octal or hexadecimal with the correct syntax. some terminal auto send the CR code when pressing the ‘enter’ key
Basic for Basic Atom or Basic Stamp 2 use and ‘serout’ command to send data to the SSC-32 card, like serout p15,i38400,"#0P1500",13].
so, you must find how to send directly the value 13 with your software.
don’t bother to put spaces chars, “#0P2500S700” (+ the CR code 13) is better, because the spaces use bandwidth on serial port.
i hope it will help.
Thanks for your help. I’d been trying 0x13 and 0x0013, but they didn’t work–appending the carriage return constant worked great.
Just so you’ll know. 0x13 is incorrect for a cariage return. A carriage return is DECIMAL 13 or hexidecimal 0xD.
Nathan