Hello Guest it is April 25, 2019, 12:31:21 PM

Author Topic: Screen Set Ideas  (Read 103851 times)

0 Members and 1 Guest are viewing this topic.

Re: Screen Set Ideas
« Reply #70 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  ::)
« Last Edit: June 05, 2014, 05:00:53 PM by Ya-Nvr-No »

Offline RICH

*
  • *
  •  7,313 7,313
    • View Profile
Re: Screen Set Ideas
« Reply #71 on: June 05, 2014, 03:27:50 PM »
Craig,
Think you have me .... RICH ..... mixed up with that fine, kind, loving, well spoken, tall dark good looking, intellectual fellow called RUSS. ;D

I copied a lot from the mill screen, added a lot of things i thought a one single lathe screen page should have all using Screen4.
That was  easy, but, what needs to be in place for the screen to work is another story.

RICH
« Last Edit: June 05, 2014, 04:56:43 PM by Ya-Nvr-No »
Re: Screen Set Ideas
« Reply #72 on: June 05, 2014, 07:01:57 PM »
Aww no, don't go pinning Hoods attributes on me.
I am quite the inverse of that description. Actually, in every  respect.

(nice try Rich, much appreciated)

Russ
Re: Screen Set Ideas
« Reply #73 on: June 05, 2014, 07:09:01 PM »
so he must want something,  ;)
Re: Screen Set Ideas
« Reply #74 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
Re: Screen Set Ideas
« Reply #75 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
« Last Edit: June 11, 2014, 09:32:21 AM by Ya-Nvr-No »
Re: Screen Set Ideas
« Reply #76 on: June 12, 2014, 12:13:27 PM »
Started working on modbus spindle control so I had to add some extra features.
Re: Screen Set Ideas
« Reply #77 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
« Last Edit: June 13, 2014, 07:25:07 PM by Ya-Nvr-No »
Re: Screen Set Ideas
« Reply #78 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
Re: Screen Set Ideas
« Reply #79 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