$0

ViS-PCBOX

ViS CNC SYSTEM

Hardware: Software:
Macro language
A macro is an addition to standard G-code and can be written in a simple scripting language. Macros increase the functionality and flexibility of any CNC machine. Macros increase the capabilities of the equipment.

The ViS control system also supports background macros, that is macros that constantly work with the main program.
To make a macro background, you need to check the box on the right in the column called "BG".

A macro is simply text that is saved in the "MACROS" panel:



Button EDIT - edit an existing macro
Button ADD - add new macro
Button REMOVE - remove an existing macro
Button EXECUTE - run the macro once



Range for custom M codes:
100 to 999


Range of user variables:
#100 ... #999


Comments:
;Following the ';' are ignored up to the newline character
(...)Content within parentheses is ignored


Assignment operator:
=


Comparison Operators:
>More
<Less
==Equal
!=Not equal
>=Greater than or equal to
<=Less than or equal to


Conditional operator:
IF[...] <...>If [true/false], then <...>
IF[...]
{
   <...>
}
ELSE
{
   <...>
}
If [true/false], then { <...> }, else { <...> }


Loop operator:
WHILE[...]
{
   ...
}
As long as the expression in square brackets is true, execute the code in a loop.


Named system variables (read-only):
#PARAM<P> The value of the <P> parameter (for parameters of type Integer, Double, Boolean)
#X The value of the current machine coordinate along the X axis
#Y The value of the current machine coordinate along the Y axis
#Z The value of the current machine coordinate along the Z axis
#A The value of the current machine coordinate along the A axis
#B The value of the current machine coordinate along the B axis
#C The value of the current machine coordinate along the C axis
#ZPX<...> Zero point value <...> along the X axis, where <...> -> 53...59, 5401...5499
#ZPY<...> Zero point value <...> along the Y axis, where <...> -> 53...59, 5401...5499
#ZPZ<...> Zero point value <...> along the Z axis, where <...> -> 53...59, 5401...5499
#ZPA<...> Zero point value <...> along the A axis, where <...> -> 53...59, 5401...5499
#ZPB<...> Zero point value <...> along the B axis, where <...> -> 53...59, 5401...5499
#ZPC<...> Zero point value <...> along the C axis, where <...> -> 53...59, 5401...5499




List of functions (F - suitable for background macros):
MDI("<COMMAND>")FExecuting an MDI command <COMMAND>
GetInputState(<N>)FGet the current state of digital input <N> (0-not active or 1-active; in case of an error, the value -1 is returned).
GetOutputState(<N>)FGet the current state of digital output <N> (0-not active or 1-active; in case of an error, the value -1 is returned).
SetOutputState(<N>, <0;1>)FSet digital output <N> to 0-inactive or 1-active state.
GetOutputStateRS485(<N>, <A>)FReceive from the external output block with address <A> the current state of the digital output <N> (0-not active or 1-active; in case of an error, the value -1 is returned).
SetOutputStateRS485(<N>, <A>, <0;1>)FIn the external output block with address <A>, set the digital output <N> to 0-active or 1-active state.
GetMachineCoord(<C>)FReturns the current value of machine coordinate <C>.
GetProgramCoord(<C>)FReturns the current value of the program coordinate <C> from the loaded NC to the system. Possible arguments to <C>: X, Y, Z, A, B, C, U, V, W
GetWorkCoord(<C>, <WCS>)FReturns the current value of the <C> coordinate of the zero point <WCS>. Possible arguments to <C> are: X, Y, Z, A, B, C, U, V, W. <WCS> -> 53...59, 5401...5499
SetMachineCoord(<C>, <V>)FSet the new value <V> of the machine coordinate <C>.
GetCurrentFeed()FReturns the current movement speed value.
GetProgramFeed()FReturns the value of the movement speed specified in the NC file.
GetOverrideFeed()FReturns the current value of the motion speed offset (in percent).
SetOverrideFeed()FSet a new value for the movement speed corrector (in percent).
SetSpindleRPM(<N>, <S>)Set the rotation speed value <S> [rpm] for spindle <N>.
StartSpindleCW(<N>)Starts spindle rotation in the forward direction for spindle number <N>
StartSpindleCCW(<N>)Start spindle rotation in reverse direction for spindle number <N>
StopSpindle(<N>)Stop rotation for spindle number <N>
WaitSpindleRPM(<N>)Wait (do not continue executing the program) until the spindle speed <N> reaches the specified value
GetActiveSpindle()FReturns the number of the currently active spindle: from 1 to 4
GetSpindleERRORcode(<N>)FReturns the error code in the operation of the frequency converter for spindle number <N>
IsSpindleStopped(<N>)FReturns the status of spindle number <N>: STOPPED (or RUNNING)
GetCurrentSpindleRPM(<N>)FReturns the current spindle speed <N> [rpm].
GetTargetSpindleRPM(<N>)FReturns the specified spindle speed value <N> [rpm].
GetOverrideSpindle(<N>)FReturns the current value of the spindle speed override <N> (in percent).
Sleep(<T>)FPause <T> milliseconds. Range 1 to 60000 milliseconds (up to 60 seconds)
Stop()FSimulation of pressing the STOP button
Start()FSimulation of pressing the START button
SetEnabledMIST(<B>)FTurning on/off the cutting fluid (coolant) by mist/spray. <B> - true or false.
SetEnabledFLOOD(<B>)FTurning on/off the cutting fluid (coolant) by watering. <B> - true or false.
GetPARAM(<P>)FReturns the value of the parameter with number <P> (for parameters of type Integer, Double, Boolean)
ShowMessage(<S>, <W>, <H>, <B>)FDisplays the message <S> on the display screen. <W>,<H> - width and height of the panel.
If <B> = 1, then the message blocks the panel; if <B> = 0, then the message does not block the panel.
It is possible to use HTML tags in the message.
HomeAxis(<A>)Search for machine zero along axis <A>. Possible arguments to <A>: X, Y, Z
HomingComplete(<A>)The search for machine zero along the <A> axis has been completed successfully. Possible arguments to <A>: X, Y, Z
HomingReset(<A>)The machine zero search for the <A> axis is not completed. Possible arguments to <A>: X, Y, Z
SQRT(<N>)FCalculating the square root of a number <N>


Analogs of functions:
#INPUT<N>FGetInputState(<N>)
#OUTPUT<N>FGetOutputState(<N>)
#OUTPUT<N>:A<A>FGetOutputStateRS485(<N>, <A>)
OUTPUT<N>:<0;1>FSetOutputState(<N>, <0;1>)
OUTPUT<N>:A<A>:<0;1>FSetOutputStateRS485(<N>, <A>, <0;1>)



• Documentation • Terms & Conditions • Support • Contacts
Write a message
Copyright © 2024 ViS motion