Jump to content

Question about the repeat command


Blackbird

Recommended Posts

Can you use the "Repeat" command in a program, to only repeat the line above it or does it repeat all lines within the "then" group?  For example when I close my back door I want a few lights to go out but sometimes they don't always go out so I wanted to only repeat the porch light turning off.

 

Thanks

Link to comment

Since the topic is about the command itself, I'll add the placing one or more statements between Repeat 0 times and Repeat 1 time has the same effect as REMing those statements. The ISY does not provide a REM command. Great for troubleshooting a program.

Link to comment

The Repeat range is to the end of the clause (Then or Else), or to the next Repeat.  In this example the Set, and all statements after that are repeated

 

Then
        ....
        Repeat 3 times
           Set 'ICON Relay 2' Off
            statement 1
            statement 2
Else 
 
In this example the Set is the only statement that is repeated
 
Then
        ....
        Repeat 3 times
           Set 'ICON Relay 2' Off
        Repeat 1 time
           statement 1
           statement 2
Else
Link to comment

 

Perhaps that was not the question.

 

I thought I made it clear that I was referring to the topic, specifically, Question about the repeat command

 

Since the topic is about the command itself ...

 

I guess I wasn't specific enough.

 

Lee, you are correct. I should not be so terse B)

Link to comment
  • 1 year later...

Perhaps.  But if you want to truly dishearten a customer, you develop tools that frustrate them for hours because of something that isn't consistent with almost every programming language out there.  The syntax looks more like a workaround.

Link to comment

Just your old fashioned "repeat until" loop that's been around for many years. Fairly standard, only with a few different words.

 

The until is just repeat 1 (once).

Totally intuitive, but intuitive is only relative to your experience. We weren't born programming via a keyboard. QWERTY? Really? I have used many different styles of languages. There is no "intuitive". There is no standard style of repeat.

 

The admin console even indents the contents for you so you now where it begins and ends (even without those words Mr. Pascal). That is way past where I started programming.

 

Now for the syntax quirk. You should love this one.

 

..."Repeat 1 times"

doesn't repeat the loop at all. It only executes it once. :)

 

Have a good one!

Link to comment

If UD just put a note there that said "to end repeat, select repeat 1 times" that would take care of it.  

Add an "end" to the pulldown menu list of times was suggested before.

 

Repeat X times

...do something

Repeat End

 

Like any other language you have to learn the syntax and then use it.

Link to comment

Add an "end" to the pulldown menu list of times was suggested before.

 

Repeat X times

...do something

Repeat End

 

Like any other language you have to learn the syntax and then use it.

If you are going to do that, I would put it in the pull down column that includes the "for/while/etc".  

Link to comment

Sure, but I am waiting for logic line enable trigger options first, well at least for a repeating while  :)

I'm not sure what you mean.  But "repeat while" is an option, I believe this is a new option in the 5.x

 

It includes integer variables as options for repeat while, so I guess it actively checks with each cycle?

Link to comment

I'm not sure what you mean.  But "repeat while" is an option, I believe this is a new option in the 5.x

 

It includes integer variables as options for repeat while, so I guess it actively checks with each cycle?

It was an attempt at a pundle.

I thought you would be right on top of V5.

 

Have  a look as this usage for the repeat while....

http://forum.universal-devices.com/topic/18921-v5-averaging-using-only-the-best-values/

Link to comment

Glad to add a little humor into a thread. Still stay not intuitive even compared to assembly language on a Pdp-11. Plenty of experience here.

 

 

Sent from my iPhone using Tapatalk

5x is not an option until it is released.

 

 

Sent from my iPhone using Tapatalk

Link to comment

Glad to add a little humor into a thread. Still stay not intuitive even compared to assembly language on a Pdp-11. Plenty of experience here.

 

 

Sent from my iPhone using Tapatalk

5x is not an option until it is released.

 

 

Sent from my iPhone using Tapatalk

PDP-11?  No PDP-8? Just a newbie! :)

Link to comment

Okay, this thread has me a little confused.  I wrote this little program to demonstrate my question. 

 

I want to water in some grass seed on the back lawn that suffered some winter/dog damage.  Is there a way, within this program, to have the repeat clause reevaluate the conditions in the "if" statement prior to each repeat cycle (the climate module stuff is dynamic and would optimally be reevaluated each time the program repeats)?  I was fairly certain that the "if" clause isn't reevaluated with each repeat cycle, but suddenly I'm unsure about that.  Normally, I'd use one program to call other programs based on values from the climate module to accomplish this.  Is that correct?

BackLawnReSeed - [ID 008A][Parent 0089]

If
        From     7:00:00AM on 2017/05/05
        To      10:00:00PM on 2017/05/20
    And (
             From    Sunrise +  4 hours 
             To      Sunset  -  1 hour  (same day)
         And (
                  Module 'Climate' Temperature > 50 °F
              And Module 'Climate' Total Rain Today < 0.2 "
              And Module 'Climate' Wind Speed < 15 mph
             )
        )
 
Then
        Repeat Every  2 hours 
           Set 'Devices / dirNodeServers / RainMachine / RainMachine / Rear Lawn' Start
           Wait  10 minutes 
           Set 'Devices / dirNodeServers / RainMachine / RainMachine / Rear Lawn' Stop
 
Else
   - No Actions - (To add one, press 'Action')
 

Thanks in advance.  This forum is invaluable!

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...