%
;ModBus 'running light'

#<loop> = 0
o20 repeat [1000]

#<loop> = [#<loop> + 1]
(status,Loop: #<loop,0>)

#<pinlast> = 0
#<pin> = 1
o100 while [#<pin> LT 8]
  (expr,exec(#<pinlast>, 0, "#mb_relay"))
  (expr,exec(#<pin>, 1, "#mb_relay"))
  ;G04 P0.2
  G09
  #<pinlast> = #<pin>
  #<pin> = [#<pin> + 1]
o100 endwhile

o100 while [#<pin> GE 0]
  (expr,exec(#<pinlast>, 0, "#mb_relay"))
  (expr,exec(#<pin>, 1, "#mb_relay"))
  ;G04 P0.2
  G09
  #<pinlast> = #<pin>
  #<pin> = [#<pin> - 1]
o100 endwhile

o20 endrepeat
(expr,exec(0, "#mb_relayall"))
%
