OK, so...no solution yet....
I tried a bunch of iterations with the code and here is what I found;
As written, still no action. When I FIRST opened Mach3 and immediately opened the VB editor and did a step-thru of the code, it stepped thru the 'For' section and did 1 toolchange step. After that, it no longer will step thru the 'For' section, it skips right over it every time.
Then I went into MDI, changed the tool to '1' in the DRO. Did a T202 M6. The computer bings, and the tool immediately changes to 2. No action at all on the toolchange. It acts like it is not reading the code, or if it is, it is immediatley skipping to the end. I checked again, the toolchange is set to 'auto'.
I then looked at the code to try some things - I deleted the 'Mod 4' at the end of the 'for' statement on a whim and tried the step thru. With that gone, it steps thru the 'for' statement, and I was able to verify that all the steps in the for statement work perfectly. Every time I step thru, it completes a tool change very well. The only modification I made was to increase the sleep time on the output signal, as it takes a moment for the input signal to latch on start of the toolchange. So that's good.
I reapplied the 'Mod 4' portion and tried to do stepthru, still no tool change, it skips right over the 'for' section.
I also retried to do a toolchange in the MDI, (both with and without the Mod 4) still no action.
In summary, it seems like the issue may be in the counting statements at the start of the code, or in the 'For' statement line, is the only thing I can think of, as the actual toolchange seems to work well. I don't really understand teh MOD command and what it is doing, so I'm not sure how to troubleshoot it.
Just to check, I am running the trial verison of Mach to proof it out before I buy the full license, is there a limitation on the toolchange function? I know threading was not enabled but I didn't think toolchange was an issue.
Thanks.