Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: ravencnc3 on April 16, 2019, 04:31:28 AM

Title: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 16, 2019, 04:31:28 AM
Hello,

None of the provided Documentation documents this:
mc.mcCntlGetPoundVar(inst, mc.SV_PROBE_POS_Z)
It is not included in the scripting manual.

Where ist a list, that explains SV_PROBE_POS_Z ?
Also mcCntlGetPoundVar is not in the scripting manual, only in examples.


I assume SV_PROBE_POS_Z is the last Probe G31.1 Z in WCO.
But how to get the other probe coordinates and how to get them in Machine coordinates?

Any Idea how to find those magic numbers used in all the mcCntlGetPoundVar examples?
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: joeaverage on April 16, 2019, 05:02:20 AM
Hi,
this is from API.chm:

Quote
LUA Syntax:
value, rc = mc.mcCntlGetPoundVar(
      number mInst,
      number param)

Description:
Get the value of a system variable (pound variable).

Parameters: Parameter Description
mInst The controller instance.
param An integer specifying a system variable.
*value The address of a double to receive the value of the system variable.


Returns: Return Code Description
MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_INVALID_ARG param is out of range.

Check out the Enums:

https://www.machsupport.com/forum/index.php?topic=30323.0 (https://www.machsupport.com/forum/index.php?topic=30323.0)

This is an excerpt from the lists:

Quote
mc.SV_PROBE_POS_X // G31 Skip signal
mc.SV_PROBE_POS_Y
mc.SV_PROBE_POS_Z
mc.SV_PROBE_POS_A
mc.SV_PROBE_POS_B
mc.SV_PROBE_POS_C
mc.SV_PROBE_MACH_POS_X // G31 Skip signal machine position
mc.SV_PROBE_MACH_POS_Y
mc.SV_PROBE_MACH_POS_Z
mc.SV_PROBE_MACH_POS_A
mc.SV_PROBE_MACH_POS_B
mc.SV_PROBE_MACH_POS_C

Craig

Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 16, 2019, 05:11:08 AM
Thank you.
But how to get the second Probe Values?
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: joeaverage on April 16, 2019, 05:21:05 AM
Hi,

Quote
But how to get the second Probe Values?

Sorry, not sure what you mean.....second values?

Craig
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 16, 2019, 06:11:03 AM
There are multiple probe Inputs:
G31.1, G31.2,...

If you touch with a 3d Probe on the tool length sensor in order to find the TLO offeset for the 3d Probe - it is neccessary that two Probe inputs trigger. The one for the Tool length sensor (G31.1) and the one for the 3d edge finder (G31.2) wich triggers afterwards.
Then there are 2 differenzt Z Positions - which difference then is the switch hysteresis for the 3d Probe.

So there must be this set of variables for each Probe input G31.1 G32.2,... I think there are 4 of them in Mach 4.


Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: Cbyrdtopper on April 16, 2019, 09:02:21 AM
I thought these were documented, but when I went back to check where I found the G31 and couldn't find G31.1 - G31.3. 
G31 Part Z Coordinate is #5063 and G31 Machine Z Coordinate is #5073
I thought the others were documented, but clearly they are not.  Open up the Reg file #VARS to about #5000 - #5500 and make a few probe strikes on G31.1 and see if any of them change.  Trial and Error has helped me find #VARS in the past. 
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 16, 2019, 09:33:07 AM
Thank you Cbyrdtopper.
Any way to reach out to the developers to improve documentation on this?

Would even be great to have the known enums in the scripting documentation and not "only" in the forum from a community Member. Would be easier to find for new users.
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: bryannab on April 16, 2019, 09:51:07 AM
Would even be great to have the known enums in the scripting documentation and not "only" in the forum from a community Member.

This information is in the g code documentation included in the Help Docs folder in Mach4 under the entry G31/G31.X. It's not a hidden secret, you just need to read the manuals.
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 16, 2019, 10:41:18 AM
Thank you for pointing me there.
But its only the numbers, not the enum. For that reason my text search through all documents found no match.

And it is only the G31 variables not the others for G31.1,...
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: Fledermaus on April 16, 2019, 05:52:47 PM
As far as I know, there is only a single set of variables. These are updated by the most recent probe strike, whether it is probe 1, 2, 3 or 4. At least that is how it works for me using a CS Lab controller..

Allan
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: joeaverage on April 16, 2019, 06:43:13 PM
Hi,
on my laptop I have been experimenting trying to find the pound variables associated with the different
probe channels. I have found as Allan has, namely that there is just the one set of pound variables
which are set with either g31, g31.1, g31.2 or g31.3.

I assumed it was because my laptop uses the Sim plugin. I have yet to try it at my machine. I am now thinking
however that Allan is right, there IS only one set of pound variables and its up to your code to save each set
of data and ascribe it to the correct probe channel.

Craig
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 17, 2019, 01:31:34 AM
Thank you for your effort.
That is a pity, because if you have a double pound, you can not distinguish them.
Only solution then is, to do the touching two times, and react on the different signals hoping the touch spot keeps the same.

Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: joeaverage on April 17, 2019, 01:50:30 AM
Hi,
you can only issue on g31.x at a time. Therefore if you probed your surface plate with a g31.2, the data from the
probe event could be stored before probing with a g31.1 for instance. That data would then be stored also but distinctly
from the previous g31.2.

Craig
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: Fledermaus on April 17, 2019, 04:45:10 AM
Craig's approach  is absolutely right.

Allan
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: Cbyrdtopper on April 17, 2019, 10:08:11 AM
I agree with Craig and Allan.
Since you can only use 1 probe move at a time there is no reason to have multiple #VARS to store each individual probe strike.
After the prove strike, take the value and store it in another register.
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 18, 2019, 02:17:55 AM
Tnx all, will find a solution.
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: joeaverage on April 18, 2019, 06:15:53 AM
Hi,
have we not outlined a solution?

Craig
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: ravencnc3 on April 18, 2019, 06:27:42 AM
Hi Craig,

maybe this is a missunderstanding due to my bad english translation, but I want to point out my thank you to all of you and will implement a solution based on your ideas.
Title: Re: Missing Documentation of mcCntlGetPoundVar magic numbers...
Post by: smurph on April 22, 2019, 11:40:22 PM
Allan hit the nail on the head.  All of the probes, 31, 31.1, 31.2, and 31.3 will write to those variables.  The 4 probe moves are there so that a tool setting probe can be differentiated from a surface probe, etc...

Steve