top of page

The SETVN command

In custom macro B, SETVN stands for Set Variable Name. It allows you to place a short message – up to eight characters long – next to some of the permanent common variable (#500 series variables). Doing so allows you to document the use of some of the permanent common variables. So when the control’s display screen is set to show the permanent common variables page, messages will display next to the permanent common variables.


Note that controls vary when it comes to how many permanent common variables you can document in this fashion. With many controls you are limited to the first ten (#500 through #509). Other controls allow you to document the first fifty (#500 through #549), assuming the control has this many permanent common variables. You must reference the custom macro section of the Operators Manual in order to determine how many variables you can document with SETVN.

The format for the SETVN command is:

  • SETVN 500[STYLUS D]

The number next to the SETVN word is the variable number being set. The message in brackets will be displayed next to the #500 series variable. The message must be in upper case characters (capital letters).


With the previous example, the message STYLUS D will appear next to (to the left of) permanent common variable #500.


If you have an application that uses permanent common variables, it’s not a bad idea to document them. This will let everyone know which permanent common variables to avoid using in new custom macro programs and will explain the meaning of each. For example, maybe you have set three two system constants – one for rapid approach distance (using #500), one for the M code number corresponding to low spindle range (using #501), and one for the M code number corresponding to high spindle range (using #502).


This program will nicely document the three permanent common variables:

  • O0001

  • SETVN 500 [APPROACH]

  • SETVN 501 [LOW RNG]

  • SETVN 502 [HIGH RNG]

  • M30

Once this program is executed, the messages will appear next to the three permanent common variables.


You may be wondering how to remove the message next. Simply specify a SETVN command with eight spaces in the brackets. This program will remove the messages from permanent common variables #500 through #509:

  • O0002

  • #101 = 500 (Counter)

  • N1 IF [#101 GT 509] GOTO 99 (Test if finished)

  • SETVN #[#101] [ ] (Eight spaces in the brackets)

  • #101 = #101 +1 (Step counter)

  • GOTO 1 (Go back to the test)

  • N99 M99 (End of program)

1,219 views0 comments

Recent Posts

See All
bottom of page