1
General Mach Discussion / Changes In Macro Execution?
« on: July 14, 2015, 10:03:14 PM »
I've been away from Mach3 for several years, but now have to get back into, and write some relatively simple macros to operate my old power drawbar and toolchanger, which had been running under KFlop. I've translated the KFlop C driver to CB, and it's sorta-kinda working, but I'm getting some really odd results. Under various error conditions, I pop-up an error dialog using MachMsg, and I sometimes see these dialogs appear from portions of code that should never have run, and this invariably happens LONG after the macro, by all appearances, has completed execution.
So, I am confused. I notice in the Programmer Reference Manual, which I originally wrote many years ago, has been significantly updated. In particular, I notice the new "RunScript" function, for which the manual seems to recommend NOT using M-macros, due to the need to "invent and handle semaphores". WTF??
Anyway, my PDB/ATC macro is attached. Does anyone see anything in there that could explain the bizarre behavior I'm seeing, or explain what I'm doing wrong? It appears to me almost as though some subroutine calls are going off and running asynchronously in separate threads, so I end up with several threads running in parallel for what MUST be a linear sequence of operations.
Regards,
Ray L.
So, I am confused. I notice in the Programmer Reference Manual, which I originally wrote many years ago, has been significantly updated. In particular, I notice the new "RunScript" function, for which the manual seems to recommend NOT using M-macros, due to the need to "invent and handle semaphores". WTF??
Anyway, my PDB/ATC macro is attached. Does anyone see anything in there that could explain the bizarre behavior I'm seeing, or explain what I'm doing wrong? It appears to me almost as though some subroutine calls are going off and running asynchronously in separate threads, so I end up with several threads running in parallel for what MUST be a linear sequence of operations.
Regards,
Ray L.