OK, the reason the LCD does not update when Mach starts up is because the DROs are not updating and that script only runs when the DROs update (value changes). Anything that changes the value of the DROs should update the LCD.
I have not been able to find a command to send via the POKEYS unit to clear the LCD display in the very beginning so the POKEYS on MACH4 message gets erased prior to the coordinates getting display, but I will keep looking. I know I can build a string of " " 20 spaces and send that which might be a work around.
Not familiar with it but yes, sending an empty string should clear it.
OK, my idea is to build a function that updates the LCD. It would basically be all of the script you put in each dro combined into a single function in the screen load script. Then in the PLC script check to see if the DROs have changed and if they have, run the function. Also, to initialize the LCD when Mach starts run the function once in first run of PLC script. Look in the router screen sets PLC script for the Update fractional DROs section to see how it would work.
Another option that may be even better is to update the LCD to the values in the DROs in the first run of the PLC script and leave the onupdate scripts where they are (no need for a function in the screen load script then and will only run once when Mach is launched).
This should have put an X in front of the X value in the LCD display..........
Xcoords = string.format("X%4.4f", Xcoords)
This should put a X, a : and a space..........
Xcoords = string.format("X: %4.4f", Xcoords)