Hi everyone,
I need to send some commands to the serial ports.
The thing is that the commands need to be constructed on VB code depending on variables configured on HB. So, i think the command association of the device with the hardware does not fit me.
Can anyone give me a clue or a piece of code on how to write data directly to one com port?
Thank you all
regards
Pedro
Send Data to com port
There are very few 'functions' in HouseBot. The functions in the scripting language are really just APIs to do very general things (like getting and setting property values) that you can do in the UI. For the most part, HouseBot doesn't bother the user with 'how' to do something (action/function), it just expects the user to tell 'what' the final state is. So as soon as you set a Property Value anywhere in the system (including a VB Script), the appropriate measures are taken to make that state change happen.
Check out this post. The user had a similar question.
Check out this post. The user had a similar question.
Scott
Hi Scott,
If i construct a HEX string for example like '050002' and save it in a property value linked to a command on hardware like '%1%'.
Do you think this will work?
Or the string would be '502' and then the command would be '%x%'?
Or the string would be '502' and then the command would be '%1%' with DATA TYPE configured as HEX on command configuration?
Best Regards
If i construct a HEX string for example like '050002' and save it in a property value linked to a command on hardware like '%1%'.
Do you think this will work?
Or the string would be '502' and then the command would be '%x%'?
Or the string would be '502' and then the command would be '%1%' with DATA TYPE configured as HEX on command configuration?
Best Regards
It really depends on the equipment you are interfacing to. If you use %x%, it will take the data and parse it out as two character hex. It will send the numeric value and not the ASCII value.
So if you sent A0 using the %x% escape sequence, it would send 10100000
But if you sent it with %1%, it would send ASCII A(=0x41) and 0(=0x00) 0100000100000000
I think this is right... but it's been a while since I've been through the configuration on this, so I could be mistaken. I'd suggest consulting the equipment RS232 spec and just trying the different options.
So if you sent A0 using the %x% escape sequence, it would send 10100000
But if you sent it with %1%, it would send ASCII A(=0x41) and 0(=0x00) 0100000100000000
I think this is right... but it's been a while since I've been through the configuration on this, so I could be mistaken. I'd suggest consulting the equipment RS232 spec and just trying the different options.
Scott