SEROUT Hex Numbers
halju
Posts: 7
Hello everyone, its my first time using the BS2 and its prolly a noob question but im having some trouble with SEROUT hex numbers here's what my code looks like...
VarHeaderCombo VAR Word
VarHeaderCombo = $0466
SEROUT 16, 188, [noparse][[/noparse]VarHeaderCombo]
and my output is...
Byre Received at 9:49:35 PM : 48 msec: 66
I've declared it a "Word" so i would think i should get all 4 digits, however as you can see im only getting "66"
Can someone shed some light on this?
thanks!!!
VarHeaderCombo VAR Word
VarHeaderCombo = $0466
SEROUT 16, 188, [noparse][[/noparse]VarHeaderCombo]
and my output is...
Byre Received at 9:49:35 PM : 48 msec: 66
I've declared it a "Word" so i would think i should get all 4 digits, however as you can see im only getting "66"
Can someone shed some light on this?
thanks!!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
SEROUT 16, 188, [noparse][[/noparse]VALUE, VALUE]
This will send the two bytes like you mentioned but it will put about 100msec delay between. This was what i tried first.
Im trying to send commands to a x10 powerline controller and it wants 0x04 0x66 basically at the same time. I scanned the manual for a concatenate function however i didnt see one.
thanks,
Josh
So there is no way to concatenate? or to serout 3 bytes at once?
Post Edited (halju) : 2/23/2010 3:37:50 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Byre Received at 10:18:11 PM : 326 msec: 66
Byre Received at 10:18:11 PM : 426 msec: 0
Byre Received at 10:18:11 PM : 532 msec: 0
is this what i should be getting?
The statement as written will send out first the $66 and then the $40. What happens if you send it $6640 instead of $4066? What happens if you send it
SEROUT 16, 188, [noparse][[/noparse]HEX4 $4066] ' 4 ascii hex bytes instead of 2 binary bytes
That is, you have to be sure of the format. It might expect BCD, huh?
In the message, "Byre Received at 10:18:11 PM : 326 msec: 66"?, what does the 326 msec signify? The messages seem to be about 100 milliseconds apart.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
[noparse][[/noparse]0x04] [noparse][[/noparse]0x66] - Address A1 (A1 is a house code, device code)
I have a homemade program similar to hyper terminal, i've "talked" to the controller. So i know it will only accept HEX numbers, and i know how fast it wants the numbers.
"In the message, "Byre Received at 10:18:11 PM : 326 msec: 66"?, what does the 326 msec signify?"
That is a output from my home made program. I connect the bs2 to this program so i can see what exactly im sending, the format its sending, and how fast they are sending.
There is an "XOUT" command.· Is it inappropriate?
I'm not familiar with the X 10 protocol but did look at a few docs and did come across the exact example you quote , the docs that I read indicated that after the header (Ox4 , Ox66) the device would return a checksum (Ox6A). Did you try sending the header to the device and seeing if the device returned anything
the code above will transmit the header as the protocol requires, it just needs a SERIN to follow and capture the checksum if it comes
Jeff T.
EDIT: another thought , using the programming port for communication the Stamp will echo back the data it receives , if the device is frequently sending data to· the Stamp the echo·may confuse the device. Something to consider.
Post Edited (Unsoundcode) : 2/24/2010 11:01:25 PM GMT