Hello Guest it is March 28, 2024, 08:11:26 PM

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

301
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 15, 2014, 10:51:27 PM »
playing around with modbus by passing data in, computing to display results

302
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 15, 2014, 08:50:18 PM »
looks like there is a difference in the Feed rate override and the spindle override one uses 100 and the other 1 to scale. Both reset to 100%
not sure why they did not make the function labeling similar and the scaling too. just a heads up, or a kick in the ... ::)


Code: [Select]
function fro100()
    local inst = mc.mcGetInstance();
    fro = 100
    mc.mcCntlSetFRO(inst, fro);
end

function sro100()
    local inst = mc.mcGetInstance();
    sro = 1;
    mc.mcSpindleSetOverride(inst, sro);
end

303
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 14, 2014, 11:40:24 PM »
--got scaling figured out and working (code located in the PLC script)
yes... one for each axis , I love these registers.

Code: [Select]
    local chkVar3 = ReadReg("iRegs0/xscale");
    if (chk3 ~= chkVar3) then
        chk3 = chkVar3
        if (chkVar3 ~= 1) then
            code = string.format("G51 X%0.4f",tostring(chkVar3));
            scr.SetProperty('droX1', 'Fg Color', 'Red');
       else
            code = string.format("G50");
            scr.SetProperty('droX1', 'Fg Color', 'Green');
        end
        mc.mcCntlGcodeExecute(inst, code);
    end

304
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 13, 2014, 07:21:21 PM »
Had a need to store messages to a file, as some of them are longer than the available window. Puts the date and time stamp on each new message.
And as an added benefit it provides a log of errors.
When I don't want to use the write to file feature, I'll put the messages() call in an if then statement that looks for a toggle button state.

--put this at the end of the PLC script
Code: [Select]
messages();

--put this in the screen load script
Code: [Select]
function messages()
  err = mc.mcCntlGetLastError(inst);
  if (err ~= errold) then
    errold = err;
    file = io.open("messages.txt","a") -- open a new current file
    file:write(os.date("%x  %X ")..(err).."\n")
    file:close() -- close current file
  end
end

305
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 12, 2014, 12:13:27 PM »
Started working on modbus spindle control so I had to add some extra features.

306
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 11, 2014, 09:12:37 AM »
Been looking for a way to organize and merge xml screen.set data ... though it is a pain it is possible
One of the reasons is this particular screen set would be 433 printed pages, that makes for a lot of structure code.
And the places to merge the data is critical and has to be formatted correctly.
It is a very tedious task, hopefully some day the powers to be (Brian & Steve or some other code monkey) will have a tool to assist us.

http://msdn.microsoft.com/en-US/data/bb190600.aspx

307
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 09, 2014, 01:05:58 PM »
I did manage a protection routine for my probe till they get the probing worked out. I can move and when it makes contact writes the value to a file and then goes into a estop then back to an enable state so I can jog off.
It uses some of Scotts DSC code and a couple of flags to check status. But it works for the most part to protect my renishaw and let me know the coords.
just functional enough to keep my heart from exploding.  :D

Code: [Select]
function TestDSC_Module()
local StateOfInputSig0 = DSC.GetInput(0); --GetInput(InputSig), InputSig is a # 0-63 i.e. ISIG_INPUT0 is "0" (zero)
                                             --a sequential Input 0-63
    local StateOfDigitize = DSC.GetOtherInput('DIGITIZE');--active when X axis jogging Pos Dir.
                                                   --a non sequential/named Input, controlled
                                                   --from keyboard plugin     

    if StateOfDigitize == 1 then
        local DigitalTrigger = 1; 
        DSC.OutputMiscSig('DIGTRIGGER', DigitalTrigger);
        getprobedata();
    else
        SETFLAG = 0;           
        SETFLAG2 = 0;           
    end
end
TestDSC_Module();

function getprobedata()
    local inst = mc.mcGetInstance();
local Xval = ReadReg("iRegs0/Xvalue");
local Yval = ReadReg("iRegs0/Yvalue");
local Zval = ReadReg("iRegs0/Zvalue");

        gcodecapture = string.format ("X%.4f, Y%.4f, Z%.4f \n", Xval, Yval, Zval);
 
    filename = "myProbeFile.txt";
     if (gcodecapture == gcodeold) then
        gcodeold = gcodecapture;
        SETFLAG=1;
    else
        if (SETFLAG == 0) then
            mc.mcCntlEStop(inst)
            if (SETFLAG2 == 0) then
                --mc.mcCntlSetLastError(inst, 'SETFLAG0 = ' .. tostring(SETFLAG));
                file = io.open(filename,"a"); -- create new file or add to it
                gcodeold = string.format ("X%.4f, Y%.4f, Z%.4f \n", Xval, Yval, Zval);
                file:write(gcodecapture)
                file:close()
                gcodeold = gcodecapture;
                SETFLAG2=1;
                mc.mcCntlSetLastError(inst, 'gcodecapture = ' .. tostring(gcodecapture));
            end
                DSC.DoFunc('CNTLENBL');
        end
   end
end

308
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 05, 2014, 07:09:01 PM »
so he must want something,  ;)

309
Mach4 Toolbox / Re: #var (Pound Var) parameters list docs..
« on: June 05, 2014, 09:35:55 AM »
run the file i provided in single block and check the variables
something is not quite right I admit, but these are some things you can do to prove to yourself what going on. ;)

just a thought

310
Mach4 General Discussion / Re: Screen Set Ideas
« on: June 05, 2014, 08:14:43 AM »
those are cool Russ, ( :-[ Opps... Sorry Rich) lots to view that's for sure. you've had a jump on this.

I'm late, coming to the game. (you create or MM?)


edit: I can just fix em  ::)