6681
Mach4 General Discussion / Re: lua error or is it
« on: September 14, 2017, 06:53:42 AM »
Hi,
I found testcount in the PLC script:
and not subsequent passes.
The fact that it passes the first time its run without error suggests that all is well. On the second pass however testcount has mysteriously
been corrupted and is now considered to be a nil value. What gives? Is there code in your PLC script which overwrites or otherwise corrupts
testcount? As you can tell LUA is still new and mysterious to me as well!
Craig
I found testcount in the PLC script:
Code: [Select]
testcount = testcount + 1
Reading the remaining code the script uses testcount variable to do certain setup tasks on the first pass of the PLC scriptand not subsequent passes.
The fact that it passes the first time its run without error suggests that all is well. On the second pass however testcount has mysteriously
been corrupted and is now considered to be a nil value. What gives? Is there code in your PLC script which overwrites or otherwise corrupts
testcount? As you can tell LUA is still new and mysterious to me as well!
Craig