Here's what I've come up with in order to get rid of some latency issues. I found that the serial protocol used was quite slow and seemed to cause a slowdown in the screen update. I don't have a mill yet so I can't test it properly that way, but I've found the following macropump helps somewhat. Putting this screen update into it's own DLL plugin would be the ideal solution though. I've been looking for what other's have done regarding this, but it seems that only commercial ventures which will not share there code are available.
If getVar(1005) = 0 Then
XV = Format (GetDro(0) , "+000.0000;-000.0000")
YV = Format (GetDro(1) , "+000.0000;-000.0000")
ZV = Format (GetDro(2) , "+000.0000;-000.0000")
AV = Format (GetDro(3) , "+000.0000;-000.0000")
SendSerial "?c0?f?a?g"
SendSerial "?y0?x00 X: " &XV
SendSerial "?y1?x00 Y: " &YV
SendSerial "?y2?x00 Z: " &ZV
SendSerial "?y3?x00 A: " &AV
setVar(1005, 1)
setVar(1004, 0)
End If
If getVar(1004) = 10 Then
setVar(1004, 0)
if getVar(1000) <> Getdro(0) Then
XV = Format (GetVar(1000) , "+000.0000;-000.0000")
SendSerial "?x04?y0" &XV
setVar(1000, Getdro(0))
End If
if getVar(1001) <> Getdro(1) Then
YV = Format (GetVar(1001) , "+000.0000;-000.0000")
SendSerial "?x04?y1" &YV
setVar(1001, getDro(1))
End if
if getVaR(1002) <> Getdro(2) Then
ZV = Format (GetVar(1002) , "+000.0000;-000.0000")
SendSerial "?x04?y2" &ZV
setVar(1002, getDro(2))
End If
if getVar(1003) <> Getdro(3) Then
AV = Format (GetVar(1003) , "+000.0000;-000.0000")
SendSerial "?x04?y3" &AV
setVar(1003, getDro(3))
End If
else
setVar(1004, getVar(1004) + 1)
End If