Conditional logic within the Kramer Control Builder adds the capability for IF – THEN programming. IF – THEN programming enables the designer to create scenarios within the programming based on state changes of equipment. Logic programming has options for IF, ELSEIF, ELSE, AND, and OR.
This article explains and provides short examples of the logic statement options found within the Builder.

IF

The IF within a logic statement is the anchor. When building a logic statement you start with the first scenario and build other scenarios based on this initial statement. The application tries to match the scenarios in the order that they appear within your logic statement. The top line of the statement is the initial IF statement.

Example of an IF statement: IF – InputState = BD/DVD then UpdateImage to Blu Ray graphic ENDIF

ELSEIF

ELSEIF is a secondary scenario that can occur based on the state of the equipment. Some states have multiple possibilities. For example, the source state of a switcher in a scenario where we are building a logical statement to update image properties for each source that is being used within the space.

Example of an ELSEIF statement based on the example above:
IF – InputState = BD/DVD then UpdateImage to Blu Ray graphic ELSEIF InputState = CBL/SAT then UpdateImage to DirecTV graphic ELSEIF – InputState = CD then UpdateImage to Sonos graphic ENDIF

AND

Within a logic statement AND is used to to compound the scenario where the THEN scenario only occurs once multiple conditions are met.

An example of an AND statement based on the example above:
IF – InputState = bd/dvd AND PowerState = Power On then UpdateImage to selected Blu Ray graphic ELSEIF InputState = CBL/SAT AND PowerState = Power On then UpdateImage to Selected DirecTV log graphic ELSEIF – InputState = CD AND PowerState = Power On then UpdateImage to Selected Sonos graphic ENDIF

OR

Within a logic statement OR is used as an alternative possibility to your IF statement. Much like an ELSEIF multiple OR conditions can be added to the statement.

For example:
IF – InputState = bd/dvd OR InputState = vcr/dvr AND PowerState = Power On then UpdateImage to selected Blu Ray graphic ELSEIF InputState = CBL/SAT AND PowerState = Power On then UpdateImage to Selected DirecTV log graphic ELSEIF – InputState = CD AND PowerState = Power On then UpdateImage to Selected Sonos graphic ENDIF

ELSE

An ELSE condition is used when you are only concerned about a single state. An ELSE means anything but.

The example below follows the example of inputs much like the other example in the article, but here, we are only concerned with the BD/DVD input:
IF – InputState = bd/dvd AND PowerState = Power On then UpdateImage to selected Blu Ray graphic ELSE UpdateImage to Power Graphic ENDIF

ELSE statements are typically used when you have two possible scenarios. Tracking the Mute state of a device typically looks like this:
IF – MuteState = Mute On then UpdateImage to pressed Mute graphic ELSE UpdateImage to default Mute Graphic ENDIF

State Based Image Changes

State based image changes similar to what was discussed above can be found here.

Revision: 10
Last modified: 5 July 2018

Réaction

Était-ce utile?

Oui Non
Vous avez indiqué que ce sujet ne vous a pas été utile ...
Pouvez-vous SVP laisser un commentaire nous disant pourquoi? Merci!
Merci pour vos commentaires.

Laissez votre avis sur ce sujet.

Valider

Kramer Control Representative a écrit: Oct 11, 2017

How are you trying to add additional actions to the conditional? You can click on the +Condition next to the IF to add ELSE, ELSEIF, OR, AND. Adding commands or other actions to a condition requires that you drag the action to the IF statement.


William Jensen a écrit: Oct 8, 2017

I can only get an "if" statement and I can't add anything extra in before the "END"