Support > General Discussions

Print to ttyS0

(1/2) > >>

Ken Arck:
Obviously this in Linux

I have an external hardware device that requires the following sent to it via RS232:

1*21999<CR>

So in Scriba, my line is (after opening Open /dev/ttyS0 For Output as #2)

Print #2, "1*21999\n"

But it doesn't seem to send Chr(13) correctly (Chr(13) is CR, right?)

If I send 1*21999 via minicom, it works properly but if sent from Scriba, the external device ignores it.

Support:
Try "1*21999\r\n"

\r = RETURN
\n = LINEFEED

Ken Arck:
Nope, didn't fix it.

Support:
ScriptBasic assumes that the tty port is setup correctly at the Linux level.

When you say it isn't working, are you seeing anything or just not doing line termination correctly?

If your device is only looking for a CHR(13) (RETURN) for a line terminator then just use \r only.

Ken Arck:
I probably need to look at the data stream because I can echo from the bash prompt (echo 1*21999 > /dev/ttyS0 and that works fine. Between that and minicom, it shows the port is configured ok under Linux itself. I have looked at the output on another computer running a term prog and it *looks* ok but obviously it isn't.

It's just from within Scriba that it doesn't work.

Navigation

[0] Message Index

[#] Next page

Go to full version