comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Sending data to the serial port (Linux)?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Sending data to the serial port (Linux)? [message #37618 is a reply to message #37528] Wed, 07 January 2004 06:25 Go to previous message
Olaf Stetzer is currently offline  Olaf Stetzer
Messages: 39
Registered: September 2001
Member
Pepijn Kenter schrieb:
> Olaf Stetzer wrote:
>
>> Hello and a nice new year!
>>
>> Is there an easy way to send data to the serial port
>> under Linux? I have some values in a spreadsheet that
>> need to be reformatted and sent to e.g. /dev/ttyS0.
>> I think of exporting the spreadsheet as csv and read it
>> into IDL, reformatting is easy and no problem but how
>> do I send the strings to the serial interface? Probably by
>> writing to another file and doing a 'cat foobar /dev/ttyS0'?
>> Is the latter possible in the timed demo mode (I need
>> to to this at home without access to our license server).
>>
>
> Can't you just open the device in IDL with the openw procedure?
> Like so:
>
> openw, lun, '/dev/ttyS0', /get_lun
> printf, lun, "test string"
> free_lun, lun
>
> Since 'everything is a file' in linux this should work.
>
>> There is probably an easy solution without using IDL
>> any hints?) but IDL is the only language I have a
>> good pragramming experience with! :-)
>>
>
> If you want the right tool for the right job, awk is probably what
> you're looking for.

Yes I solved it with awk yesterday. I still have to try if
cat foobar /dev/ttyS0 does the right thing, I will try that
this evening. Will perl be an easy alternative if this simple
solution fails?

Olaf
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Widgets: group leader and procedures
Next Topic: 2 little questions: (Object windows with widget_draw) AND (geting working directory)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:40:13 PDT 2025

Total time taken to generate the page: 1.04115 seconds