ScriptName "LON - Beispiel" ScriptAuthor " Name " ScriptVersion "V X.Y" var InMapsize : word; var OutMapsize : word; var InMapTable: buffer[10]; var OutMapTable: buffer[10]; moveConst( InMapsize, 5); moveConst( OutMapsize, 5); moveConst( InMapTable[0], #36#37#83#88#93 ); moveConst( OutMapTable[0],#36#37#83#88#93 ); LonInMapping( InMapTable[0], InMapsize); LonOutMapping(OutMapTable[0], OutMapsize); var SelfDocsize : word ; moveConst( SelfDocsize, 60); var SelfDocBuffer: buffer[60]; moveConst( SelfDocBuffer[0], "Hallo World 3456789012345678901234567890abcdefghijklmnopqrst" ); LonSelfDocString( SelfDocBuffer[0], SelfDocsize); Set ( LONProgramID , 123456 ) ; Var b : BUFFER [63] ; Var s : BUFFER [63] ; Var l : BUFFER [63] ; Var k : BUFFER [63] ; var size : word ; Var time : word ; var v1 : long ; moveconst ( size, 11); MoveConst ( time, 10); //Set ( BusInputSize, 1 ); //Set ( BusOutputSize, 1) ; BusStart ; Wait ( Bus_Active ) ; Set (RS_State_LED, RedGreenFlashing ); :start ; ReceiveSomeCharRS ( time , s[0] , size ) ; if s[0] notequal l[0] then :write_bus else :read_rs ; :write_bus; Copy ( s[0], l[0], size ); WriteBus (s[0], size ) ; Set (RS_State_LED, StaticGreen ); :read_rs ; ReadBus ( b[0], size); if b[0] notequal k[0] then :write_rs else : start; :write_rs; Copy ( b[0], k[0], size ) ; SendRS ( b[0], size) ; Set (RS_State_LED, StaticGreen ); jump :start;