Serial (RS-232) control and command strings

Reply

  #1  
Old 09-25-12, 04:48 PM
LitUp's Avatar
Member
Thread Starter
Join Date: Dec 2008
Location: Indianapolis IN U.S.A.
Posts: 68
Upvotes: 0
Received 0 Votes on 0 Posts
Serial (RS-232) control and command strings

Might there be an RS 232/Serial control guru/wizard/answer person out there anywhere??

Am looking for someone who could perhaps give guidance/advise re: a remote controller and a controllable unit...one who may know "serial language" and could look at my instructions and my command strings thusfar.

I would put such a person not only on the Christmas card list.....but maybe in the will as well!

Thanks in advance!!
 
Sponsored Links
  #2  
Old 09-25-12, 08:34 PM
tldoug's Avatar
Member
Join Date: Jan 2009
Location: USA
Posts: 317
Upvotes: 0
Received 0 Votes on 0 Posts
Where can we see the details?
 
  #3  
Old 09-26-12, 06:58 PM
Member
Join Date: Jan 2008
Location: Southeastern Pennsylvania
Posts: 2,947
Received 0 Votes on 0 Posts
Hi LitUp Ė

Maybe I donít understand what you are asking but there really is no standard rs232 or serial device. The validity of your code would depend on the particular OS and the APIís used for serial comm and most importantly on the specification for the device itself. The spec for the device would dictate how the device should be handled.

For example, the device may or may not require you to raise RTS when you want to transmit and then signal back with CTS as a go-ahead, or it may allow you to transmit at any time, no RTS required. It may only allow half-duplex operation, you or it may transmit Ė but not both at the same time, or it may allow full-duplex operation where you can both transmit at the same time. It may require that you frame your data (if in fact you send data to the device) with SOH/ETX chars or it may require some other kind of data framing, or maybe no framing. Maybe the data has to be in even parity, or maybe odd parity, etc. Maybe the device itself requires a specific unique setup initialization string as the very first transmission to the device, etc.

There can be very specific timing requirements that can only be practically satisfied at the driver or hardware level. For example, when the device lowers CTS you may not be allowed to transmit more than 2 additional characters after CTS is lowered.

Iíve been out of software for many years but if I remember correctly Windows for example has (or did have) a Device Control Block (DCB) that allows you to specify how signals (RTS, CTS, DTE, etc.) should be used and you setup the DCB when you initialize the port. UNIX has the same type of thing.

As far as operation goes, as far as I remember you have to know your particular rs232 device and know how you could use multiple threads and when and where you would do blocked or non-blocked reads/writes etc., and you have to make sure you donít get hung up waiting forever for something, etc.

In other words, you can only evaluate your code in the context of the entire operation of the particular rs232 device.

I am a senior citizen and if I am going off on a tangent, then Ö.never mind!! LOL
 
  #4  
Old 09-27-12, 04:13 AM
Member
Join Date: Apr 2007
Location: Near Buffalo, NY
Posts: 4,239
Upvotes: 0
Received 0 Votes on 0 Posts
What are the devices? Makes & models. How much code are we talking about?
 
Reply

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread
Display Modes