View previous topic :: View next topic |
Author |
Message |
pedro
Joined: 24 Apr 2009 Posts: 128
|
Posted: Tue Dec 07, 2010 11:48 am Post subject: Printbin support mix different variable types? |
|
|
Hello
Anyone know if the Printbin instruction support mix different types of variables?
When I use the Printbin, only with variables of type BYTE, it works fine, but if I add a variable such as WORD, no longer works.
Printbin Master ; board ; Tx_comand ; Tx_data ; Tx_address_w ; T_checksum 'NOT WORK
Printbin Master ; board ; Tx_comand ; Tx_data ; T_checksum 'WORK'S
Thanks in advance
Best regards
Pedro |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Tue Dec 07, 2010 12:01 pm Post subject: |
|
|
sure, at least it is supposed to work.
so show a more complete simple sample i can compile and test.
And how do you determine that it does not work?
when you use some ascii data and the terminal emulator, is it printed? _________________ Mark |
|
Back to top |
|
|
pedro
Joined: 24 Apr 2009 Posts: 128
|
Posted: Tue Dec 07, 2010 12:36 pm Post subject: |
|
|
Hello albertsm
With the Printbin that only sends byte variable it works. On my hardware i have a master board and many slave boards. If i push a button on a slave board, the master receive this command and send the command to make one led ON on this slave board. That all works good.
I need to add to this, a word variable that have one address that i must have. I have add on the master on the right place the word variable and the same on the slaves boards, but it not work's.
As workaround i can try to retriev from the addresses word var the low and high byte and use this temporar var's to send it as byte. My problem is, how can i make that.
temp_h = high(addresses)
temp_l = low(addresses)
but this not compile
high(addresses) = temp_h
low(addresses) = temp_l
Best regards
Pedro |
|
Back to top |
|
|
pedro
Joined: 24 Apr 2009 Posts: 128
|
Posted: Tue Dec 07, 2010 3:16 pm Post subject: |
|
|
Hello albertsm
You are right, the Printbin works mixed with different type of var's.
Now it's work, i have forgett to add a var on the slave code
Thanks
Best regards
Pedro |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Tue Dec 07, 2010 3:26 pm Post subject: |
|
|
If you use INPUTBIN on the receive side it should work if you are receiving with the same type variable.
If you have a modem type RS232 as a connection, like a wireless
in transparent mode then you can not send binary.
Hubert |
|
Back to top |
|
|
sunmat
Joined: 02 Nov 2010 Posts: 51
|
Posted: Wed Dec 08, 2010 1:52 am Post subject: |
|
|
Quote: | If you have a modem type RS232 as a connection, like a wireless
in transparent mode then you can not send binary |
You sure about that...? |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Wed Dec 08, 2010 3:06 am Post subject: You sure about that...? |
|
|
Yes, any time you have a "modem type" serial link, it can only handle ASCll.
In other words 7-bit data. All the control characters are 8-bit.
Unless you can send a predetermined block of data and block out the modem from receiving and decoding any command if for example with hardware handshake. That is for example why you have encoding of binary into ASCll for transmissions over modem.
It works different if you have a direct RS232 then nothing detects any command and you can send binary data all day long as long as the receiving side understands what you send.
Have fun
Hubert |
|
Back to top |
|
|
|