serout/serin
Archiver
Posts: 46,084
Jerry-
Try the following instead:
SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",DEC data2,"B"]
SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
Note that data2 in the SEROUT instruction has the DEC modifier added.
It may be that sending data2 as other than decimal numeric text is
causing the SERIN to wait until it sees some decimal numeric text to
put into data2. It won't see any until a succeeding SEROUT sends
data1 as decimal numeric text, and then that's followed by "C", which
the SERIN then stuffs into LAST1. If data2 also seems to be
receiving values that seem more like data1, that would tend to
confirm this possibility.
Steve
On 4 Jun 00 at 20:04, CGIJERRY@A... wrote:
> I am communicating between 2 BS2's using RF. I use the following
> line of code to send data out on the first BS2:
>
> SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",data2,"B"]
>
> and the following to receive it on the second BS2:
>
> SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
>
> I get "C" for MID1 but I also get "C" for LAST1, not "B" as I
> expect. Am I using the serout/serin wrong or would the problem be
> elsewhere in my code?
Try the following instead:
SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",DEC data2,"B"]
SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
Note that data2 in the SEROUT instruction has the DEC modifier added.
It may be that sending data2 as other than decimal numeric text is
causing the SERIN to wait until it sees some decimal numeric text to
put into data2. It won't see any until a succeeding SEROUT sends
data1 as decimal numeric text, and then that's followed by "C", which
the SERIN then stuffs into LAST1. If data2 also seems to be
receiving values that seem more like data1, that would tend to
confirm this possibility.
Steve
On 4 Jun 00 at 20:04, CGIJERRY@A... wrote:
> I am communicating between 2 BS2's using RF. I use the following
> line of code to send data out on the first BS2:
>
> SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",data2,"B"]
>
> and the following to receive it on the second BS2:
>
> SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
>
> I get "C" for MID1 but I also get "C" for LAST1, not "B" as I
> expect. Am I using the serout/serin wrong or would the problem be
> elsewhere in my code?
Comments
I am communicating between 2 BS2's using RF. I use the following line of code to
send data out on the first BS2:
SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",data2,"B"]
and the following to receive it on the second BS2:
SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
I get "C" for MID1 but I also get "C" for LAST1, not "B" as I expect. Am I using
the serout/serin wrong or would the problem be elsewhere in my code?
Jerry...
parkiss@e... writes:
> Jerry-
> Try the following instead:
> SEROUT 5,396,[noparse][[/noparse]"A",DEC data1,"C",DEC data2,"B"]
> SERIN 5,396,[noparse][[/noparse]WAIT("A"),DEC data1,MID1,DEC data2,LAST1]
Thanks Steve. I believe you nailed it. When I was home at lunch I tried it
and it worked. Data1 and data2 are both numeric and I had thought that I had
used the dec modifier on both but had not....Also noticed that the
transmission to and from the remote was faster.
Jerry