exporting a value of time via serout

friis

Senior Member
Hi,
I am trying to export a value of time from 08M2 to 18M2 via serout c.1, n2400 ,("ABC", tael, time).
I have also tried:
symbol tid = w0
tid = time
serout c.1,n2400, ("ABC", tael, bo,b1) as well as various other forms.

time works OK, but in serout it never gets higher that 255.
Can any one tell me how I export a value of time and how I import it at the other end?

In the 18M2 I use the sleep command and can therefore not use time.
best regards
torben
 

hippy

Technical Support
Staff member
The 'time' variable is a 16-bit word variable and SEROUT only allows 8-bit bytes to be sent. The easiest way to send 'time' is to move it into a 'w' word varaible then send its component byte parts, and re-assemble them after they are received. In this case b1 and b0 are the component parts of w0 -

; Sender
w0 = time
SerOut c.1, n2400, ( "ABC", b1, b0 )

; Reciever
SerIn ?.?, n2400, ( "ABC"), b1, b0

The receiver will then be holding the value of 'time' in its 'w0' variable.
 

friis

Senior Member
Hi hyppy,
Thank you very much. That must be the one combination I did not try.
best regards
torben
 
Top