Hello Guest it is April 18, 2024, 05:01:00 AM

Author Topic: Screen Set Ideas  (Read 184683 times)

0 Members and 1 Guest are viewing this topic.

Re: Screen Set Ideas
« Reply #220 on: December 09, 2014, 09:40:14 AM »
I was trying to answer this question about doing a dry run and getting the real time status on spindle, coolant or read the tool that should be active on that line of code.

Obviously I know there are API calls for spindle and coolant control, but there is only one way to know if they should be on or off on a certain line of Gcode.  And the API to read the status is returned in a structure that only a plugin can read.

For clarification “Run From Here” is calling “Dry Run” and then pulling the positions from the interpreter to know where to move the axes to for that line of code. The user can jog or use the dialog to move into position.  The API to read the current state for the auxiliaries is more geared for a developer because it takes a lot of work to implement, and almost everyone will want to implement it a little differently.

Was playing around with the Dry run function and noticed that it does not start the spindle, coolant, or pick up the tool changes for my testing.  ???

The only way to get the spindle data is through a plugin. There isn't a scripting API for it.

Code: [Select]
mcCntlGcodeInterpGetData(MINSTANCE mInst, interperter_t *data);

struct Interperter_info {
double ModalGroups[MC_MAX_GROUPS];
double FeedRate;
double SpindleSpeed;
int SpindleDirection;
bool Mist;
bool Flood;
int ToolNumber;
int HeightRegister;
int DiaRegister;
};

typedef struct Interperter_info interperter_t;
Andrew
MachMotion
Re: Screen Set Ideas
« Reply #221 on: December 09, 2014, 09:40:41 AM »
Thanks Scott.

Though I dont understand with left and right, why id have to cock my head like a dog to see whats on the screen to compare it to whats on my machine (why isn't Z always vertical?) I'd like to have a front and back option too if possible.  ;)
Re: Screen Set Ideas
« Reply #222 on: December 09, 2014, 09:44:47 AM »
Thanks Andrew,

Can we assume that these checks/API functions will be added to Mach4 or is the a MachMotion feature exclusive?
Re: Screen Set Ideas
« Reply #223 on: December 09, 2014, 10:17:29 AM »
This feature is open to anyone that wants to mess with it...  We did make our own Run From Here that is setup for our interface.

Thanks Andrew,

Can we assume that these checks/API functions will be added to Mach4 or is the a MachMotion feature exclusive?
Andrew
MachMotion

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Screen Set Ideas
« Reply #224 on: December 09, 2014, 10:51:24 PM »
Ok, I did mess with it, and got it working from within a plugin.. (see screen shot),
but, it was a long slide for a short gain. In this case, I just wrote the values out
to the XML so I could prove it out.

But, Steve said, that would be to slow, so, it is better to write out to a register as another place to put data where it would be global in nature to get to it from your screen set, or Macro, or Wizard.. etc.

Steve also said, (as usual), there is an easier way.
you will need to look at the Mach4.api to get the defines for all the things you can get to.

the "mcLua" commands of:

local val = mcCntlGetValue(inst, COMMAND, PARAM) will get a TON of all kinds of stuff.
local xAxis = 0;
i.e.: local xPos = mcCntlGetValue(0, VAL_MACHINE_POS, xAxis);

and the
mcCntlGetPoundVar(inst, #VarValue) will get just about everything else.
i.e.: mcCntlGetPoundVar(inst, mc.CUR_TOOL_NUMBER) will get just about everything else.

so, all the various structures, can be gotten to via mcLua in a round about way.

Thanks Steve for the Heads Up!!

Scott
« Last Edit: December 09, 2014, 10:56:18 PM by poppabear »
fun times
Re: Screen Set Ideas
« Reply #225 on: December 10, 2014, 07:08:57 AM »
Scott you make it sound like: After I use "Run form Here" or "Dry Run" then check some variables that Mach4 now knows all. I did some quick trials and I did not find that to work. Never knew the tool, coolant, cutter comp, or fixture offset status from the gcode file. I created some registers and watched, just filled them with the current states not what the gcode set.


Maybe I need a wxsleep() to let it "settle in" before checking status.
« Last Edit: December 10, 2014, 07:17:10 AM by Ya-Nvr-No »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Screen Set Ideas
« Reply #226 on: December 10, 2014, 07:17:55 AM »
Take a look at the api, you have a copy.
Steve was the one who was kind enough to show the alternate way.
He had also read these threads. Perhaps both He and I are
not understanding what you're wanting.

So to help avoid mis-understandings, can you post exactly what it is your trying to do,
(make work), and the way your wanting the data to show, under what conditions?

Scott
fun times
Re: Screen Set Ideas
« Reply #227 on: December 10, 2014, 07:34:49 AM »
In the button scripts, at the end of reading the gcode and it is stopped at the line number, I check the variables and it returns the same values as before the button was pressed. Like I mentioned, I might have to use a sleep before checking or it could be my plc script is conflicting with the gcode reading, as its looking at DRO's on the screen too.

Update:
Quote
could be my plc script is conflicting with the gcode reading, as its looking at DRO's on the screen too.
yep that looks like that was it
« Last Edit: December 10, 2014, 07:46:14 AM by Ya-Nvr-No »
Re: Screen Set Ideas
« Reply #228 on: December 10, 2014, 12:57:39 PM »
It gets the tool and sets the g codes now, but im missing the spindle and coolant status

I wrote a function that gives me all the I/O not equal to zero and lets me know the number and name of the signal.

I can physically turn the outputs on and off with buttons or MDI commands but still missing the ability to do a (dry run / run from here ) and have it give me proper status.

I tried scotts MAD but that did not show signs of spindle and coolant change either.

Somewhere I'm missing something ???

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Screen Set Ideas
« Reply #229 on: December 10, 2014, 02:11:45 PM »
Quote
I tried scotts MAD but that did not show signs of spindle and coolant change either.

MAD only looks at the signals in Mach, if they are enabled, it only shows what "Mach4" knows about a signal.

Scott
fun times