Ok thank you! You´re right I have an array but then you are telling me there´s another way to get a string of characters serialy?? What do you mean with a "string string"?? Thank you very much I really appreciate it!
Armando.
Ok thank you! You´re right I have an array but then you are telling me there´s another way to get a string of characters serialy?? What do you mean with a "string string"?? Thank you very much I really appreciate it!
Armando.
Poor choice of words on my part – there is no string variable in PBP. i.e., you cannot have RX_Var = “Hi There” in PBP even though it is allowed in most traditional BASIC programs if RX_Var is declared as a string variable (See Visual Basic for example). You can haveOriginally Posted by Armando Herjim
X[0]=”H”
X[1]=”i”
X[2]=” “
etc.
You have a few choices from what I can see. You can make sure you always send and receive 4 digits of a decimal number and use DEC as Steve suggested. Or you could “roll your own” with your array values: (highly unoptimized but should get the point across)
NewValue VAR WORD
RX_Var[0]=51
RX_Var[1]=52
RX_Var[2]=53
RX_Var[3]=54
IF RX_Var[0] = “ “ THEN GoSomeWhere
NewValue = RX_Var[0] - “0”
FOR X = 1 to 3
IF RX_Var[X] = “ “ THEN GoSomeWhere
NewValue = (NewValue * 10) + RX_Var[X]-”0”
NEXT X
You also can probably do it with all the options of SERIN2 but I have not used them enough to be able to suggest the format. Someone else?
Good Luck,
Paul Borgmeier
Salt Lake City, Utah
USA
A quick after thought - why not just send and receive your data a low byte and a high byte of a word sized variable and be done.
For example
X var word
X = 456 ' your "desired" value
send
X.lowbyte = 200
X.highbyte = 1
then X will be 456 - done.
Paul
Hey that seems to be an excellent idea. Thank you very much!!!
Bookmarks