News:

;) This forum is the property of Proton software developers

Main Menu

Serin and serout

Started by Ivano, Today at 08:02 PM

Previous topic - Next topic

Ivano

Good evening, I have a question about the Serin or serout command.
In the example, SerIn PORTA.1,84,1000,continue,[A].
Does continue mean that after the timeout, it skips to the next instruction after serin, or does it resume the serin command?
It seems to me that after the timeout, it resumes from serin. Is this correct?
Thanks, Ivano

RGV250

Hi,
I haven't got access to PC at moment but I would say it jumps to a label "continue" or whatever you call the timeout.

Bob

JackB

#2
Hi Ivano,

about ( SerIn PORTA.1,84,1000,continue,[A]. )


the way I use it is within a Do-Loop or Goto Main

usualy the "Timout" Label indicate where will be the next instruction to follow, then you can decide to Loop again
or use a Goto statement.

In the sample code below the "main'" timeout label redirect to the "main:" label after a timout.

'Serin
main:
    SerIn PORTB.5,BaudR,3,main,[B1] 
If B1 < 253 Then   ' Characters
        PORTC = B1 : High En : DelayUS 1 : Low En
GoTo main



see Positron8 Basic Compiler Manual page: 241 for more details.

Here's a sumary :

Timeout is an optional constant (0 - 65535) that informs Serin how long to wait for incoming
data. If data does not arrive in time, the program will jump to the address specified by Tlabel.
Tlabel is an optional label that must be provided along with Timeout, indicating where the program jump to in the event that data does not arrive within the period specified by Timeout. It
can also be the compiler directives; Break or Continue, if the command is used inside a loop.
Break will exit a loop if a timeout occurs, and Continue will re-iterate the loop.