[ Pobierz całość w formacie PDF ]

Sub SetUserLED(LEDNum As Integer, State As Integer)
This function allows the state of a User LED to be set or cleared. User LEDs are
numbered from
Arguments:
LEDNum is the User LED to be set, and must be in the range of 1000 to 2254
State is the new state of the User LED. 0 indicates the LED is off (unlit), 1
indicates the LED is on (lit).
Return Value:
None
Example:
 Define some constants
FluxCapacitorControl = OUTPUT1  Output that controls
the flux capacitor
FluxCapacitorLED = 1234  LED that indicates flux
capacitor is active
 Turn on the Flux capacitor
ActivateSignal(FluxCapacitorControl)
 Turn on the Flux Capacitor LED for the operator
SetUserLED(FluxCapacitorLED, 1)
&
 Is the Flux Capacitor on?
FluxCapacitorOn = GetUserLED(FluxCapacitorLED)
See also:
GetUserLED(), SetOEMLED(), GetOEMLED()
SetVar
Sub SetVar(VarNum As Integer, Val As Double)
This function sets the Mach variable specified by VarNum to the value given by Val.
Mach variables are accessible both to CB scripts, using the SetVar() and GetVar()
functions, as well as G-code programs, using the #nnnn syntax.
Arguments:
VarNum is Integer the number of the Mach variable to be set.
Val is the Double value to which the variable will be set
Return Value:
None
Page 84
Example:
 Set a variable 1234 to our target position of 2.3456
SetVar(1234, 2.3456)
 Now move X to our target position
Code  G0 X #1234
See also:
GetVar()
SingleVerify
Sub SingleVerify(Axis As Integer)
This function performs a position verify on a single axis by homing that axis, and, once
homed, zeroing the work offset, then returning to the initial offset. This is commonly
used at the beginning of a program to ensure the fixture offset is set properly, or after a
crash to restore the correct work offset.
Arguments:
Axis in an Integer value that specifies the first axis to verify. 0=X, 1=Y, 2=Z,
3=A, etc.
Return Value:
None
Example:
Xaxis = 0
Yaxis = 1
Zaxis = 2
 Verify Z axis work offset is properly set
SingleVerify(Zaxis)
See also:
SingleVerifyReport(), VerifyAxis(), RefCombination()
SingleVerifyReport
Function SingleVerifyReport(Axis As Integer)
This function performs a position verify on a single axis by homing that axis, and, once
homed, zeroing the work offset, then returning to the initial offset. When complete, a
message is displayed showing how far each axis was offset from its correct home
position. This function is identical to the SingleVerify function except for this message
Page 85
display. This is commonly used at the beginning of a program to ensure the fixture offset
is set properly, or after a crash to restore the correct work offset.
Arguments:
Axis in an Integer value that specifies the first axis to verify. 0=X, 1=Y, 2=Z,
3=A, etc.
Return Value:
None
Example:
Xaxis = 0
Yaxis = 1
Zaxis = 2
 Verify Z axis work offset is properly set, and
report error, if any
SingleVerifyReport(Zaxis)
See also:
SingleVerifyReport(), VerifyAxis(), RefCombination()
Sleep
Sub Sleep(Time As Integer)
This function causes the CB program to pause for the specified period of time, in mSec.
During this time, other processes can have access to the CPU. A Sleep() call should
always be inserted in any loop which might remain active for any period of time, for
example the While loop used to wait for a move command to complete.
Arguments:
Time, an Integer value expressing the sleep time in milliseconds.
Return Value:
None
Example:
 Move to zero position
Code  G0 X0.000 Y0.000
 Wait for move to complete
While IsMoving()
 Let other processes have CPU while we wait
Sleep 100
Wend
See also:
Page 86
Speak
Sub Speak(TextToSpeak As String)
This function uses speech synthesis to  speak the String argument. Note that your PC
must have a working audio system, and speech must first be enabled by checking the
 Allow Speech checkbox in Config->GeneralConfig->GeneralConfiguration.
Arguments:
TextToSpeak is a String to be spoken
Return Value:
None
Example:
 Tell the user to load the next work piece
Speak( Please load next work piece. Hit CycleStart
When Ready )
Code  M00
See also:
StartPeriodicScript
Function StartPeriodicScript(ByVal ScriptQFN as String, ByVal UpdatePeriod as
Double) as Integer
This function causes Mach to start a script that will be invoked with the specified
periodicity.
Arguments:
ScriptQFN: the string of the Qualified File Name (QFN) for the script to be run.
The qualified path name is relative to the Mach install directory. The QFN does
not include the script extension. Mach will look first for ScriptQFN.mcc and if
not found, then ScriptQFN.m1s.
If the QFN is the name of a script already started by a previous call to
StartPeriodicScript(), an error condition is returned. Mach does not support
multiple periodic instances of a single script.
UpdatePeriod: The length of the time period between runs of the script.
The time units are seconds. The minimum value is 5ms, any value less than 5ms
will be ignored and the minimum value of 5ms will be used for the UpdatePeriod.
Page 87
It is recommended that periodic scripts be run with the longest UpdatePeriod
appropriate for the script s task. This will help minimize the load on the machine
from multiple periodic scripts.
Return Value:
0 = requested function was performed successfully (script is now running).
Error Return Values:
Example:
 Initialize a script that runs the way oiler every 30
minutes
If StartPeriodicScript( OilerScript , 30*60*1000) then
Msgbox  Oiler periodic script is running
Else
Msgbox  Oiler script was not started
End If
See also:
IsPeriodicScriptRunning, StopPeriodicScript
First Mach3 version with API:
This API was first implemented in Mach3 version 3.43.06.
It was defined as a Boolean function with
Return Value:
True = requested function was performed successfully (script is now
running).
False = error, requested function was not successful (script is not running).
This API was revised in Mach3 version 3.43.19 to be an Integer function.
StartTHC
Sub StartTHC()
This function turns on torch height control. It is functionally identical to THCOn().
Arguments:
None
Return Value:
Page 88
None
Example:
StartTHC() Turn on torch height control
&  Do some cutting here
EndTHC()  Turn off torch height control
See also:
THCOn(), THCOff(), EndTHC(), ZeroTHC(), ResetTHC()
StopPeriodicScript
Function StopPeriodicScript(ByVal ScriptQFN as String) as Integer
This function is used to stop a previously started periodic script.
A periodic script only stops at the end of one of the script s UpdatePeriod time quanta (as
set by StartPeriodicScript) cycles. For example if a script is running with a 5 minute
UpdatePeriod, and the stop request is issued 2 minutes into the cycle, the script will not [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • dona35.pev.pl