Hello Guest it is March 28, 2024, 09:51:33 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Bodini

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »
41
Mach4 General Discussion / Re: Export tool table
« on: May 15, 2014, 07:42:49 PM »
You're welcome Russ.  It was a bit of fun. Don't get used to it though... the further into this Lua programming book I get, I more I just want to go push wood through the table saw and shut off the ol' brain.  ;)

Really though, Lua is well documented, so if we can just get Mach 4 thoroughly documented...  ;D ;D

ps- I meant to mention that in my code "ootput" is not a typo but rather a tribute to the Canadian we owe all our fun (or frustration) to, Art.  I can make fun; I know a few Canadians (my wife, grandfather, etc.)  ;D

42
Mach4 General Discussion / Re: Export tool table
« on: May 15, 2014, 05:28:53 PM »
I forgot to mention that it only uses the line that have a tool length.  if it does not have a tool length then the line will not be printed, even if it does have other data.  never used tool table myself so this was just a guess at a way to sort it out (see the "if w1 > 0 then" line).

43
Mach4 General Discussion / Re: Export tool table
« on: May 15, 2014, 05:23:13 PM »
I had a spare 45 minutes to learn something Lua this afternoon so I gave it a shot.  I know nothing of coding other than what I did in Mach 3 VB, so yes, I know this will be a juvenile effort.  :D

It writes to a file called tool table.txt in the Mach 4 main folder.

Tested and works.  

Regards,
Nick

Code: [Select]

file = io.open("tool table.txt","w") -- open a new current file
file:write(string.format("Tool#        Length   Length Wear     Dia   Dia Wear    Description\n"))

inst = mc.mcGetInstance()
var1 = 7780 --start number
var2 = 10319 --end number
var3 = 10 --increment
local toolno = 1

for outer = var1, var2 ,var3 do
    c1 = outer + 5 --length
    c2 = outer + 6 --Length wear
    c3 = outer + 8 --dia
    c4 = outer + 9 --dia wear

    w1 = mc.mcCntlGetPoundVar(inst, c1)
    w2 = mc.mcCntlGetPoundVar(inst, c2)
    w3 = mc.mcCntlGetPoundVar(inst, c3)
    w4 = mc.mcCntlGetPoundVar(inst, c4)
    desc= mc.mcToolGetDesc(inst, toolno)
        ootput1 = string.format("Tool#%d   %10.2f %10.2f %10.2f %10.2f      %s\n",toolno,w1,w2,w3,w4,desc)
        ootput2 = string.format("Tool#%d   %9.2f %10.2f %10.2f %10.2f      %s\n",toolno,w1,w2,w3,w4,desc)
        ootput3 = string.format("Tool#%d   %8.2f %10.2f %10.2f %10.2f      %s\n",toolno,w1,w2,w3,w4,desc)
if w1 > 0 then
if toolno >= 100 then
file:write(ootput3)
elseif toolno >=10 then
file:write(ootput2)
else
file:write(ootput1)
end
end
        var1 = var1+10
toolno = toolno + 1
   end
  
 file:close() -- close current file

44
OK thanks.  I did see that list but did not realize the application as related to my question.  Yep, that works.

45
I am trying to set a DRO that has a "DRO Code" from the drop down in its Properties... such as "xdro1" on the default screen. (In Mach3/VB this would be like a "SETOEMDRO" if I remember correctly.)

Used the code "scr.SetProperty('xdro1', 'Value', tostring("999"))" and it works for a millisecond (you can see it flash by in the DRO).  But then the Value goes back to what it was before the DRO was set.

I notice that when the "DRO Code" is cleared, this doesn't happen.  Obviously there is another part of the process that I am unaware of.  Please advise!

Also just noticed that it works when the screen is being edited.  So, I'd guess this is some sort of PLC script issue or something like that.

46
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: May 01, 2014, 07:37:32 PM »
DRO bug: a dro placed on the screen is actually "Border>sunken" and not "Border>none" as the properties panel shows.  You have to set the placed DRO to some style other than "none" and then set it back to "none" to get it to actually show as "none".

47
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: May 01, 2014, 10:21:08 AM »
I find entering numbers in the DROs rather inconvenient comparing to how it used to be in Mach3 where a single click would highlight the whole number.

I too am already annoyed by this.  1 click should highlight the whole field, IMO.

48
VB and the development of wizards / Re: encoder dro with m/c dro Comparison
« on: December 23, 2013, 11:34:37 AM »
Elaborating on what TP said, I will give you a few more clues.  Rogers encoder board uses a plug-in.  Brains or VB/macropump just arent fast enough to monitor closed loop with much success.  The plug-in compares steps sent by Mach to counts sent back from encoders.  It doesnt use DROs at all, but rather the raw data behind the scenes in Mach.  The encoder board is the only way Mach can read and compare it all fast enough.

However, if you are having any sort of luck at all, I encourage you to keep pushing and see what you can get it to do! :-)

49
VB and the development of wizards / Re: encoder dro with m/c dro Comparison
« on: December 20, 2013, 06:51:10 PM »
If you are just looking to see the deviation error, check OEMDRO's 127, 128, 129.

Error between Encoder 1 and abs X position DRO   127
Error between Encoder 2 and abs Y position DRO   128
Error between Encoder 3 and abs Z position DRO   129


50
General Mach Discussion / Re: Installation Fails v3.043.066
« on: December 20, 2013, 06:46:03 PM »
The next question is where to get an older version, and the answer is here: ftp://machsupport.com/Mach/

or if that fails, go here http://www.machsupport.com/software/downloads-updates/  and find the FTP Downloads tab.

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »