Exec command2 based on two evaluations

You have a question or need an advice about how to do something? Ask it here!
Post Reply
andrerotgans
Posts: 192
Joined: 27 Nov 2012 13:23
Exec command2 based on two evaluations

Post by andrerotgans »

Hi Bernd,

Is it possible to use the exec command2 command with two evaluations? I want to execute a command only when two conditions are met. I've tried to combine them into one command, but can't seem to get it working.

something like this:

exec_command2 state_src_sel.4|Equals(1)|exec_command2 ${cplautoplay}|Equals(0)|PLS_CURRENT_PLAY_NEXT

Best regards,
André
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Exec command2 based on two evaluations

Post by radio42 »

Yes, 'chaining' 2 or more EXEC_COMMAND2 commands should work.
Could you send me a valid example, as the one you posted is of course not working, as
a) It should be EXEC_COMMAND2 and not exec_command2
b) state_src_sel.4 doesn't seem to be a valid parameter
andrerotgans
Posts: 192
Joined: 27 Nov 2012 13:23
Re: Exec command2 based on two evaluations

Post by andrerotgans »

Hi,

The capitals (or, the missing capitals ;) was a typo... I'll give it a try when I'm on site. The state_src_sel.4 was an experiment to see if it is possible to grab the state of an input selector on a Airlite channel. Or is that not possible to use in a evaluation?
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Exec command2 based on two evaluations

Post by radio42 »

You can use any defined and allowed macro.
All macros are fully documented in the User Manual Appendix.
All macros do have the form ${...}.
So your 'state_src_sel.4' is of course not a valid parameter ;-)

If you want to keep track of the state of a certain D&R Airlite SWITCH or STATE; you can and must do so yourself in your related Airelite mapping. E.g. based on the value of your switch or state you might execute the EXEC_VAR_SET controll-command to define a value of your own user defined variable.
You can then reference the variable value back in your conditional command with the via the ${VAR:name} macro.

Example:
In your D&R Airlite mapping (e.g. in the GPIO Client application) you might execute the following commands:
EXEC_VAR_SET AirliteState4|1
resp.
EXEC_VAR_SET AirliteState4|0

Note:
EXEC_VAR_SET <name>|<value>
The <name> is your user defined variable name; and <value> is the value of that variable to set.
In this example you set the variable with the name AirliteState4 to either 0 or 1 (depending on the actual state, i.e. in one Airlite mapping entry you set it to 1 and in another back to 0).

In your conditional command (e.g. within ProppFrexx ONAIR) you then can use this variable like this:
EXEC_COMMAND2 ${VAR:AirliteState4}|Equals(1)|EXEC_COMMAND2 ${cplautoplay}|Equals(0)|PLS_CURRENT_PLAY_NEXT
andrerotgans
Posts: 192
Joined: 27 Nov 2012 13:23
Re: Exec command2 based on two evaluations

Post by andrerotgans »

Hi Bernd,

Yes, i already thought about that solution. But, is there a way to get the initial state of that selector/switch at the start of PFOA. To check if it is selected or not. I can do that manually by pressing the switch (forcing it in it's 'other' state, setting the variable) and pressing it again, using the way you describe it by mapping it in the GPIO client.
But maybe there is another way of doing that?

Best regards,
André
andrerotgans
Posts: 192
Joined: 27 Nov 2012 13:23
Re: Exec command2 based on two evaluations

Post by andrerotgans »

I want to use a condition on the ON button for the USB channels. Normally they'll fire of play in PFOA. But, when PFOA is in autoplay or the input source of that particular channel is on line (instead of USB), I don't want PFOA to react.
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Exec command2 based on two evaluations

Post by radio42 »

No, there is currently no way to get the initial status.
But 'where' (in which event) do you want to use the EXEC_COMMAND2 ? Would you use that somewhere else than in an 'Airlite' event itself?
As, if you are anyhow using it in an 'Airlite' event this wouldn't be needed...
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Exec command2 based on two evaluations

Post by radio42 »

I'll see, if I can add any additional Airlite macro's - not sure, if that possible, but I'll check that...
andrerotgans
Posts: 192
Joined: 27 Nov 2012 13:23
Re: Exec command2 based on two evaluations

Post by andrerotgans »

I see something in the release notes of the new version!

GPIO Client macros added
Various macros have been added to the GPIO Client Application to determine the state of the remote control interface.

Thanks!

Post Reply