M62 to M65 - On Screen Toggle Box

More
17 Jun 2014 11:26 - 17 Jun 2014 11:28 #48022 by Askjerry
When I assign a pin to COOLANT, I get a checkbox on the screen that I can toggle to turn the output pin on/off.
I can also control this pin by using M7 / M9 to turn it ON / OFF.

It would be nice to be able to have the same for the DIGITAL OUT pins.

For example, if I assign DIGITAL 0 and DIGITAL 1... I can use M62 P0 or M62 P1 to turn these on during a run. Let's say that I assign DIGITAL 0 as a pin controller for pneumatics, then clamp a vice automaticacally. I can do a M64P0 to cause the vice to close... then a M65P0 to open it again.

But what would REALLY be nice... would be to have a checkbox on the screen that has: [_] CLAMP for example. Then I could toggle it anytime I wanted by clicking the box.

Can that be done?

How?

Thanks.
Jerry
Last edit: 17 Jun 2014 11:28 by Askjerry. Reason: Grammer / Spelling / Clarity

Please Log in or Create an account to join the conversation.

More
17 Jun 2014 13:40 #48025 by ArcEye
Hi

As you are already aware you can do it via MDI, look at these

www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199

www.linuxcnc.org/docs/html/gui/halui.html MDI section

www.linuxcnc.org/docs/html/hal/pyvcp.html#_buttons

You can create a button which triggers a halui MDI command, which can either be an existing one, or one you define yourself

regards
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
17 Jun 2014 20:07 - 17 Jun 2014 20:08 #48037 by Askjerry
:) Thanks for the fast reply!

This is better than I expected. I was not aware you could also assign MDI to a button... this will allow me to create a button with the following...

M5 M9
G00 Z0
G00 X0 Y0

With a single click i can shut off the coolant and spindle (if on) and move the tool out of the way. That will be very useful. I'll create a bogus machine to experiment on so i don't mess up what I have already... then do the actual modification when I feel more confident. I am very excited to get my mill back up and running after 5 years in storage!


Video: Getting the mill back from St Louis.

I am also very excited with the capabilities of the software which will be replacing DeskNC that I had running on a Win98 machine. (Told you it's been awhile.)

Thanks again!
Jerry
Last edit: 17 Jun 2014 20:08 by Askjerry. Reason: Make neater, more readable.

Please Log in or Create an account to join the conversation.

More
18 Jun 2014 01:46 - 18 Jun 2014 01:59 #48043 by BigJohnT
You would need three buttons for that as a MDI command is one line only. You can however create a subroutine and call that just like a G code file.
MDI_COMMAND = o<myfile> call

www.linuxcnc.org/docs/html/gcode/o-code.html

St. Louis to where?

JT
Last edit: 18 Jun 2014 01:59 by BigJohnT.
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
18 Jun 2014 03:57 - 18 Jun 2014 04:18 #48044 by Askjerry
Okay... I see. Make an MDI file within the directory, then point the button to that file... gives the appearance of a single immediate command to the user, but in actuality could be quite complex.

Even better. :P

Looks like I have some study and experimentation to do when I get back home this weekend. Should be great in the end... much more powerful than what i was used to. I picked up a "new" machine from the local discount computer place, $99. It's a Pentium 4, Optiplex... about 3x faster than the old machine... should work out well.

I'm in Kyle, TX... about 1/2 hour South of Austin. Once I get it all running, I'll make a YouTube video with the details and likely post it here for others to find.

I really appreciate all the help!

I created the configuration for the milling machine as "Wells-Index" on my Linux PC... this created a directory also called "Wells-Index" on the desktop... I presume these MDI files would reside within that directory correct? Or do they need to go into a specific directory for the Linux CNC software independent of the folder I created with the STEPCONFIG Wizard.?
(Still getting used to this operating system/software.)
I presume...
Root -
.        |- Linux CNC software folder (Actual software)
.        |- Wells Index folder - (My configuration stuff)
.                                              |- stepconfig file (Created by the wizard)
.                                              |- myfile.ngc
.                                              |- more_routines.ngc

Is that about correct? (I won't get back to tinker until Saturday.) :(

Thanks,
Jerry
Last edit: 18 Jun 2014 04:18 by Askjerry.

Please Log in or Create an account to join the conversation.

More
18 Jun 2014 15:45 #48054 by ArcEye

I created the configuration for the milling machine as "Wells-Index" on my Linux PC... this created a directory also called "Wells-Index" on the desktop... I presume these MDI files would reside within that directory correct? Or do they need to go into a specific directory for the Linux CNC software independent of the folder I created with the STEPCONFIG Wizard.?


In your home dir (/home/jerry) there is a folder linuxcnc

Within this is a folder /configs and within that a folder for each configuration you have, so your config files would be in ~/linuxcnc/configs/Wells-Index

The normal place for all your gcode is ~/linuxcnc/nc_files. All your gcode and the user M code files should be there

In your ~/linuxcnc/configs/Wells-Index/Wells-Index.ini file ensure that you have the setting PROGRAM_PREFIX = /home/jerry/linuxcnc/nc_files
(note I have not used the tilde ~ to denote home dir, because this cannot be resolved in earlier versions of Linuxcnc and I don't know what you are running)

Whenever Linuxcnc looks for a ngc file or a user M code, it will look by default in that directory now.

Read the link I gave previously
www.linuxcnc.org/docs/devel/html/gcode/m...tml#sec:M100-to-M199

The M code files MUST be executable, uppercase, no extension etc

regards
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
18 Jun 2014 19:29 #48065 by BigJohnT

Okay... I see. Make an MDI file within the directory, then point the button to that file... gives the appearance of a single immediate command to the user, but in actuality could be quite complex.


Actually you are making a subroutine file and calling that with the MDI command. The subroutine file is a G code file with sub/endsub wrappers.

I'm in Kyle, TX... about 1/2 hour South of Austin.


Wow that was quite a drive, I was just fishing to see if you were in Missouri too.

JT
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
19 Jun 2014 06:33 #48096 by andypugh

The normal place for all your gcode is ~/linuxcnc/nc_files. All your gcode and the user M code files should be there

In your ~/linuxcnc/configs/Wells-Index/Wells-Index.ini file ensure that you have the setting PROGRAM_PREFIX = /home/jerry/linuxcnc/nc_files
(note I have not used the tilde ~ to denote home dir, because this cannot be resolved in earlier versions of Linuxcnc and I don't know what you are running)

Whenever Linuxcnc looks for a ngc file or a user M code, it will look by default in that directory now.


I like to keep hard-coded (MDI button linked) G-code routines in the config folder. They seem to me to be part of the config. There is less danger of accidentally tidying them away there.

I have SUBROUTINE_PATH = ../../../nc_files/gladevcp_lib:./ where the trailing ./ means that it looks in its own config folder. I am not sure I understand the first half. Perhaps that machine is on a Run-In-Place build...
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
19 Jun 2014 13:51 #48112 by ArcEye
Andy Pugh wrote:

I like to keep hard-coded (MDI button linked) G-code routines in the config folder. They seem to me to be part of the config. There is less danger of accidentally tidying them away there.


Well actually I keep all my M1xx files in one directory, my ngcgui files in another and ngc files in a third.
All of them are symlinked to the directory pointed to by the ini file.

That way I maintain them separately, which makes things far more orderly and they are reflected in the designated dir, which is never directly edited.

But didn't seem suitable advice for someone starting B)
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

More
20 Jun 2014 09:03 #48135 by Askjerry
I'll look at the directory structure when I get back and see what default files are there.

I'm running the latest build, I downloaded the ISO, installed it on the machine (dual boot mode) and made the configuration using the wizard. It is about as stock as you can get... so if I made any serious errors, I could just reformat and start over. I'll back up my configuration on a USB drive... then experiment incrementally with changes.

When finished I'll likely have the following setup/machines...

Wells Index - XYZA With modified buttons, home switches, etc. (Full feature)
Wells index - XYZ (Full Feature like above, only 3 axis)
BASIC MILL - XYZ Training version, no home switches, stock features.

The XYZA would only be used when I have the A-Axis connected (detached when not in use), otherwise I'll use the XYZ configuration. Once I figure out the directories and get a "feel" for how it works, I'll have a common folder(s) for the specialty files... but that will happen after I get a better understanding of the system. (I have a second PC just for learning the advanced stuff... so I don't goober up the main machine.)

Once stable I'll post for follow-up. I think I have enough reading material now to at least get started.

Thanks,
jerry

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum