Your Universal Remote Control Center
RemoteCentral.com
RTI Control Systems Forum - View Post
Previous section Next section Previous page Next page Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Page 2 of 2
Topic:
Test Flag Issue?
This thread has 26 replies. Displaying posts 16 through 27.
Post 16 made on Monday September 24, 2007 at 22:28
Ernie Bornn-Gilman
Yes, That Ernie!
Joined:
Posts:
December 2001
30,104
On September 24, 2007 at 10:51, tgrugett said...
I am not clear on this. The line that says what to do
if the flag is set IS the first line of a flag test?

No. It's the second line. You tell the thing to do something after it has tested the flag and, I guess, holds the Flag Test result in memory.
You can not have a line asking what to do if the flag
is set unless you have a flag test inserted.

Exactly. You cannot have a line asking what to do if the flag
is set unless you have a Flag Test inserted. Flag Test. Capitalized, because it's one of the choices in the program under Command type: Flag.

This answer sounds like a line from "Who's On First." Or that funny exchange in Rush Hour 3.

What seems dumb to me, but I now just accept, is that you have to do

Flag Operation -- Test flag (and name the flag),

before you put in the Clear Flag, Set Flag, or Toggle Flag operation. I assumed that IF statements would look all on their own to see what the state of the thing is. But nooooooo.
A good answer is easier with a clear question giving the make and model of everything.
"The biggest problem in communication is the illusion that it has taken place." -- G. “Bernie” Shaw
Post 17 made on Tuesday September 25, 2007 at 01:54
fluid-druid
Senior Member
Joined:
Posts:
June 2005
1,312
I didnt' read all responses so this may be duplication, but I think I see the error.

Where are the flags being SET? I see 2 flags ("Zone 1 ON" and "System ON").

Is it possible that the "System Macro: Zone 1 ON" macro SETS the "System ON" flag?
If so, the next line, which test for the "System On" flag will ALWAYS be true.... and the delay will never happen.

Also, the "Zone 1 Start Volume" is outside of the If/Else brackets. Therefore it will ALWAYS run no matter what.

Another thing: Are you sure that your receiver doesn't have a setting for Power On Volume? I know the Denons do.
...couple a thumb tacks and a stick of double sided tape should hold this baby up...
Post 18 made on Tuesday September 25, 2007 at 02:42
estech
Active Member
Joined:
Posts:
August 2002
584
On September 24, 2007 at 22:28, Ernie Bornn-Gilman said...
What seems dumb to me, but I now just accept, is that
you have to do
Flag Operation -- Test flag (and name the flag),
before you put in the Clear Flag, Set Flag, or Toggle
Flag operation. I assumed that IF statements would look
all on their own to see what the state of the thing is.

I think you are mistaken. Any Flag Operation (clear, set, toggle, test) can be programmed into a macro at any time. However, the order in which they are executed will obviously affect the course of the program. It wouldn't make sense to execute a Flag-Test without some previous intentional Flag operation.

The Flag-Test is an If statement. The operation(s) performed are determined by the condition of the flag being tested.
Pay no attention to that man behind the curtain.
OP | Post 19 made on Tuesday September 25, 2007 at 02:53
tgrugett
Select Member
Joined:
Posts:
August 2004
1,850
On September 25, 2007 at 01:54, fluid-druid said...
I didnt' read all responses so this may be duplication,
but I think I see the error.

Where are the flags being SET? I see 2 flags ("Zone
1 ON" and "System ON").

Is it possible that the "System Macro: Zone 1 ON" macro
SETS the "System ON" flag?
If so, the next line, which test for the "System On" flag
will ALWAYS be true.... and the delay will never happen.

Nice call. I think that may be the issue. I will test the process again and I will immediately eat my words if that was the issue.

Also, the "Zone 1 Start Volume" is outside of the If/Else
brackets. Therefore it will ALWAYS run no matter what.

This is desired because it is still within the else statement of the zone 1 on test. The zone 1 start volume is always set when zone 1 is powered on regardless of the system state.
Another thing: Are you sure that your receiver doesn't
have a setting for Power On Volume? I know the Denons
do.
Post 20 made on Tuesday September 25, 2007 at 05:30
Springs
Super Member
Joined:
Posts:
May 2002
3,238
Just a question... was it too big to email? Or were you protecting your programing, or something?

I had to do several check flag set flags all with in the same macros recently. I had to draw a flow chart to folow what set and what read and were to stop. I think its about the only way to make sure you get it right. Well aside from the "press and pray approach".
Post 21 made on Tuesday September 25, 2007 at 05:55
Ernie Bornn-Gilman
Yes, That Ernie!
Joined:
Posts:
December 2001
30,104
On September 25, 2007 at 02:42, estech said...
I think you are mistaken. Any Flag Operation (clear,
set, toggle, test) can be programmed into a macro at any
time.

Okay.

However, the order in which they are executed will
obviously affect the course of the program. It wouldn't
make sense to execute a Flag-Test without some previous
intentional Flag operation.

Not at all true. You operate the Flag Test to determine the state of the Flag so that the next command,
IF flag is set do this, ELSE do that
will know the state of the flag. If you don't do the Flag Test, the IF/ELSE command will always act as though the flag has not been set.
The Flag-Test is an If statement. The operation(s) performed
are determined by the condition of the flag being tested.

No, the Flag Test is "Tell me which state the Flag is in." Once that is known, IF/ELSE statements can work with the now known flag state.

What still doesn't make sense to me is that the Flag Test is needed at all. I would think that the operation of "IF Flag is Set" would include looking at the flag to see if it is set, but it doesn't. That's what I said that I think is dumb.

Hey, maybe I'm wrong about this. But my experience has been that IF/ELSE statements work when preceded by a Flag Test and don't work when not.

And don't forget to include the command that sets or unsets the flag to be ready for the next process.
A good answer is easier with a clear question giving the make and model of everything.
"The biggest problem in communication is the illusion that it has taken place." -- G. “Bernie” Shaw
Post 22 made on Tuesday September 25, 2007 at 08:13
imt
Long Time Member
Joined:
Posts:
June 2007
466
On September 23, 2007 at 03:09, tgrugett said...

The start volume should only be applied if the zone was
previously off regarless of the system on status.

The issue you originally stated was that you were not getting your 4 second delay.
This is in the Zone on test flag.

If you look at your diagram, the start volume is outside the else satement for the Zone on, so it runs no matter what. Therefore, it would be the same if you put that statement both in the IF portion and the ELSE portion of the Zone On stmt. Yes its redunadant but only brought that up since someone mentioned the issue could stem from having nothing in the IF portion of the test flag. Thought it was a better idea instead of sending a command from a non-existing component.
Post 23 made on Tuesday September 25, 2007 at 08:26
imt
Long Time Member
Joined:
Posts:
June 2007
466
On September 25, 2007 at 05:55, Ernie Bornn-Gilman said...
Not at all true. You operate the Flag Test to determine
the state of the Flag so that the next command,

IF flag is set do this, ELSE do that
will know the state of the flag. If you don't do the
Flag Test, the IF/ELSE command will always act as though
the flag has not been set.

I don't understand what you are saying. The flag test option is an IF/THEN/ELSE statement. You can't do a flag test to determine state and then do a separate IF/THE/ELSE statement.

The flag test is

IF yourflagname is SET then do the following operation

ELSE (IF NOT SET) THEN DO THIS OPERATION

END or _____________________________________


No, the Flag Test is "Tell me which state the Flag is
in." Once that is known, IF/ELSE statements can work
with the now known flag state.

No. as stated above, the flag test tests if the flag is set and then performs the operations between this line and the else staement. If its not set it performs everything after the Else.

What still doesn't make sense to me is that the Flag Test
is needed at all. I would think that the operation of
"IF Flag is Set" would include looking at the flag to
see if it is set, but it doesn't. That's what I said
that I think is dumb.

It does look but I would imagine the issue could stem from the fact that the flag was never set in the first place. The first operation that runs on a remote, like power system up, should set the state of all of the flags. Not sure if this is the case, but if the flag was never initialized, set to ON or OFF in the first place, the flag test might not work properly.


Hey, maybe I'm wrong about this. But my experience has
been that IF/ELSE statements work when preceded by a Flag
Test and don't work when not.

Still do get it becuase the Flag test is an IF/ELSE statement on its own.

And don't forget to include the command that sets or unsets
the flag to be ready for the next process.

I agree.
Post 24 made on Tuesday September 25, 2007 at 11:01
estech
Active Member
Joined:
Posts:
August 2002
584
On September 25, 2007 at 05:55, Ernie Bornn-Gilman said...
Not at all true. You operate the Flag Test to determine
the state of the Flag so that the next command,
IF flag is set do this, ELSE do that
will know the state of the flag. If you don't do the
Flag Test, the IF/ELSE command will always act as though
the flag has not been set.

What still doesn't make sense to me is that the Flag Test
is needed at all. I would think that the operation of
"IF Flag is Set" would include looking at the flag to
see if it is set, but it doesn't. That's what I said
that I think is dumb.

Hey, maybe I'm wrong about this. But my experience has
been that IF/ELSE statements work when preceded by a Flag
Test and don't work when not.

Ernie
The Flag-Test and the If/Else statement are the same command in RTI-TTD. It always starts with a test for a Set condition and then performs the programmed steps that follow, according to whether they're before or after the Else.

The Flag-Set or Flag-Clear (or Toggle) that has occurred prior to the Test will determine on which side of the Else the program flows.
Pay no attention to that man behind the curtain.
OP | Post 25 made on Tuesday September 25, 2007 at 12:09
tgrugett
Select Member
Joined:
Posts:
August 2004
1,850
On September 25, 2007 at 05:30, Springs said...
Just a question... was it too big to email? Or were you
protecting your programing, or something?

I had to do several check flag set flags all with in the
same macros recently. I had to draw a flow chart to folow
what set and what read and were to stop. I think its about
the only way to make sure you get it right. Well aside
from the "press and pray approach".

I had already changed the macro in question so it was moot to send the file (I had mentioned this in an earlier post) and given the likely issue, I would have had to change the macro to its current state anyway.

I have been setting and clearing flags at the root level inside of smaller system macros that I will call in larger activity macros as much as possible which has made tracking much easier. This usually means that a flag is set or cleared in only one place. My activity macros end up looking very simple and rarely do I set or clear a flag in these larger macros.
OP | Post 26 made on Tuesday September 25, 2007 at 12:35
tgrugett
Select Member
Joined:
Posts:
August 2004
1,850
Too bad TTD doesn't have a flag test that goes like this...

If System On flag was set before I overlooked the fact that System On flag was set then...

Classic... I knew somehow as I was typing the words ..."my flag logic is flawless" that I may end up regreting it :)
Post 27 made on Tuesday September 25, 2007 at 23:58
Ernie Bornn-Gilman
Yes, That Ernie!
Joined:
Posts:
December 2001
30,104
On September 25, 2007 at 08:26, imt said...
I don't understand what you are saying. The flag test
option is an IF/THEN/ELSE statement. You can't do a flag
test to determine state and then do a separate IF/THE/ELSE
statement.

You're right. I'm dead wrong. I was remembering that something didn't make sense about the process, and I remembered it wrong. So it's my turn to be an idiot.
The flag test is

IF yourflagname is SET then do the following operation

ELSE (IF NOT SET) THEN DO THIS OPERATION

END or _____________________________________

Yuppers. It sure is. It's exactly what I was claiming was two commands.

The part that I had a hard time with is that Flag Test not only checks the flags, but then also does an operation based on the status of the flag. Somehow when I started I thought that "test" didn't also mean "act on the result of the test."

On September 25, 2007 at 12:35, tgrugett said...
Classic... I knew somehow as I was typing the words ..."my
...logic is flawless" that I may end up regretting it.
:)

That's why I rarely type those words, but whatever I write just oozes with the concept that I'm right, because I believe in it. Too bad I chose to believe the wrong thing this time.
A good answer is easier with a clear question giving the make and model of everything.
"The biggest problem in communication is the illusion that it has taken place." -- G. “Bernie” Shaw
Page 2 of 2


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse