hy
rdhoggattjr
this code works on osp300L :
Code:
NOEX V1 = 0
$ VS099 = 111111
$ VS99 = 222222
$ V1 = VS099 ( v1 will be 222222 )
VS* is like common variables, but also much more :
... VSET : is like an instruction, allowing to declare variables inside sdf
... VCAC* : is like a boolean, returning spindle state : S or C mode
... VS27, VS28, VS29, VS30 : is like a common variables, inside renishaw probing macros
- system variables are linked with the controller; they are initialized by it
- common variables are not linked with the controller; they are not initialized by it, but by the user / programmer
when you use VS* like that, you are entering an area that may be protected, so you have to be sure:
... that the controller is not using those syntaxes, or
... that the controller is using those syntaxes, but the way that you are using them is not interfering with the controller
to avoid such potential dangerous situations, then use common variables, or local variables ( they can no be changed from an input panel )
your program has 2 types of variables : system variables ( VS*, V**** ) and local variables ( PAT , PNT );
if possible, use a single type of variables
pls be aware, about PAT , PNT : until a while ago, it was not allowed to use local variables that begin with P
that code that you shared, is a lucky hit, or created by someone who knows the interferences
system variables are global
that seems to be a tool change macro, that uses also tool groups ; why do you need to lock the variables, so to make it work ? why do you can not rely on common variables ?
whatever exception exists, it must be handled by the code, and the code itself should stand-alone, whatever the common variables values are ...
there is an exception case with your code, so you wish to avoid common variables : what is that exception ?
also, somewhere, you lose traking the data, so you need to read the VS* value / kindly