Author Topic: Mach 4 Bug Reports  (Read 343998 times)

0 Members and 1 Guest are viewing this topic.

Offline Ya-Nvr-No

  • Active Member
  • Posts: 971
    • View Profile
    • Ya-Nvr-No
Re: Mach 4 Bug Reports
« Reply #120 on: May 27, 2014, 09:10:22 AM »
Win 7 32bit and XP both fail at the end I've just learned to put a dummy line in and stop the debug when i see it.
no luck with scotts DS or DSC programs to step thru.

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach 4 Bug Reports
« Reply #121 on: May 27, 2014, 11:45:26 AM »
When you use "Step Through" F11 to run code, it looks for you code in the Macros folder of your profile by default.... so if you have code somewhere else like:  C:\Mach4\MODULES  then to debug your code, you need to use Break Points and F5 through your code, stopping the debugging right before the end of the function so the debugger will not crash...

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline BR549

  • Mach4 Alpha
  • Posts: 6,855
    • View Profile
Re: Mach 4 Bug Reports
« Reply #122 on: May 27, 2014, 12:42:38 PM »
SCOTT, all my macros are in the proper folder and it still does that. IF the code is clean and good then no problem.

 BUT if there ARE errors DOWN the rabbit hole it goes.

(;-) TP

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach 4 Bug Reports
« Reply #123 on: May 27, 2014, 02:03:39 PM »
thats why I say, use the Breakpoint/F5 debug mode...... the F11 is just to buggy.

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline simpson36

  • Active Member
  • Posts: 1,374
    • View Profile
Re: Mach 4 Bug Reports
« Reply #124 on: May 27, 2014, 08:36:16 PM »
Quote
       put this below func in your McLua editor, and see if you can step through it? I have tried breaks at each line as well, but the crash happens after you exit the function...

function Testfunc()
    local inst = mc.mcGetInstance();
    mc.mcCntlSetLastError(inst, '***  Testing  ***');   
end

if (mc.mcInEditor() == 1) then
    Testfunc();
end


Works fine here. Step thru no problem. Win7Pro 64 bit  Note: (MACH4 run as administrator)

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach 4 Bug Reports
« Reply #125 on: May 27, 2014, 10:21:06 PM »
are you using the F11 key?
F5 step through on break points works great..

hmmm, I will check to see if I am running m4 as admin.

Scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach 4 Bug Reports
« Reply #126 on: May 27, 2014, 10:34:56 PM »
Hey Simpson36, I tried runing m4 as admin, but again, at the VERY end of the F11's (after the last line of the calling function at the bottom). It crashes the McLua interpreter.  The running as Admin, DID help in it did not immediatly crash as you press the first F11.... 
Can you run this slightly, busier code, in your McLua and see if you can F11 to the very end, and even start over again...
I am running W8.1, 64bit (and running M4 as admin).

function Testfunc()
local inst = mc.mcGetInstance();local rc = 0;
local Xaxis = 0;local Yaxis = 1;local Zaxis = 2;
local dirP = 1; local dirN = -1;
    mc.mcCntlSetLastError(inst, '***  Testing  ***');

    rc = mc.mcJogSetRate(inst, Xaxis, 0.10);
    rc = mc.mcJogSetRate(inst, Yaxis, 1.00);
    rc = mc.mcJogSetRate(inst, Zaxis, 100.00);
   
    rc = mc.mcJogVelocityStart(inst, Xaxis, dirP);
    rc = mc.mcJogVelocityStart(inst, Yaxis, dirP);
    rc = mc.mcJogVelocityStart(inst, Zaxis, dirP);
    wx.wxSleep(1);
    rc = mc.mcJogVelocityStop(inst, Xaxis);
    rc = mc.mcJogVelocityStop(inst, Yaxis);
    rc = mc.mcJogVelocityStop(inst, Zaxis);
end

if (mc.mcInEditor() == 1) then
    Testfunc();
end
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline simpson36

  • Active Member
  • Posts: 1,374
    • View Profile
Re: Mach 4 Bug Reports
« Reply #127 on: May 28, 2014, 12:57:58 AM »
Hey Simpson36, I tried runing m4 as admin, but again, at the VERY end of the F11's (after the last line of the calling function at the bottom). It crashes the McLua interpreter.  The running as Admin, DID help in it did not immediatly crash as you press the first F11....  
Can you run this slightly, busier code, in your McLua and see if you can F11 to the very end, and even start over again...
I am running W8.1, 64bit (and running M4 as admin).

function Testfunc()
local inst = mc.mcGetInstance();local rc = 0;
local Xaxis = 0;local Yaxis = 1;local Zaxis = 2;
local dirP = 1; local dirN = -1;
    mc.mcCntlSetLastError(inst, '***  Testing  ***');

    rc = mc.mcJogSetRate(inst, Xaxis, 0.10);
    rc = mc.mcJogSetRate(inst, Yaxis, 1.00);
    rc = mc.mcJogSetRate(inst, Zaxis, 100.00);
    
    rc = mc.mcJogVelocityStart(inst, Xaxis, dirP);
    rc = mc.mcJogVelocityStart(inst, Yaxis, dirP);
    rc = mc.mcJogVelocityStart(inst, Zaxis, dirP);
    wx.wxSleep(1);
    rc = mc.mcJogVelocityStop(inst, Xaxis);
    rc = mc.mcJogVelocityStop(inst, Yaxis);
    rc = mc.mcJogVelocityStop(inst, Zaxis);
end

if (mc.mcInEditor() == 1) then
    Testfunc();
end
Steps thru fine using F5 to start and F11 to step

No crashes and can start over again with F5.

Running build 1767  - Modbus TCP is active and running exchanging data with external processor

Exact sequence:

Start MACH4
Operator -> Edit/Debug scripts -> open M6
File -> New
Paste in entire content of your script
Save as  C:/Mach4Hobby/Subroutines/Papa.mcs
F5 (or click either works) to start debug
F11 step thru to end
Can repeat no propblemo.

Result window capture attached. The word 'error' in a little box is showing up later during the screen snip . . not sure where that's coming from, but it is not present during the debug cycle . . shows up while saving the snip . .  weird

Edit: the screen has a couple of buttons added that just read and write a few Modbud regs. Otherwise box-stock as delivered. Doubt the buttons would have much effect, but who knows . . . .
 
« Last Edit: May 28, 2014, 01:05:21 AM by simpson36 »

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach 4 Bug Reports
« Reply #128 on: May 28, 2014, 07:43:37 AM »
well let me ask to beat a dead horse one more time...
can you make sure there are NO debug point breaks in the scripter, start the debugger, then F11 until it loops...

If your's still works, then there must be something in W8, 64bit (w8.1 technically).......  I am running the same M4H version as you are, and I am running the Stock OEM MachMilll profile and Screenset without any modules or anything else active...  Just to make sure nothing else is running...

kinda frustrating..
Not really a show stopper, since with breakpoints, F5 and NOT exiting the funciton, but hitting the stop debug before the end (on the dummyvar), I can still debug...  A mystery I guess.

Scott





Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline simpson36

  • Active Member
  • Posts: 1,374
    • View Profile
Re: Mach 4 Bug Reports
« Reply #129 on: May 28, 2014, 10:09:38 AM »
well let me ask to beat a dead horse one more time...
can you make sure there are NO debug point breaks in the scripter, start the debugger, then F11 until it loops...

If your's still works, then there must be something in W8, 64bit (w8.1 technically).......  I am running the same M4H version as you are, and I am running the Stock OEM MachMilll profile and Screenset without any modules or anything else active...  Just to make sure nothing else is running...

kinda frustrating..
Not really a show stopper, since with breakpoints, F5 and NOT exiting the funciton, but hitting the stop debug before the end (on the dummyvar), I can still debug...  A mystery I guess.

Scott

Scott,

You probably know there is a 'auto' breakpoint, but other than that, there were no break points set. F11 steps thru the entire file as you can see by the snip I posted. I don't know a lot about Lua at this point, but from what I read, it can be a stickler about file locations. I have another 'C' ish Programming environment that's like that. Compiles fail because it can't find Includes and the files are right there. Alas, the compiler is looking for them in some obscure place and I have found no way to change that. It *might* be that Lua is similarly arranged, but the errors are not exactly verbose, so you don't get much of a hint as to what its unhappy about. At least with the other one, I get the full path where the thing is looking for the file. Did you follow (exactly) the sequence I posted including the file location and name?

FWIW I had two issues with 64 bit Win7 pro (be sure to mention pro if it is. they are different).  Both were Modbus related as that's what I was working on at the time. Seems unlikely these would be crashing the editor, but its all I have to offer, so here it is:

Win7 was blocking the Modbus traffic. You mentioned frustrating . .  MACH4 reported 'Modbus0 ok' and displayed a loop rate . . . but it was talking to a black hole . . nothing was getting in or out, and each of the  data types (MACH4 calls them 'functions') was error red. I don't know what Modbus uses to check operation, but it's not closed because Modbus thinks it is talking to someone and there's nobody home. In any case, Run as Admin removed the guard dog and things started working.

It occurs to me that if you were running without being admin, the files you made *might* not have enough permissions, so you should check that also. If you follow my sequence exactly that potential would be eliminated. Long shot, but the problem is in your system and you are down to shots in the dark, so it can't hurt.

My other problem was with the network config. Once I had Modbus TCP running, in order to plug both the Processor and the main network into the machine without having to flip back and forth (reconfiguring TCP4 each time) I set up my single NIC with two hard coded IP. Even tough the Modbus IP is hard coded in the config, MACH4 Modbus *apparently* was trying to get data from the Internet side IP and not the connected processor IP (if that makes any sense).

I stuck a second NIC in the machine and configured it hard coded 2dn network to the external processor and restored the main network (rounter,internet) to auto IP, etc. Modbus stays focused on the 2nd hard coded net and all runs well, and simultaneously. I don't know what the actual problem is, but a $40 NIC card solves it, so I'm not inclined to pursue it beyond that. The MACH4 TCP Modbus will literally run for days on end while I do all of my regular work on the same computer. Impressive.

Again, it seems hard to imagine these issues would be effecting the Lua editor, but the network setup confused the Modbus comms, and as I mentioned earlier, the editors seem to be picky about file locations, so its a long shot, but maybe Lua is checking the network for libraries or something like that. Perhaps it was set to look for libraries on a network by the developers and inadvertently left that way?

That's about all I can think of. Sorry all guesses.

Meet the new Boss . . Same as the Old Boss.
« Last Edit: May 28, 2014, 10:17:38 AM by simpson36 »