
Option Speed 9
 Loop4
Stop

' Ensure debug window closed or without watch lines

' LOAD PROGRAM TIME = 156 mS

' If calling functions without  then all times are the same

' The test sections 2 and 3 are at the end of the file

' ----------------------------------------------
'  TEST SECTION  - LOOP 1
' ----------------------------------------------
'  AUTOMATION
'   VERSION     MICROSECS
' ----------------------------------------------
'   7.4.18      80 ... 85
' ----------------------------------------------
v1 = 0
v2 = 0

Label Loop1
	v2 = v2 + 1
	If v2 > 1000
		v2 = 0
		Print Format((ElapsedTime - v1) * 1000, "0.0") + " uS"
		v1 = ElapsedTime
	EndIf
Goto Loop1


' ----------------------------------------------
'  TEST SECTION  - LOOP 2
' ----------------------------------------------
'  AUTOMATION
'   VERSION     MICROSECS
' ----------------------------------------------
'   7.4.18      140 ... 142
' ----------------------------------------------
v1 = 0
v2 = 0

Label Loop2
	FunctionL2
	If v2 > 1000
		v2 = 0
		Print Format((ElapsedTime - v1) * 1000, "0.0") + " uS"
		v1 = ElapsedTime
	EndIf
Goto Loop2

Label FunctionL2
	v2 = v2 + 1
Return



' ----------------------------------------------
'  Addition of Labels and variables
' ----------------------------------------------
Variable Numeric Dummy1 = 1
Variable Numeric Dummy2 = 1
Variable Numeric Dummy3 = 1
Variable Numeric Dummy4 = 1
Variable Numeric Dummy5 = 1
Variable Numeric Dummy6 = 1
Variable Numeric Dummy7 = 1
Variable Numeric Dummy8 = 1
Variable Numeric Dummy9 = 1

Variable String Str1 = 1
Variable String Str2 = 1
Variable String Str3 = 1
Variable String Str4 = 1
Variable String Str5 = 1
Variable String Str6 = 1
Variable String Str7 = 1
Variable String Str8 = 1
Variable String Str9 = 1

Variable Numeric SlotCommands = 51
Label SendCommand
	Variable String SC1
	SlotText SlotCommands = SC1
	Wait SlotText(SlotCommands) = ""
Return

Label ExitFromEdit
	 SendCommand(ExitFromEdit)
Return

Label StartExecution
	 SendCommand(StartExecution)
Return
Label StopExecution
	 SendCommand(StopExecution)
Return
Label EnableRepeat
	 SendCommand(EnableRepeat)
Return
Label DisableRepeat
	 SendCommand(DisableRepeat)
Return
Label GotoHome
	 SendCommand(GotoHome)
Return
Label GotoCenter
	 SendCommand(GotoCenter)
Return
Label SelectLine3
	 SendCommand(SelectLine 3)
Return
Label SelectLine6
	 SendCommand(SelectLine 6)
Return
Label ExecuteSelectedLine
	 SendCommand(ExecuteSelectedLine)
Return

Label EnableCollaborative
	 SendCommand(EnableCollaborative)
Return
Label DisableCollaborative
	 SendCommand(DisableCollaborative)
Return
Label AddNewPosition
	 SendCommand(AddNewPosition)
Return
Label SetHomePosition
	 SendCommand(SetHomePosition)
Return
Label SetCenterPosition
	 SendCommand(SetCenterPosition)
Return

Label SetHoldingTorque9
	 SendCommand(SetHoldingTorque 9)
Return
Label SetSafeTorqueLimit9
	 SendCommand(SetSafeTorqueLimit 9)
Return
Label SetTorque9
	 SendCommand(SetTorque 9)
Return
Label SetAcceleration9
	 SendCommand(SetAcceleration 9)
Return
Label SetSpeed9
	 SendCommand(SetSpeed 9)
Return

Label SetAllparamsToMin
	 SendCommand(SetHoldingTorque 0)
	 SendCommand(SetSafeTorqueLimit 0)
	 SendCommand(SetTorque 0)
	 SendCommand(SetAcceleration 0)
	 SendCommand(SetSpeed 0)
Return
Label SetAllparamsToMax
	 SendCommand(SetHoldingTorque 999)
	 SendCommand(SetSafeTorqueLimit 999)
	 SendCommand(SetTorque 999)
	 SendCommand(SetAcceleration 999)
	 SendCommand(SetSpeed 99999)
Return


' ----------------------------------------------
'  TEST SECTION  - LOOP 3
' ----------------------------------------------
'  AUTOMATION
'   VERSION     MICROSECS
' ----------------------------------------------
'   7.4.18      100 ... 109
' ----------------------------------------------
v1 = 0
v2 = 0

Label Loop3
	v2 = v2 + 1
	If v2 > 1000
		v2 = 0
		Print Format((ElapsedTime - v1) * 1000, "0.0") + " uS"
		v1 = ElapsedTime
	EndIf
Goto Loop3


' ----------------------------------------------
'  TEST SECTION  - LOOP 4
' ----------------------------------------------
'  AUTOMATION
'   VERSION     MICROSECS
' ----------------------------------------------
'   7.4.18      140 ... 143
' ----------------------------------------------
v1 = 0
v2 = 0

Label Loop4
	FunctionL4
	If v2 > 1000
		v2 = 0
		Print Format((ElapsedTime - v1) * 1000, "0.0") + " uS"
		v1 = ElapsedTime
	EndIf
Goto Loop4

Label FunctionL4
	v2 = v2 + 1
Return


