Hello Guest it is April 19, 2024, 06:36:28 PM

Author Topic: Internal variables  (Read 10780 times)

0 Members and 1 Guest are viewing this topic.

Internal variables
« on: January 04, 2007, 09:05:19 AM »
Is there a list anywhere of the internal variables that can be accessed via GetParam and SetParam?

Thanks,

Max

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Internal variables
« Reply #1 on: January 04, 2007, 09:30:33 AM »
Yes, the "Mach Mill manual" Has the Parameters and their formats listed.
fun times
Re: Internal variables
« Reply #2 on: January 04, 2007, 11:09:13 AM »
I cant seem to find this "Mach Mill manual". The only thing i have found is listed in the customizing mach 2 manual, section 4.4.3, page 4-6, referencing the stepsperaxisX and accelerationX parameters. And some parameters listed in a table in the mach3 mill manual Fig 10.1, pg 10-8, listing some parameters that pertain mostly to offsets. Any help with finding this manual?

Thanks again

-Max

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Internal variables
« Reply #3 on: January 04, 2007, 12:09:34 PM »
Assuming your talking about accessing Machine code parameters (since you didnt specify), this Part 1:, and Part 1a: adresses it.  If you are talking about VB scripting Parameters Part 2: addresses that, both are from the WIKI.

Part 1:

Access to the machine G-code parameter block
Mach3 has a block of variables which can be used in part programs. They are identified by # followed by a number (the parameter address). The contents of the Tool and Fixture tables are in these parameters but there are many values that can be used by the writer of a part program. These machine variables can be accessed within macros by GetVar and SetVar.
Function GetVar (PVarNumber as Integer) as Double
Sub SetVar (PVarNumber as Integer, newVal as Double)
The predefined parameter variables are defined the manuals Using Mach3Mill and Using Mach3Turn.
Examples:
FixNumb = GetVar (5220)   ' get current fixture number
Rem set X offset of fixture 2 to be same as fixture 1
Call SetVar (5241, GetVar (5221))
Rem increment a counter, say in a multiple part layout
Call SetVar (200, GetVar (200) + 1))

Part 1a: (This is the section in the Mach3 Mill Manual that addresses Machine code Parameters

See section:
10.5.3.2
10.5.4

Part 2: Parameters as it applies to VB code (from the Wiki)

Interrogating Mach3 internal variables
The current value of Mach3 internal variables can be read using the GetParam function.
Function GetParam (name as String) as Double
This returns a numeric value corresponding to the name of the given variable which is provided as a string (constant or variable)
The corresponding routine SetParam sets the value of the variable to newVal.
Sub SetParam (name as String, newVal as Double)
Examples:
Rem interrogate drive arrangements
mechProp1 = GetParam ("StepsPerAxisX")
Rem make C acceleration be same as X for slaving
Call SetParam("AccelerationC", GetParam ("AccelerationX"))
Notice that the word "Param" is used here in a different sense to the Machine Parameters accessed by the # operator from within a part program and in accessing the Q, R & S word "parameters" to a macro call.

Scott

fun times
Re: Internal variables
« Reply #4 on: January 04, 2007, 01:05:27 PM »
Sorry for not specifying, but i am refering to the VB scripting. With the information that i have found, the only two variables that i am aware of are StepsPerAxisX, and AccelerationX. I was hoping to find a full list of these variables.

-Max

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Internal variables
« Reply #5 on: January 04, 2007, 04:31:54 PM »
YOU, make up your own variables.

i.e.

 Format: SetParam (name as String, newVal as Double) Thus,

SetParam(Whatever, 10)    'This would set your Parameter called "Whatever" to the value of 10
fun times
Re: Internal variables
« Reply #6 on: January 04, 2007, 05:49:23 PM »
I dont think that is completly correct in regards of what im looking for.

I can create a button with the following code.

     Steps = GetParam("StepsPerAxisX")

     MsgBox(Steps)

I can do this without ever using a SetParam, and the button will return the steps per inch that are input in the motor tuning section. Those are the parameters that i am trying to get a list of. i.e. , how would i know what the velocity of the x-axis is? Would it be "VelocityAxisX", or could it be "VelocityX"? I have no way of knowing without a list.

-Max

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Internal variables
« Reply #7 on: January 04, 2007, 06:15:23 PM »
Oh.........THAT list..........

Yeap, I have wanted that one too.
fun times

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Internal variables
« Reply #8 on: January 04, 2007, 06:49:03 PM »
Would the MACH 3 SDK version help?

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Internal variables
« Reply #9 on: January 07, 2007, 11:24:05 AM »
I would have a look at the code in the Calc steps per unit button on the settings page. I used some of that stuff in there...
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com