Serial and then some

Sarah Reichelt sarahr at genesearch.com.au
Sun Mar 6 19:57:24 EST 2005


Hi Tom,

The problem is that you are asking for specific instructions about 
something that can be incredibly varied. Serial comms can be used for 
such a vast number of things that it's like asking for instructions on 
how to make a phone call.
Do you start by saying Hello?
Do you wait for the person on the other end to say Hello?
What if they say Hi instead?
When you say Goodbye do you hang up or wait for them to say Goodbye?
These questions depend on who you are talking to and what sort of call 
it is. There is no single right answer.

What you really need to do is get hold of the protocol for whatever 
serial device you are talking to. For testing purposes, I tend to use a 
modem which has a standard protocol (Hayes) which you can find online. 
But then I use another serial controller device which has it's own 
language with expected inputs & outputs, which I have to conform to.
e.g. with one device, I know that if I send "t?" & CR, it will return 
"T2334" or some such number, followed by CR. I have another device 
where I send "V2" & CRLF and get back a number followed by LF. It just 
depends what you are talking to.

So, do you have a specific device you are talking to? Can you get a 
hold of it's instruction set?
Do you have a modem you can test with? For starters, send "AT&F" & CR 
and read whatever comes back.

Don't puzzle your brain reading C unless it is a program for talking to 
the device you use, then it might be useful.

HTH,
Sarah

> I am stuck in serial land... I don't know enough about it and Rev and 
> am looking for a "for the completely stupid" tutorial and guide into 
> using serial in Rev and with the upcoming USB externals maybe a fully 
> detailed input output tutorial type. I no squat about this topic and 
> have had very limited success by tearing other people's examples apart 
> to try and understand it further. Sarah's serial stack is the best 
> I've seen but it is only one example and with out other examples to 
> compare it to I don't really understand the important parts and or the 
> why of it.
>
> I need things like:
> Do you really need to wait for a response after having sent a command?
> Do we know what types of responses will come, what to expect?
> Where do we look to know what to expect when looking at a new device?
> Are there similarities with devices and responses?
> Is there a list of commands to send?
> Is there a simple way of understanding the 'why' of these commands?
> Why do some devices need certain LF CR etc.?
>
>
> I have spent days reading stuff on the internet and most concern C# 
> etc. and now my head hurts by I don't feel any closer to understanding 
> the exact metaphor here.
>
> Any help is greatly appreciated,
>
> Tom



More information about the use-livecode mailing list