The :readmath: getElement makes the buttons work fine. Unfortunately the indicator light is always on. It never turns off. Below is the setup code I have from your suggestion:
#cmdSetup buttonsOn Output
:read: AXIS1.ACTIVE?
:readmath: getElement("AXIS1.DIS AXIS1.EN",value)
:write: txrx #
:tip: Disable (Off) or Enable (On)
:color: (0,255,0)
:updatealloff:
Off AXIS1.DIS
On AXIS1.EN
I tried a few variations but nothing ever got the indicator light to turn off. Below is debug output right from startup to just opening the control popup. The device is off and the light should be off but is on. The debug output shows the :read: giving 0 back.
Starting
;; Start thread for: 192.168.1.178 - Kollmorgen AKD2G Servo
;; Found Kollmorgen AKD2G Servo on 192.168.1.178
;; AKD2G: Tx <AXIS1.ACTIVE?>
;; AKD2G: Tx <txrx? AXIS1.ACTIVE>
;; 192.168.1.178: Tx: <AXIS1.ACTIVE..> 41 58 49 53 31 2E 41 43 54 49 56 45 0D 0A
;; 192.168.1.178: Rx: <0> 30 0D
;; AKD2G: Rx <0>
;; AKD2G: Rx after :readmath: getElement("AXIS1.DIS AXIS1.EN",value) <AXIS1.DIS>
;; AKD2G: Rx as number <NaN>
If I do the exact same sequence but have the output already On the result is the same except the :read: gives "1" back which selects "AXIS1.DIS". Even though the read state is opposite the other the indicator light is still on.
Starting
;; Start thread for: 192.168.1.178 - Kollmorgen AKD2G Servo
;; Found Kollmorgen AKD2G Servo on 192.168.1.178
;; AKD2G: Tx <AXIS1.ACTIVE?>
;; AKD2G: Tx <txrx? AXIS1.ACTIVE>
;; 192.168.1.178: Tx: <AXIS1.ACTIVE..> 41 58 49 53 31 2E 41 43 54 49 56 45 0D 0A
;; 192.168.1.178: Rx: <1> 31 0D
;; AKD2G: Rx <1>
;; AKD2G: Rx after :readmath: getElement("AXIS1.DIS AXIS1.EN",value) <AXIS1.EN>
;; AKD2G: Rx as number <NaN>
So, what is used to decide the indicator light being on/off? Or, better yet, how to make it work?