Hello Guest it is March 28, 2024, 06:46:50 AM

Author Topic: Screen Set Ideas  (Read 183725 times)

0 Members and 1 Guest are viewing this topic.

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Screen Set Ideas
« Reply #280 on: January 10, 2015, 05:32:59 PM »
Quote
But a screen like you show might be easier to do by creating a tab and control group in mach4 then use mach4 registers to read and write too the DRO's.


True.

I already created the tab and control group almost a year ago in a Mach 4 lathe screen. And would do it again.
Now if I knew how to use the registers to read and write to the DRO's......it would have been done already.  ;)
The only register I know how to read is the one for the check book and seems like it always goes out and nothing is read back in! ;D

RICH
Re: Screen Set Ideas
« Reply #281 on: January 11, 2015, 08:37:27 AM »
you create the registers in the plugins and then you can view the current status in the diagnostic register section

this is a function i wrote to get the data out of the ini file
but this give you an idea of how you need to read a dro value, and set the registers values
the trick is to use the "mcCntlSetLastError" as a debugging tool to view in the history box what is happening.
so this function would be called from the load script then i have another function to keep the registers current that runs in the plc script.

Or you can create a button and under the button call the SetPartCount() function to test.
you dont have to be this elaborate to start with but the you still need to go through the whole process for each DRO, button and register to beable to read, write and control them. Name your controls and be consistent "drovar3901" as in this example i know that its a dro and 3901 is a fanuc variable that is used for holding the part count.
Code: [Select]
function SetPartCount()
    local inst = mc.mcGetInstance();
    --("iRegs0/Parts");
    local partsCounter = mc.mcProfileGetInt(inst , 'drovar3901' , "3901", val);
    mc.mcCntlSetPoundVar(inst, 3901, partsCounter)

    --("iRegs0/Required");
    local partsRequired = mc.mcProfileGetInt(inst , 'drovar3902' , "3902", val);
    mc.mcCntlSetPoundVar(inst, 3902, partsRequired)

    scr.SetProperty('drovar3901', 'Value', tostring(partsCounter));
    scr.SetProperty('drovar3902', 'Value', tostring(partsRequired));

    local hReg = mc.mcRegGetHandle(inst, 'iRegs0/Parts');
    mc.mcRegSetValue(hReg, partsCounter);
    local hReg = mc.mcRegGetHandle(inst, 'iRegs0/Required');
    mc.mcRegSetValue(hReg, partsRequired);

    --mc.mcCntlSetLastError(inst, 'partsCounter  = ' .. tostring(partsCounter));
    --mc.mcCntlSetLastError(inst, 'partsRequired = ' .. tostring(partsRequired));
end

« Last Edit: January 11, 2015, 08:41:03 AM by Ya-Nvr-No »
Re: Screen Set Ideas
« Reply #282 on: January 11, 2015, 08:38:52 AM »
Then a couple of screen clips that show naming and the ability to reset of the part count register back to 0
Re: Screen Set Ideas
« Reply #283 on: January 11, 2015, 01:38:03 PM »
Here is a quick grid style spreadsheet layout wizard I made this morning to help me in calculating sheave selection based on tooth & ratios desired.
Uses the timer to auto calc, but this also gives you a good template to play with and learn from.
Relatively small and hopefully all can use.  ;)

basically you change the values in green and it updates the results
Re: Screen Set Ideas
« Reply #284 on: January 13, 2015, 11:09:35 AM »
This original spread sheet was written by Gerald Dorrington of Mechtronics back in 2008 (Thank You)  :)

No idea where or when I came across it, but here is an example of how to take information provided and help create a Lua wizard.
By using the calculations from the spread sheet, helps to develop the Lua calculations. Gives instant feed back and troubleshooting capabilities.

Here I am passing the axis number to a function to calculate the correct column. And all based off the example lua.mcs file I'd provided earlier. Just with more functionality. Its not hard, just tedious and a process of test, test, test.
Re: Screen Set Ideas
« Reply #285 on: January 14, 2015, 09:55:50 AM »
The finished wizard having both Imperial and Metric Capabilities.
Re: Screen Set Ideas
« Reply #286 on: January 24, 2015, 10:27:16 AM »
Came across a great resource to help in creating Lua forms, takes a while to grasp, but once you get the idea you start understanding its abilities.

http://sourceforge.net/projects/wxformbuilder/

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Screen Set Ideas
« Reply #287 on: January 24, 2015, 07:02:48 PM »
Does anyone know HOW to expand the WX dialog box to full screen size ? I ran into this with wizards as well. 

(;-) TP
Re: Screen Set Ideas
« Reply #288 on: January 24, 2015, 08:51:02 PM »
This worked for me, tell it where to start and how big

MyDialog = wx.wxDialog (wx.NULL, wx.wxID_ANY, "", wx.wxPoint( 0,0 ), wx.wxSize( 1366,768 ), wx.wxDEFAULT_DIALOG_STYLE )
   MyDialog:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

MyDialog:Show()


Spend a few hours with formbuilder and you start seeing what is needed to create popups.

« Last Edit: January 24, 2015, 08:58:29 PM by Ya-Nvr-No »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Screen Set Ideas
« Reply #289 on: January 24, 2015, 09:14:14 PM »
OK That worked with a new dialogbox  BUT did NOT work using it with the TOOL TABLE example.

I am using it to LEARN more.  I can manipulate most of everthing there BUT I cannot size the BOX to size NOR Resize the FONT.

Thanks for the help, THIS is going to be VERY painfull and require Many cups of coffee.

(:-) TP