serialControlString

Sarah sarahr at genesearch.com.au
Tue Nov 25 16:57:38 EST 2003


You need to read separately. The write to driver command does just 
that. If you check "the result" after a write, you will be able to see 
if there was an error:

	-- sendEOL = LF or CRLF or ASCII(13) or it may be empty
	-- thePort = /dev/cu.XXXXXXX (whatever the address of your device is)
	write theData & sendEOL to driver thePort
	if the result is not empty then answer the result

After that, you need to read from the device using a command like:

	-- recEOL = LF or CRLF or ASCII(13) or it may be empty
	read from driver thePort until recEOL

I set up a reading loop which is basically this:

on readPort
	read from driver thePort until recEOL
	if it is not empty then put it after fld "recField"
	send readPort to me in 5 ticks
end readPort

This continuously reads from the device and logs any returning 
messages. Try something like this with various settings for sendEOL & 
recEOL.

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/

On 25 Nov 2003, at 11:34 pm, Thomas J McGrath III wrote:

> OK you guys,
>
> I think you guys forgot that I am way new to REV, so syntax is 
> tripping me up big time. I have been able to communicate TO the device 
> but not get any desired result from the device.
> Do I need to read from device in order to get the result or should the 
> result be a part of the write to process being returned ? I want to 
> learn more but this is way beginner stuff concerning the proper syntax 
> and expected results.
>
> I just need to get to first base and then I can start playing around 
> to learn the ins and outs of the rest.
>
> Thanks,
>
> Tom



More information about the use-livecode mailing list