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




Hello all,

How about a slightly different approach, rather than trying to squeeze
xPL onto a microcontroller, Make the RS-485 link platform and protocol
independent as follows:-

>From the device up...


Client Devices
--------------

Client devices on the RS-485 network have to only respond to 4 things
based on their address.

1) Change an output state on a specific port / pin etc.
2) Return the state of a specific port / pin  when requested.
3) Automatically generate a message if a port / pin has changed.
4) Heartbeat messages to check the device is still alive.


RS-485 Handler Service
----------------------

The RS-485 handler service on the PC opens a socket server that accepts
commands from xPL applications (Or any other application) and passes the
data down to the client devices. As an example:

Example for bit / byte manipulation commands sent to the Rs-485
service...

OUT - DEVICEID - PORT - MASK - VALUE
INP - DEVICEID - PORT - MASK - VALUE

If an event needed to be returned to it's control app the device would
send an INPUT instruction containing the data back to the RS-485
service.

Heartbeats are returned to the controlling application to process.

HBT - DEVICEID

Applications
------------

The xPL Intelligence of the system comes from the apps on the PC, not
the Microcontrollers.
Currently in order to build an xPL application (in VB6 .net etc) we
build an app and use the xPL.OCX to do all the tricky xPL protocol
stuff. To control Rs-485 hardware we would need to write a socket client
ocx that could send and receive data from the RS-485 service.
The ocx would have the following commands available.

SendData (DevceID,Port,Mask,Value)
GetData (DeviceID,Port,Mask,Value)
SendHeartbeat (DeviceID)

And the following events

DataChanged  (DeviceID,Port,Mask,Value)
Heartbeat (DeviceID)

It would then be a simple exercise to glue these two ocx's together
inside an application. Parameter info could be pulled from xplHal
configuration information (DeviceID).

Oh well, my parachute's on, door's open. I'm ready to be shot down in
flames! ;-)

Peter



-----Original Message-----
From: Frank Mc Alinden [mailto:fmcalind@xxxxxxx]
Sent: 31 January 2005 10:18
To: ukha_xpl@xxxxxxx
Subject: Re: [ukha_xpl] PC to RS485 bridge


Hi Neil

> Something needs to turn the pseudo code of
> {
> COMMAND=CLEAR
> TEXT=CURRENT LOUNGE TEMP \n23.12
> DELAY=30

Thats the job for the pc /rs485 application.......Which is going to have
to
do a lot of work...I just hope someone has the time to do it .....

Frank


----- Original Message -----
From: "Neil Wrightson" <neilw@xxxxxxx>
To: <ukha_xpl@xxxxxxx>
Sent: Monday, January 31, 2005 8:53 PM
Subject: Re: [ukha_xpl] PC to RS485 bridge


>
> Hi Frank,
>
> Thanks for the feedback.
>
> Something needs to turn the pseudo code of
> {
> COMMAND=CLEAR
> TEXT=CURRENT LOUNGE TEMP \n23.12
> DELAY=30
> }
> into something that a low level device can under stand.
> Remebering that we are trying to keep the data transfer on the RS485
> bus down and also allow for lower capacity devices to also play a part
> on the 485 bus. So sending -
> COMMAND=CLEAR
> TEXT=CURRENT LOUNGE TEMP \n23.12
> DELAY=30
> on the bus seems a bit heavey and expecting pics etc to have a large
> enough decode area is proably a bit much.
>
> So if the PC wanted to send you above example to a OSD device it would
> send the following command.
> 02   Stx
> 20   Address of OSD deviceBridge is address 0
> ??   Length of message
> 'C'  xpl-status  C=Remote command to be sent to a slave device
> XXX  07H,'CURRENT LOUNGE TEMP',0DH,1EH,'23.12',0DH,0F
> xx   Checksum
> 03    ETX
>
> The xxx equeats to Clear screen,write text,CR,delay for this line,
text
> on next line,CR,delay for this line.
> In the On Screen Devices I have developed, I actually use ClearScrean
&
> GotoXY commands. This allows the PC to do the screen or line clearing
> or clearing of three characters at a certain XY location
>
>
> Neil.
>
>
>
>
> 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
> Yahoo! Groups Links
>
>
>
>
>
>
>



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.