Hello Guest it is April 19, 2024, 03:36:07 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 - Ya-Nvr-No

431
Tangent Corner / Re: Murphy’s Law strikes again.
« on: May 08, 2014, 06:55:44 AM »
The machine screws were in one of his many hoarding jars, where he only had enough funds to get either the SS Button Heads Cap Screws or Beer, guess what won.  :D
Proving another good mans rule "Don't throw away anything that might be used in a future project". You never want to dip into your BEER MONEY

Good catch Sam

432
Not that I have to explain, but for the past couple of weeks I have been nursing an injury I sustained working on one of them. So I've had plenty of butt time. Just looked like I have nothing else to do,  ;D
Starting to get back in shape but not quite there yet. So this new programming challenge was great timing.
Hell to get Old.

433
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 10:12:51 PM »
This code worked for me in the PLC Script to change the button labels.

I am interested in the ability to get and set values to the registers.
looked at it, but just caused Lua and Mach4 to crash several times just trying to get a value.

Code: [Select]
local SpinCW = scr.GetProperty('ledSpindleCW','Value','Value',0);
local SpinCCW = scr.GetProperty('ledSpindleCCW','Value','Value',0);

if (SpinCW == "1") then
    scr.SetProperty('btnSpindleCW', 'Label', 'SpindleCW OFF');
else
    scr.SetProperty('btnSpindleCW', 'Label', 'SpindleCW ON');
end
if (SpinCCW == "1") then
    scr.SetProperty('btnSpindleCCW', 'Label', 'SpindleCCW OFF');
else
    scr.SetProperty('btnSpindleCCW', 'Label', 'SpindleCCW ON');
end

434
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 07:13:48 PM »
Might be easier to do it in the PLC Script and just look for a ledCW on or off

435
Sorry, kind of busy building two machines right now.

436
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 07:00:43 PM »
Is that why you can not change a button label from a m3 script?

437
That's why I made my bigger,  ;D

438
Should be a cleaner way to do this, but it does work, thanks Jeff
just hit cancel if you don't want that particular folder goes to the next one.
handles USB and networks fine

Code: [Select]
local inst = mc.mcGetInstance();

local myGCodePath = "C:/";
local Path1 = "C:/Mach3/GCode";
local Path2 = "C:/Mach4/Test GCodes";
local Path3 = "F:/";
local Path4 = "//LIGHT-TABLE/GCode";
local i;

for i=1 , 4 do

if ( i==1 ) then
    myGCodePath = Path1;
end
if (i==2) then
    myGCodePath = Path2;
end
if (i==3) then
    myGCodePath = Path3;
end
if (i==4) then
    myGCodePath = Path4;
end

local fileDialog = wx.wxFileDialog(wx.NULL, "Open file", myGCodePath,
    "", "GCode files (*.txt;*.nc;*.tap)|*.txt;*.nc;*.tap|TXT files (*.txt)|*.txt|NC files (*.nc)|*.nc|TAP files (*.tap)|*.tap", wx.wxFD_DEFAULT_STYLE);

  if fileDialog:ShowModal() == wx.wxID_OK then
    local fileName = string.reverse(fileDialog:GetFilename());
    local pos = string.find(fileName, "%.");
    local fileExt = string.reverse(string.sub(fileName, 1, pos-1));
    if fileExt == "tap" or fileExt == "nc" or fileExt == "txt" then
        local filePath = fileDialog:GetPath();
        local result = mc.mcCntlLoadGcodeFile(inst, filePath);
        if not result then
            wx.wxMessageBox("Sorry, I could not open file.");
        end
    else
        local message = string.format("%s is wrong file type", fileExt);
        wx.wxMessageBox(message);
    end
  end
end

439
Mach4 General Discussion / Re: Image Buttons and images on screen
« on: May 07, 2014, 05:24:00 PM »
After going in to screen edit
Choose Screen menu option then manage Images

440
Tangent Corner / Re: Murphy’s Law strikes again.
« on: May 07, 2014, 12:57:21 PM »
So you plumbed it holding a long neck bottle?
hell... close enough then.