I am trying to use a button in ViewOn to toggle a value in an Allen Bradley PLC. I want the button to write a (1) while pressing and (0) on depressing the button. The end user will most likely be using a smartphone to toggle the button. I am testing this on a MicroLogix 1100 over Ethernet. I have communication set up properly as I have animation set up on the ViewOn webpage and it works on the incoming tags that are read only. I found the tech note “jog button with viewON”. I wrote the script below for the button and when I “test the animations and actions” from ViewOn, it updates the tag on the test web page. However, when I publish to the Ewon device, my button does not update the actual tag in the Ewon, nor the associated tag in the PLC. I am testing on a PC so that the mouse button works. Would like it to be compatible with mobile. The Ewon tag ‘Wet_recl_run’ is associated with B3:0/13 in the PLC. Wet recl is short for “wet reclaim conveyor”.
MouseDown+button1:
getEwonTagVal(‘Wet_recl_run’);
setEwonTagVal(‘Wet_recl_run’, 1);
commitEwonTagChanges();
MouseUp+button1:
getEwonTagVal(‘Wet_recl_run’);
setEwonTagVal(‘Wet_recl_run’, 0);
commitEwonTagChanges();