PDA

View Full Version : serout command



Larry~
10-29-2009, 05:59 AM
This command does not send the variables out
SEROUT 0,baudrate,["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
~ = ō 192.168.10.12 and DEC = 13 192.168.10.12 is there anything i can use that will give me no characters in front of my variables
SEROUT 0,baudrate,["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]

and yes I knowˇthe first one shouldˇwork

Mike Green
10-29-2009, 06:25 AM
The first version of SEROUT should work. You could use the "string" form instead:

SEROUT 0,baudrate,["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.

Larry~
10-29-2009, 07:57 AM
This is a serial to lan module Im trying to read the IP address and set it to a web page I can read it now and email it out. but not update the web page unless i use a ~ or dec,hex,bin just before the a(0) but this puts xtra numbers in front of the Ip address When I set my router (dsl) to dmz it gives my unit the providor IP that my modem works off so I can keep trak of where this thing isˇ on the net (non static IP). the syntax is the same as email but does not work correctly. I never used str I will try it


' {$STAMP BS2}
a VAR Byte(20)
baudrate VAR Word
baudrate = 396

PAUSE 1000
SEROUT 0,baudrate,["at+irp8",CR]
LOW 2
SERIN 2,baudrate,[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,[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,["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,[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

Larry~
10-29-2009, 08:20 AM
I put "here" on one line now it tells me that there is no CR i need to put two in not one I know I had two before but that was for testing only at that time


a VAR Byte(20)
baudrate VAR Word
baudrate = 396


PAUSE 1000
SEROUT 0,baudrate,["at+irp8",CR]

LOW 2
SERIN 2,baudrate,[WAIT("T"),STR a\8]
DEBUG STR a\8,CR

PAUSE 1000

SEROUT 0,baudrate,["at+iheadline=",STR a\8,CR] 'HERE'
'LOW 2
'PAUSE 1
SERIN 2,baudrate,[STR a\15]
DEBUG STR a\15,CR

Larry~
10-30-2009, 05:29 AM
Ok I'm now using strings! how do i use dec in front of each byte like dec a(0),dec a(1) to dec a(9) ?

SEROUT 0,baudrate,["at+ivalue=",STR a\7,CR]

Mike Green
10-30-2009, 05:36 AM
You have to go back to listing each byte separately with a DEC in front like you described.

I put "here" on one line now it tells me that there is no CR???? What else did you do with that line?

Larry~
10-30-2009, 06:34 AM
I did not think I did anything different But this thing is giving me fits
It just won't take a variable
SEROUT 0,baudrate,["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,["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!

Larry~
10-30-2009, 06:44 AM
This line compilies and gives an ok message from the unit but the output is 4953585249585357 and should be 15:42:49 if I don't have hex bin dec then the other unit gives error messages if I do the values are wrong

SEROUT 0,baudrate,["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]

Larry~
10-30-2009, 07:13 AM
Well what I guess I need it an ASC modifier even though thats what it should be sending

Larry~
11-02-2009, 01:15 AM
Ok I have the problem worked out but not sure if it’s a stamp problem or the device I'm sending to!!
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,[“at+imyvalue=:”ˇˇˇˇˇˇˇˇˇˇˇbut cannot be sent out usingˇˇˇˇˇˇˇˇˇˇˇ serout , 396,[“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.