How to show button using if-then condition
Posted: Tue Dec 19, 2023 5:20 pm
Hello, I have begun customizing my Acorn VCP. I have a KP-3 touch probe and probe detect is on Input 6 of Acorn, whereas probe tripped is on Input 7.
I would like to add a probe display (not press button) with conditional appearance combining inputs 6 and 7. For example, if Input 6 is OFF, there would be one SVG image (say "probe not present") . If input 6 is ON and Input 7 is OFF the button shows one way (e.g. probe present in green; that would be the default, probe connected but not tripped). If tripped, it would show "Tripped" in red.
I was able to create two buttons (probe_detected reading input 6 and probe_tripped reading input 7) with the desired functionality, but would like to combine them. Is there a specific syntax I can use in the xml. Apologies if this is trivial, I have no xml experience. The esthetics of these buttons are irrelevant for now, and I will ultimately combine them into one informational display, but I need to know how to use both inputs with the if-then clause. THANK YOU.
This is what I have so far:
I would like to add a probe display (not press button) with conditional appearance combining inputs 6 and 7. For example, if Input 6 is OFF, there would be one SVG image (say "probe not present") . If input 6 is ON and Input 7 is OFF the button shows one way (e.g. probe present in green; that would be the default, probe connected but not tripped). If tripped, it would show "Tripped" in red.
I was able to create two buttons (probe_detected reading input 6 and probe_tripped reading input 7) with the desired functionality, but would like to combine them. Is there a specific syntax I can use in the xml. Apologies if this is trivial, I have no xml experience. The esthetics of these buttons are irrelevant for now, and I will ultimately combine them into one informational display, but I need to know how to use both inputs with the if-then clause. THANK YOU.
This is what I have so far:
Code: Select all
<vcp_button>
<plc_input>
<number>6</number>
<image_on>probe_detected_yes.svg</image_on>
<image_off>probe_detected_no.svg</image_off>
</plc_input>
</vcp_button>
Code: Select all
<vcp_button>
<plc_input>
<number>7</number>
<image_on>probe_trip.svg</image_on>
<image_off>probe_clear.svg</image_off>
</plc_input>
</vcp_button>