Insert additional value into serial string

Simple advice that you may find useful. Feel free to discuss or add your own.
Post Reply
kolesar007
Member
Posts: 14
Joined: Sun Dec 02, 2007 11:15 am

Insert additional value into serial string

Post by kolesar007 »

HI

HB comunicate on serial port with one of my device.
In command configuration I set command Write data to 61200374%x%. Then I connect property of device * with that command and
when I want to send serial string I write new value (for example FF04) in property and this works perfect.

Now I change my hw device that except checksum in the end of each string. I have many of this command so i want to insert checksum automaticly at the end of string. I have problem how to insert this checksum that is calculated with script at the end of sending string? So I must write additional "FB" in at the end of value FF04.

Regards
Sandi
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Insert additional value into serial string

Post by Richard Naninck »

You must send your complete code from script. So have the script not only calculate the checksum, but have the script send the code as well. Many examples are uploaded to this forum or if you need more help, then just ask!
Post Reply