Using Xbee Multiple_Decimal_Receive
GrantmcF
Posts: 30
I'm using two Xbee modules and two propeller modules to talk to each other. I'm trying to pass two variables from one module to another. I can pass them and read them using serial pass through on the receiving side, but I can't save them as global variables. I have tried using Multiple Decimal Receive, but can't get it to work. Any suggestions?
Comments
How are you receiving the variables? If you receive them into global variables then you can probably save a step, but without seeing the code I couldn't guess where the issue might be. Can you post your code as an attachment (archive)?
Sending
FDs.str(string("!"))
FDs.dec(out_Temp)
FDs.str(string(","))
FDs.dec(out_Rh)
FDs.str(string(","))
Receiving
Pub cog_Rx | DataIn, Val1,Val2
'Receives data and posts it to global variables
Repeat
DataIn := XBr.RxTime(100) ' Wait for byte with timeout
If DataIn == "!" ' Check if delimiter
Val1 := XBr.RxDecTime(3000) ' Wait for 1st decimal value with timeout
Val2 := XBr.RxDecTime(3000) ' Wait for next decimal value with timeout
out_Temp:= Val1
out_Rh:= Val2