I tried this on both a button and momentary button:
def async():
# mode == relative movement, value == output pulses, field == output pulses
value = event.source.parent.getComponent('ntf_relative_move').intValue
mode = 2 # relative running
field = 313 # set output pulse
# Get to "SET" mode
state = 40
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [False])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setState'], [state])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [True])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [False])
# Write output pulses
print("Changing output pulse:", field, value)
system.tag.writeBlocking([
'[PROJ]TB0/dmoco0_setPField',
'[PROJ]TB0/dmoco0_setPValue'],
[field, value])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setPTrig'], [False])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setPTrig'], [True])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setPTrig'], [False])
# Get back to "READY"
state = 30
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [False])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setState'], [state])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [True])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_cmdTrig'], [False])
# Trigger movement
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setCMode'], [mode])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setCTrig'], [False])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setCTrig'], [True])
system.tag.writeBlocking(['[PROJ]TB0/dmoco0_setCTrig'], [False])
def reEnable():
event.source.enabled = True
system.util.invokeLater(reEnable)
event.source.enabled = False
system.util.invokeAsynchronous(async)
I can't for the life of me figure out why this is the case. I have moved the text field to the right of this button away and it then engages with the next textfield below where the prior one was. This behavior persists even if the text fields are disabled (uneditable), and it stops them from updating their contents (they are bound to some tags that update after this butto is pressed).
Interacting with the client from machine A shows proper behavior on machine B but not proper behavior on machine A.
Any help would be appreciated.
Before clicking:
After clicking (expected behavior would be to see Position -14000, which I can see on another device):
After rearranging the text fields (to demonstrate it is related to proximity / scan order on the screen) and clicking Move:
The Move button unblocks shortly after due to the async nature of my request, this is working as intended. The tag that the field next to the Position label is tied to is not referenced in the script attached to the button. Neither is the one below it, which triggers when I move that box.