Does anyone know how to log data from Denso controller?
I have a variable that calculates the execution time of a cycle.
I need to log it to file and then plot it.
I currently use PrintDbg to at least display it, but still don't know how to log custom variable.
Please help with this....
Below is the program that I use
'!TITLE "Cycle time"
Sub Main
PrintMsg "MSG"
TakeArm Keep = 0
'Variables declaration---------------------------
Dim homePosition As Position
Dim startPosition As Position
Dim endPosition As Position
Dim option As Integer '1 - option 1 / 2 - option 2 / 3 - option 3 ***not used yet
Dim straightMove As Integer
Dim verticalTravel As Integer
Dim horisontalTravel As Integer
Dim slowSpeed As Integer 'Default: 20
Dim highSpeed As Integer 'Default: 100
Dim vertSpeed As Integer 'Default: 50
Dim vertAccel As Integer 'Default: 100
Dim vertDecel As Integer 'Default: 100
Dim horizSpeed As Integer 'Default: 100
Dim horizAccel As Integer 'Default: 100
Dim horizDecel As Integer 'Default: 100
Dim archStart As Integer 'Default: 15
Dim archEnd As Integer 'Default: 15
Dim passMotion As Integer 'Default: 0
Dim highAccuracy As Integer 'Default 1
Dim elapsedTime As Integer 'Holder for the timers
Dim tempTime As Integer 'Holder for the temp timers
'Variable initialization-------------------------
'enable/disable variables
straightMove = 2 '0 - use to set streight motions (MoveS) / 1 - use set of curved motions (Move) / 2 - use arch move / Default:0
highAccuracy = 1 '0 - HighPathAccuracy = False / 1 - HighPathAccuracy = True
'numeric settings
verticalTravel = 25
horisontalTravel = 300
slowSpeed = 20
highSpeed = 100
vertSpeed = 50
vertAccel = 100
vertDecel = 100
horizSpeed = 100
horizAccel = 100
horizDecel = 100
archStart = 0
archEnd = 0
passMotion = -1 'same as @P
homePosition = P( 300, 0 , 300, 180, 0, 180, -1)
startPosition = P( 300,150, 300, -180, 0, 180, -1)
endPosition = P( 300,-150, 300, -180, 0, 180, 5)
'Move to home positoin----------------
PrintDbg "Robot Will Move To Home Position"
Speed slowSpeed
Move P, homePosition
Delay 2000
PrintDbg "Robot Will Move To Cycle Start Position"
Move P, startPosition
PrintDbg "Test Parameters: ", " Moves (0-MoveS / 1-Move / 2-arch)", straightMove, " Speed: ", highSpeed, " Horizontal Travel: ", horisontalTravel, " Vertical Travel: ", verticalTravel
PrintMsg "Test"
If highAccuracy == 0 Then
HighPathAccuracy False
Else
HighPathAccuracy True
End If
'Test cycle
Do
Select Case straightMove
Case 0 '--------------------------------------option 0 is streight move (default)
'If highAccuracy == 0 Then
'HighPathAccuracy False
'Else
'HighPathAccuracy True
'End If
Speed highSpeed
tempTime = 0
elapsedTime = 0
tempTime = Timer
Depart L, @[passMotion] verticalTravel, Speed = (vertSpeed, vertAccel, vertDecel)
Approach L, endPosition, verticalTravel, Speed = (horizSpeed, horizAccel, horizDecel)
Move L, @[passMotion] endPosition, Speed = (vertSpeed, vertAccel, vertDecel)
Depart L, @[passMotion] verticalTravel, Speed = (vertSpeed, vertAccel, vertDecel)
Approach L, startPosition, verticalTravel, Speed = (horizSpeed, horizAccel, horizDecel)
Move L, @[passMotion] startPosition, Speed = (vertSpeed, vertAccel, vertDecel)
elapsedTime = Timer - tempTime
PrintDbg elapsedTime
Case 1 '--------------------------------------option 1 is curved moves
'If highAccuracy == 0 Then
'HighPathAccuracy False
'Else
'HighPathAccuracy True
'End If
Speed highSpeed
tempTime = 0
elapsedTime = 0
tempTime = Timer
Depart P, @[passMotion] verticalTravel
Approach P, endPosition, verticalTravel
Move P, @[passMotion] endPosition
Depart P, @[passMotion] verticalTravel
Approach P, startPosition, verticalTravel
Move P, @[passMotion] startPosition
elapsedTime = Timer - tempTime
PrintDbg elapsedTime
Case 2 '--------------------------------------option 1 is arch move
'If highAccuracy == 0 Then
'HighPathAccuracy False
'Else
'HighPathAccuracy True
'End If
Speed highSpeed
tempTime = 0
elapsedTime = 0
tempTime = Timer
ArchMove endPosition, 25, archStart, archEnd
ArchMove startPosition, 25, archStart, archEnd
elapsedTime = Timer - tempTime
PrintDbg elapsedTime
Case Else
'implement error handling routine
End Select
Loop While True
End Sub