Hello Guest it is January 24, 2020, 12:34:38 AM

Author Topic: Mach4 screen GRAPHICS -- makin' it Purdy  (Read 25187 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #60 on: March 16, 2015, 04:29:11 PM »
But if the goal is "Makin it Purdy", then we can do much better than the built in LED's.

An LED bar graph would be easy enough, and the square LEDs don't have the Ugly syndrome. You can stack a bunch of them to make the bar, but there are not enough colors to make it 'Purdy'.

I was leaning toward the image toggle buttons with one photo of a lighted lens and one of a dark lens (there are examples posted). However, I have discovered that the image on the regular (non toggle) image button can be swapped out in real time, so actually you have an OFF state and an unlimited number of ON states . . all of which can be 'Purdy'. There is an OFF image, so you could also have a bunch of OFF states, but that does not seem very useful . . .  at least not at the moment.

You can get a feel for how fast the images change in the video where one of the buttons changes from a round light to a cap that says accell.

Several colors of light could follow some parameter and trigger a buzzer if a certain level was exceeded. I think MACH4 can play sounds (not in front of it at the moment)

I'm wondering if you could not make a speedometer type gage by swapping in images of the speedo face with the needle at different positions, or overlay the needle on a background image using the alpha channel.

The problem with putting an image over a button, is that either the Z order does not work as expected, or the buttons override the setting. Not sure which at this point, but I'll figure it out eventually, and I've been looking at wxLua and wxWidget as I get time and there are a lot of goodies there .
« Last Edit: March 16, 2015, 04:31:36 PM by simpson36 »

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #61 on: March 18, 2015, 10:09:25 AM »
Update: the problem with controls not re-appearing after being hidden seems to happen only if the control is in a panel (group). I have updated this in the bug reporting section.

Attached videos:

First: demonstrates the idea of monitoring something (a dro in this case) and having action taken based on the values monitored. Also LED appearing only when needed (the vertical bar is actually an led). And also making a dro flash in response to reaching a certain level. IN this test, the RPM dro is being used, but the target for this feature will be a dro (or a fancy gage) that measures power output on the a spindle. The action taken on an overload situation might be to start a cooling fan or slow the federate in response to a motor overload in order to prevent a fault.

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #62 on: March 18, 2015, 10:10:37 AM »
Size limitation required a second post for the second video . . . .

Second: demonstrates a simple context sensitive control. The two sliders are for RPM and SFM and can be set from the dro or the slider or a macro. They work in real time so moving the slider changes the rpm of the 4th axis while it is running. the SFM slider is only active in 'AutoSpeed' mode and the RPM slider is only active in 'SetSpeed' mode. Since the controller takes it's data directly off the dro, it is not possible to change the spindle speed using the wrong method. ex. setting 1000 SFM could result in an entirely different speed than 1000 RPM.

Note that any monitoring task, so far as I can determine, must be run in the PLC script. Working in this script should be done with consideration for how much processing power you are consuming with your script and keeping in mind that you should not loop anything as it can easily  get into a 'deadly embrace' wherein whatever need to happen to break out of the loop . . will never happen while in the loop.

Question:
I can find no way to create a variable in the PLC script that will not be reinitialized on each running of the script. It seem that rather than loping within the script, it runs from the beginning each time. I suppose this might be good in some ways, but having no variables to carry data forward to the next run is uber inconvenient. As a work around, I am using a gReg to carry forward a simple counter that controls the speed of the flashing on the dro.

Does anyone know how to create a var that will not be reinitialized? Lua syntax to create a variable  is: var ::= name, but that does not work in MACH4. I have been unable to figure out how to create a variable without initializing it.
« Last Edit: March 18, 2015, 10:26:38 AM by simpson36 »

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #63 on: March 22, 2015, 03:53:22 AM »

I have figured out how to eliminate the border around the buttons, but to do so would require either;

Mach4 team to add this to their screen editing routing

- or-

Access to the source code for the Mach4 screen set

So the question is:

Do we have access to the MACH4 screen source code?

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #64 on: April 06, 2015, 06:46:18 PM »
Attached video shows the completed spindle power monitoring.

I have been unable to get the 'gauge' screen item to work at all, but I am developing some tricks to make interesting 'gauges' using different techniques as shown in the attached video fragment.

The analog data is being collected by the Arduino DUE board which does the A/D conversion and maps the values to  0 thru 150%  and ships them across TCP Modbus to a DRO on the MACH4 screen. The PLC program grabs the data from the DRO and controls the 'gauge' bar and the warning light.

The percentage can be a percentage of the maximum or a percentage of the current torque limit setting, which I have in mind to use for rigid tapping.

I *think* I saw a bunch of user accessible data fields in the tools data base, so if that is correct, then each tap size can have an associated torque limit as a parameter and that could be sent to the spindle drive and the displayed torque range could then display from 0 to 1XX% of the torque limit.

With that scenario, the drive could be relied on to fault if the torque limit was exceeded -or- the Torque limit data from the tool table could be used by the script to pause the running G-code if the torque limit is exceeded for the particular tap being used. The pause and associated error message would allow the operator to change the tap and then simply continue along instead of tracking back the line of untapped holes like following bread crumbs until you find the one with the snapped off tap stuck in it.

There are a lot of other interesting and useful things that can be done with the spindle load data once it is in MACH . .  which is now is.
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #65 on: January 27, 2016, 01:08:49 PM »
Hi there,

I'm doing a big rework on my custom Mach3 screen to port it to Mach4. I've already played around a bit with the designer, read through the manuals and threads but now I'm at the point at which I need some questions to be answered to get some nice graphics stuff working; since this thread contains some promising suggestions I allow myself to take it up again for further inspiring discussions  :)

1. working with multiple pages: I have multiple pages in my screenset (don't want to have them be organized in tabs because of graphical reasons) and I want so have a "Master page
" whose objects (buttons, labels etc.) are visible on all other pages. In the machscreen screendesigner there was such a master page. In the screen 4 designer I can see all objects from all other pages, but during runtime I only see the objects of the active page. So: why can I always see all objects of all pages in the editor, but more important, is there a way to make certain objects visible to all pages?

2. transparent image buttons: another important questions for me as it would save a lot of work.. for this I took up this thread.

3. LEDs with images: I need images on a LED toggled by the state of the LED. Since LEDs in Mach4 doesn't support images by now, did I get it right that one possible solutions is to monitor the led state in the PLC script and then change the image of an image object according to this state? So I have to write code for every "image LED" I want to have, but I have the advantage of having more than two states, right?

some other issues I've encountered, not sure if they are bugs, features etc. so I first wanted to ask..
4. objects moving by themselves (if screenset is larger than monitor): I've noticed that some, if not all of my object change their position nearly every time I switch from editor to runtime mode. Maybe because my screenset is bigger than the editing area? It's for 1280x1024, so the actual design size is 1272x950 (res. minus taskbar and menue), my monitor has 1680x1050; so it might be the issue mentioned here?:
Yes, it works fine for me. You do need to get used to it, and do things a certain way. Also, I use it in XP, it may not work as well in newer OS's.
Also, I've heard that if the screenset is larger than your monitor, and it uses scrollbars to display it all, it can have issues.

5. What's the "Lock Position" Button for? I don't see any effects..?

6. The "o"-Key isn't working in the screen designer tree manager window and the object properties window for me. Anyone has the same issue?

Thanks for any suggestions, Jerry
« Last Edit: January 27, 2016, 01:17:41 PM by tyllurius »

Offline ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #66 on: January 27, 2016, 01:50:25 PM »
That sentence you quoted from me was talking about the Mach3 screen editor, which is called Screen4. It has nothing to do with Mach4.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #67 on: January 27, 2016, 02:04:05 PM »
Oh ok, I got that wrong.. Still I have a similar issue in the Mach4 screen designer so I wonder if anyone noticed that too.