Hello Guest it is March 28, 2024, 01:44:27 PM

Author Topic: Line 0: Multiple E words in block  (Read 859 times)

0 Members and 1 Guest are viewing this topic.

Line 0: Multiple E words in block
« on: May 07, 2021, 09:48:44 PM »
Not another M6 script problem! Sorry but yea sorta. Everything works running it in the editor a line at a time but gives the "Line 0: Multiple E words in block" in the history when I run a T2M6 in the MDI. Anyone have a link to Mach 4 errors and their meaning?

It works if I take out the line that turns on offsets (G43 line). Weird part is that it does not execute the line sending it back to xstart and ystart, or the G43 line but does execute a message box after.


   mc.mcCntlSetLastError(inst, "ToolLen = " .. tostring(ToolLen))
   mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
   mc.mcCntlGcodeExecuteWait(inst,(string.format('G' .. posmode)).." G54 G0 X"..xstart.." Y"..ystart)
   mc.mcToolSetCurrent(inst, selectedtool)
   mc.mcCntlGcodeExecuteWait(inst, "G43")


Any help appreciated.

Chris
Re: Line 0: Multiple E words in block
« Reply #1 on: October 28, 2022, 10:11:18 AM »
Ive had this same problem.  Mine seems to be completely random.  My M6 is working fine for hours then out of nowhere, on a proven program it will give me the "multiple E words in block"
Re: Line 0: Multiple E words in block
« Reply #2 on: October 28, 2022, 03:27:23 PM »
I have looked into this and I think we are getting some scientific notation from the OS! Why is it doing it .... well frankly that is the real issue. Thank you for bringing this up! We are looking for a solution.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Line 0: Multiple E words in block
« Reply #3 on: October 28, 2022, 05:57:33 PM »
I think you guys are editing and using something other than ASCII character set.  Something with a double byte charset?  G code can only be one byte per character.  Either in the G code itself of scripts executing G code.  So the random-ness may be due to a DBCS or UNICODE character in the G code file and not directly having to do with your M6. 

Steve

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Line 0: Multiple E words in block
« Reply #4 on: October 28, 2022, 10:10:37 PM »
I have looked into this and I think we are getting some scientific notation from the OS! Why is it doing it .... well frankly that is the real issue. Thank you for bringing this up! We are looking for a solution.

Now that Brian brought up scientific notation, I think he is onto something.  I think the way xstart and ystart are used to form the string is what is causing the scientific notation to appear. 

Consider your script line below.  And this could very well happen if xstart and ystart were calculated and are in scientific notation!

Code: [Select]
mc.mcCntlGcodeExecuteWait(inst,(string.format('G' .. posmode)).." G54 G0 X"..xstart.." Y"..ystart)

Also, if tostring was used to convert  the x and y start positions to a string, the positions may be small enough to produce the scientific notation.  So how can we prove the scientific notation thing?  Try this code:
Code: [Select]
local gcodeLine = string.format('G' .. posmode) .. " G54 G0 X"..xstart.." Y"..ystart
mc.mcCntlSetLastError(inst, gcodeLine)
mc.mcCntlGcodeExecuteWait(inst, gcodeLine)

Now, what if the above code proves that out to be true?  How do you eliminate the issue?  Consider this code, assuming xstart and ystart are real number variables and not a string representation of numbers.  This also assumes that posmode is a number. 

Code: [Select]
local gcodeLine = string.format('G%d G54 G0 X%.4f Y%.4f', posmode, xstart, ystart)
mc.mcCntlSetLastError(inst, gcodeLine)
mc.mcCntlGcodeExecuteWait(inst, gcodeLine)

The above code is the proper way to use string.format()  %d is an integer.  %f is a floating point number.  %.4f means 4 digits of precision.  See if that gets better results. 

Steve
Re: Line 0: Multiple E words in block
« Reply #5 on: October 29, 2022, 12:05:16 PM »
When Brian mentioned Scientific notation, I immediately thought "i wonder if my tool length is being recorded as some ultra-long decimal and then is converted to scientific notation?  Ill look into my M6 and see.  My current cut is reporting the tool length to only 4 decimal places in the info bar on mach4......