serout command
Larry~
Posts: 242
This command does not send the variables out
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=" ,a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),CR,CR]
this command does send the variables out, I can replace ~ with dec and it also sends out, but it places a character in front of the variables
~ =
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=" ,a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),CR,CR]
this command does send the variables out, I can replace ~ with dec and it also sends out, but it places a character in front of the variables
~ =
Comments
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=",str a\15,cr,cr]
When you say "does not send the variables out" what do you mean? What's the content of "a"? I ask because there's nothing apparently wrong with the first statement, yet you say it doesn't work. The explanation may well be in something else you're not showing.
' {$STAMP BS2}
a VAR Byte(20)
baudrate VAR Word
baudrate = 396
PAUSE 1000
SEROUT 0,baudrate,[noparse][[/noparse]"at+irp8",CR]
LOW 2
SERIN 2,baudrate,[noparse][[/noparse]a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14)]',a(15),a(16),a(17),a(18),a(19)]
DEBUG a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),CR'a(15),a(16),a(17),a(18),a(19),CR
'SERIN 2,baudrate,[noparse][[/noparse]a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14)]',a(15),a(16),a(17),a(18),a(19)]
'DEBUG a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),CR'a(15),a(16),a(17),a(18),a(19),CR
PAUSE 100
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=",~a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),a(15),a(16),a(17),a(18),a(19),CR]
'PAUSE 1
'LOW 2
SERIN 2,baudrate,[noparse][[/noparse]a(0),a(1),a(2),a(3),a(4),a(5)]',a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),a(15),a(16),a(17)]',a(18),a(19)] '
DEBUG a(0),a(1),a(2),a(3),a(4),a(5),CR',a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),CR'a(15),a(16),a(17),CR'a(18),a(19),CR
a VAR Byte(20)
baudrate VAR Word
baudrate = 396
PAUSE 1000
SEROUT 0,baudrate,[noparse][[/noparse]"at+irp8",CR]
LOW 2
SERIN 2,baudrate,[noparse][[/noparse]WAIT("T"),STR a\8]
DEBUG STR a\8,CR
PAUSE 1000
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=",STR a\8,CR] 'HERE'
'LOW 2
'PAUSE 1
SERIN 2,baudrate,[noparse][[/noparse]STR a\15]
DEBUG STR a\15,CR
SEROUT 0,baudrate,[noparse][[/noparse]"at+ivalue=",STR a\7,CR]
I put "here" on one line now it tells me that there is no CR???? What else did you do with that line?
It just won't take a variable
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=",STR a\8,CR] This will not work gives one or another error message
there is something different about sending strings!!
SEROUT 0,baudrate,[noparse][[/noparse]"at+iheadline=192.168.1.1",CR] This works great
I have debug screens and the correct values are there but the stamp and the other unit must be married because they just don't get along!
SEROUT 0,baudrate,[noparse][[/noparse]"at+ivalue=",DEC a(0),DEC a(1),DEC a(2),DEC a(3),DEC a(4),DEC a(5),DEC a(6),DEC a(7),CR]
I found that there a five ASCII characters that cannot be sent to this device via variables using the bs2.
·
ASCII code······· ········· character··················· name
·
44··········································· /····················· forward slash
58··········································· :······················ colon
61··········································· =····················· equal sign
63··········································· ?····················· Question mark
126········································· }······················ bracket right
Could this have something to do with command characters for the stamp? and being handled differently? These same characters can be sent to this device via straight command not using variables like
serout 1,396,[noparse][[/noparse]“at+imyvalue=:”···········but cannot be sent out using··········· serout , 396,[noparse][[/noparse]“at+imyvalue=”a(0)··························· where a(0) value is : or any of the above five characters,
this has been a real battle to figure out, I was trying to send the time and it was not going for it, two too many colons.