Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: while command

while command 4 years 6 months ago #1385

Hi
I like to use the while command as follow

while( a and not b)
....
loop

but the sm2 interface does not allow me to do that.
May I know what is the possible work around?
Thank you very much
The administrator has disabled public write access.

Re: while command 4 years 6 months ago #1387

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
If you have firmware version 5.0x or above, you can do math operations with more than two operators. If you are using firmware less than 5.0x, the math is has to be done with only two operators.
In either case, it may be easier to use another variable. Something like the following would work with any firmware revision.

WHILE c
'solve the value for c with IF/ENDIF statements
IF a==1
If b!=1
c=1
ELSE
c=0
ENDIF
ENDIF
....
LOOP
Last Edit: 4 years 6 months ago by csearcy.
The administrator has disabled public write access.

Re: while command 4 years 6 months ago #1389

Hi Csearcy
Thank you very much for your advise.
I need to modify a bit of your suggestion so that is suits my application.

c=1
WHILE c
'solve the value for c with IF/ENDIF statements
IF a==1
IF b!=1
c=1
ELSE
c=0
ENDIF
ELSE
c=0
ENDIF
....
LOOP
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.261 seconds