Hello Guest it is April 18, 2024, 08:56:48 AM

Author Topic: Pass value from gcode to VB  (Read 2419 times)

0 Members and 1 Guest are viewing this topic.

Pass value from gcode to VB
« on: January 23, 2013, 01:07:04 AM »
I would like to pass a value from gcode to my macro m1234 and save it as a variable in VB.
In gcode
M1234 val1 val2

In VB
Dim val1, val2
Then fill the variables with the information.

Also passing variables from VB to gcode would be great as well.

Thanks in advance for any help.
Lewis

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Pass value from gcode to VB
« Reply #1 on: January 23, 2013, 03:13:17 PM »
In a macro you can pass 3 variables to the macro, BUT BE ADVISED that Param3 does NOT go back to nill at macro end it stays at current value(BUG)

M1234 P# Q# R#

Inside the macro they are known as Param1 Param2  Param3


Dim Val1 ,Val2, Val3

Val1= Param1
Val2= Param2
Val3= Param3
********************************
Passing values to Gcode #var

SetParam(29,999.999)   'It sets #29 to 999.999

IT IS ALL IN THE MANUAL (;-)

(;-) TP
Re: Pass value from gcode to VB
« Reply #2 on: January 23, 2013, 08:42:28 PM »
Thanks for the code. I will do a search for the manual.