All,
I want to execute a task upon receiving data from the CBUS RS232 interface such as:
050B38000220484E
I have noticed some forum posts that relate to scripts to do something similar, but I can't quite work this out!
Any help would be appreciated!
thks, John
Received data from CBUS RS232 interface
-
- Member
- Posts: 15
- Joined: Tue Apr 15, 2003 9:33 am
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: Received data from CBUS RS232 interface
The Received Data property of the generic serial device will list this hex string in ascii code and is therefore unreadable. Not sure if you can even compare hex code displayed in ascii in a task comparison with text (new V3 feature). Besides that, you would have to build many tasks or many if statements in a task to handle all of your hex strings. Presuming you want to handle more than the one above.John_Paul_128 wrote:I want to execute a task upon receiving data from the CBUS RS232 interface such as:
050B38000220484E
If that is the case and you are capable of building a script, you can make it as nice as you want.
If you look at the scripts section under "Other Large Scripts" and download it, you will find a script that handles my plasma serial. It is also hex based. In this script (simple vbscript code) you see that the ascii from the received data property is rebuilt to readable hex using the Asc() function. You could basically strip that whole script and use the parsing part from it to get you going. Such a script could be run from a task without the use of a script device (V3 only). You can run the script when the received data property changes, or you can run it in a script device continuously while having the script check the received data property like in my plasma example. Any way works.
-
- Member
- Posts: 15
- Joined: Tue Apr 15, 2003 9:33 am
Received Data
Paul,
Please I have the same problem you had.
Please Can you explain me how did you set the received Data to compare.
Did you creat a device?
What did you write on Received Data property?
thank you
Thales
Please I have the same problem you had.
Please Can you explain me how did you set the received Data to compare.
Did you creat a device?
What did you write on Received Data property?
thank you
Thales
Likewise I have a Caddx NX-8e alarm panel that talks hex. I trigger a script that parses out the data received from the alarm panel. The hex data is fairly complicated because there is so much data an alarm panel can convey... ready, armed, bypassed, fire, smoke, AC fail, siren, zone name, last alarm zoned, faulted zone, ++++ I've probably only implemented about 1/4 of the hex codes from panel into HB.
I wrote it pre-v3, but probably couldn't have done it with "contains". There are repetitive hex codes which depending where they are in the string, mean different things.
I think it should still be posted in the scripts somewhere.
Tim
I wrote it pre-v3, but probably couldn't have done it with "contains". There are repetitive hex codes which depending where they are in the string, mean different things.
I think it should still be posted in the scripts somewhere.
Tim