Jump to content

Cycle through multiple programs on one KPL button?


hargray2

Recommended Posts

I have an HDMI matrix switch that I am controlling via rs232 with a global cache itach. I have created the network resources and programs to switch between four different HDMI inputs on the matrix switch.

There are four programs, one for each input. Is it possible to set up a single KPL button to cycle through the programs? Each button press would run the next program, allowing me to cycle through the inputs on the HDMI switch.

 

I have tested all of the programs manually from the ISY admin console and they work great. I just can't figure out how to do this with a single KPL button. It would also be very nice to have this on a single remotelinc button if possible. Any help would be greatly appreciated.

 

Thanks

 

Daniel

Link to comment

Create a state variable to track the current mode init it to 0 current state 0. For this we will call it matrix mode

Set one button to be always on (of off if you prefer to backlit)

Write a program that increments the variable

 

if CONTROL keypadbutton X is ON

then

matrixmode += 1

 

Write a limit program that ensures we 'roll over' when the limit goes to high:

 

if maxtrixmode > 3

then

matrixmode = 0

init matrixmode to matrixmode

else

init matrixmode to matrixmode

 

(this ensures the variable is init'd to the current state no matter what)

 

Write one program for each level:

 

if matrixmode is 0

then

networkresource 1

 

if matrixmode is 1

then networkresource 2

 

etc

 

That should do it for you.

 

Best,

Bill

Link to comment

Thanks for the fast response. Correct me if I'm reading it wrong, but at first glance it looks like this requires the ability to know which input the switch is on. The switch doesn't have the ability to be queried and doesn't reply in any way when an input is switched. It is receive only.

 

Will this work without knowing the actual state of the hdmi switch?

 

Daniel

Link to comment

You could refine it a little an drop one program

 

Not sure I understand your last question. These programs will run 3 network resources sequentially with each sequential push of the KPL button.

 

 

  
IF
$matrixmode is <3   

THEN
set $matrixmode += 1
init $matrixmode to $matrixmode

ELSE
set $matrixmode = 0
init $matrixmode to 0

Write one program for each level:

  
IF 
KPL button is switched on
and $matrixmode = 0

THEN 
networkresource 1
run first program "if"

ELSE
- - 

  
IF 
KPL Button is switched on
and $matrixmode is 1

THEN
networkresource 2
run first program if

ELSE
- - 

 

Etc.

Link to comment

So this is just a coding style comment but the reason I rely on the state variables is so I don't have to put the trigger button into each program. This allows me to change just one program if I decide I want a different button or additional button to drive the programs.

Link to comment
So this is just a coding style comment but the reason I rely on the state variables is so I don't have to put the trigger button into each program. This allows me to change just one program if I decide I want a different button or additional button to drive the programs.

 

 

Makes sense. You can also use ISY's Find and Replace function also, assuming you have the programs all next to each other, if you start with the first one you just hit the "replace in selected" button then find and it will jump to the next where you hit "replace" again and so forth till you get to the last one.

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...