Hello Guest it is March 29, 2024, 11:54:09 AM

Author Topic: GetVar(2002)  (Read 6963 times)

0 Members and 1 Guest are viewing this topic.

Offline amnon

*
  •  40 40
    • View Profile
GetVar(2002)
« on: October 21, 2014, 01:05:38 AM »
Hay,

Code "G31Z-10 F100" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit

Could some one explain me why is that when I put MsgBox ZProbePos I have always 0

Regards
Amnon

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: GetVar(2002)
« Reply #1 on: October 21, 2014, 02:59:22 AM »
hope you are putting the value into MSGbox like this:

MsgBox cstr(ZProbePos)

should work. i do it in the same way.

regards Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline amnon

*
  •  40 40
    • View Profile
Re: GetVar(2002)
« Reply #2 on: October 21, 2014, 05:07:23 AM »
Thank's

What does "cstr" mean

Regards
Amnon

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: GetVar(2002)
« Reply #3 on: October 21, 2014, 05:54:25 AM »
Hi,

cstr converts numbers to string, because msgbox can only display string.
look here: http://www.machsupport.com/help-learning/product-manuals/

for vb script manuals
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: GetVar(2002)
« Reply #4 on: October 21, 2014, 07:05:00 AM »
You usually don't need to convert to a string to put something in a messagebox.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: GetVar(2002)
« Reply #5 on: October 21, 2014, 09:49:36 AM »
You usually don't need to convert to a string to put something in a messagebox.

you are right with the example above.

but only in this case:
Test = 1234.5
MsgBox Test

not in this case:
Test = 1234.5
MsgBox "Test = " + CStr(Test)

Thomas

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: GetVar(2002)
« Reply #6 on: October 21, 2014, 09:57:39 AM »
Correct, if you want both string and numeric data, you need to convert all to sting data as you've shown.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: GetVar(2002)
« Reply #7 on: October 21, 2014, 10:39:58 AM »
depends on which concatenation operator you use (+ or &)

Test = 1234.5
MsgBox "Test = " & Test

is fine.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: GetVar(2002)
« Reply #8 on: October 21, 2014, 10:49:08 AM »
Also correct. :)
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline amnon

*
  •  40 40
    • View Profile
Re: GetVar(2002)
« Reply #9 on: October 22, 2014, 06:51:15 AM »
How macro knows that after :

Code "G31Z-10"
While IsMoving()
Wend


Z axis should be put into 2002(ZProbePos)
ZProbePos = GetVar(2002)

Respect
Amnon