The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: PC to RS485 bridge


  • Subject: RE: PC to RS485 bridge
  • From: "DynamoBen" <ben@xxxxxxxxxxx>
  • Date: Sun, 30 Jan 2005 10:19:03 -0600


Something to consider: I have a device that transmits an account code when
a
card is scanned. It is much easier for me to just broadcast the account
code
to the master right away. However, if you plan to make a polling
environment
we need to determine the polling interval. Idea being if the node gets no
response from the bridge over a period of time it will fail.

Additionally, we need to determine the type of checksum for the bridge and
nodes. We need to determine what is included in the length byte. Finally is
the device address going to be a 9bit address?

Make sense?

-----Original Message-----
From: Neil Wrightson [mailto:neilw@xxxxxxx]
Sent: Sunday, January 30, 2005 4:43 AM
To: ukha_xpl@xxxxxxx
Subject: [ukha_xpl] PC to RS485 bridge


Hi All,

It seems I have put up my hand to do a PC to RS485 bridge, which is fine
with me, but as yet I haven't done any thing with xPL yet, so please excuse
a few stupid questions along the way.

I have been looking over the doc's with regard to xPL protocols and I need
to bounce a few ideas off people.

Basically from a RS485 point of view, the smaller we can make the messages
the faster the whole system will be.
So to send the following command out to a node would consume lots of
valuable time.

xpl-cmnd
{
hop=1
source=XPL-XPLHAL.MYHOUSE
target=ACME-CM12.SERVER
}
x10.basic
{
command=dim
device=a1
level=75
}

Basically I think that we need to come up with some software in the PC that
maps a device to a specific I/O bit on a certain port of a certain slave
device.
It then passes a certain message to the bridge saying set this bit on this
port on this slave.
Hmm, I think we should start by deciding on interfacing to a basic I/O
module, perhaps we should layout some devices and design a protocol that
will interface to these generic devices
Possible RS485 slaves
- Simple I/O module I.e. 8 Inputs and 8 Outputs
- Keyboard
- Display
- On Screen Display module.

My suggested protocol is as follows

1 Stx             Byte,#02
2 Addr            Byte 0..255      Note Generally RS485 limits 32 devices
to
be connected to the bus
3 Message Length  Byte              Allows messages up to 256 - Message
size
4 xpl-cmnd        Byte              I.e.Clear LCD display, Obtain I/O
status
etc
5 Data if any Variable size based on message length. could be zero
6 Checksum        Byte             Checksum of bytes from Stx to Checksum
location minus 1
7 Etx             Byte, #03


Values in quotes are deemed too be ASCII characters, xx = a calculated byte
value.

So if the PC wanted to know the status of the bridge it would send the
following command
02   Stx
00   Bridge is address 0
06   Length of message
'S'   xpl-status                 S=Status, 'T' = Trigger, 'H' = Heart beat
xx   Checksum
03    ETX

The bridge would then respond with
02   Stx
00   Bridge is address 0
08   Length of message
'S'   xpl-status                 S=Status, 'T' = Trigger, 'H' = Heart beat
xx   This byte could have bits associated with various status flags I.e.
Power failure
05   5 slaves are connected
xx   Checksum
03    ETX


If the PC wanted to check for a heart beat on the bridge it could send
02   Stx
00   Bridge is address 0
06   Length of message
'H'   xpl-status                 S=Status, 'T' = Trigger, 'H' = Heart beat
xx   Checksum
03    ETX

The bridge would then respond with
02   Stx
00   Bridge is address 0
06   Length of message
'H'   xpl-heartbeat
xx   Checksum
03    ETX


If the PC wanted to set the output port of a 8 input / 8 output I/O model
were the slave was address 9
02   Stx
09   Slaves Address
07   Length of message
'O'   xpl-cmnd
xx   Data (Byte) to be output
xx   Checksum
03    ETX

The bridge would then respond with
02   Stx
09   Slaves Address
06   Length of message
'A'   Acknowledge
xx   Checksum
03    ETX


OR perhaps send the port address, bit reference and output value were the
slave was address 9
02   Stx
09   Slaves Address
09   Length of message
'O'   xpl-cmnd
'2'   Port 2
'3'   Bit 3
'1'   Set to Logic 1
xx   Checksum
03    ETX

The bridge would then respond with
02   Stx
09   Slaves Address
06   Length of message
'A'   Acknowledge
xx   Checksum
03    ETX


Any comments? Any better ideas?

Do we have any volunteers to for the PC software side of the bridge?

Regards,

Neil Wrightson.




[Non-text portions of this message have been removed]



xPL Links: http://www.xplproject.org.uk http://www.xplhal.com
http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.