Skip to content

Commit

Permalink
Issue #6 Bux Fix 4
Browse files Browse the repository at this point in the history
- Change Var Type Int to String for stepID
  • Loading branch information
clope031 committed May 8, 2018
1 parent 9b3482b commit 25b1013
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
'API Data
'========================================================================================

#Define CGNX_API_VER "1.6.29"
#Define CGNX_API_VER "1.6.30"
#Define SUCCEEDED 1
#Define FAILED 0
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ Function CGNX_TVGR(ByVal recvCmd As Variant) As String
Case 1 ' Target on Gripper
Call Move2Point(P[_TRAIN_POS_2_])

If CGNX_TrainVGRMotion(_VIS_DEV_COM_,1) =_
If CGNX_TrainVGRMotion(_VIS_DEV_COM_,"1") =_
FAILED Then Exit Function
Call ReleasePart
Call Move2Point(P[_TRAIN_POS_0_])
If CGNX_TrainVGRTarget(_VIS_DEV_COM_,1) =_
If CGNX_TrainVGRTarget(_VIS_DEV_COM_,"1") =_
FAILED Then Exit Function

Case 2 ' Target on Gripper (No Release)
Call Move2Point(P[_TRAIN_POS_3_])

If CGNX_TrainVGRTarget(_VIS_DEV_COM_,2) =_
If CGNX_TrainVGRTarget(_VIS_DEV_COM_,"2") =_
FAILED Then Exit Function
If CGNX_TrainVGRMotion(_VIS_DEV_COM_,2) =_
If CGNX_TrainVGRMotion(_VIS_DEV_COM_,"2") =_
FAILED Then Exit Function

Case 3 ' Target in Golden Place Position
Call Move2Point(P[_TRAIN_POS_0_])

If CGNX_TrainVGRTarget(_VIS_DEV_COM_, 3) =_
If CGNX_TrainVGRTarget(_VIS_DEV_COM_,"3") =_
FAILED Then Exit Function
Call Move2Point(P[_TRAIN_POS_4_])
If CGNX_TrainVGRMotion(_VIS_DEV_COM_, 3) =_
If CGNX_TrainVGRMotion(_VIS_DEV_COM_,"3") =_
FAILED Then Exit Function

Case Else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Function CGNX_XVGR(ByVal recvCmd As Variant) As String
TakeArm Keep = 1
Tool 1, ToolPos(0) 'Initialize Tool 1

fResult = CGNX_RunVGR(_VIS_DEV_COM_,1,"0")
fResult = CGNX_RunVGR(_VIS_DEV_COM_,"1","0")
If fResult(0) = FAILED Then Exit Function

tempPos = fResult(1)
Expand All @@ -34,11 +34,11 @@ Function CGNX_XVGR(ByVal recvCmd As Variant) As String
Case 2 'Target On Gripper
Call Move2Point(P[_TRAIN_POS_3_])

If CGNX_RunVGRPicked(_VIS_DEV_COM_,2,"1") =_
If CGNX_RunVGRPicked(_VIS_DEV_COM_,"2","1") =_
FAILED Then Exit Function

Case 3 'Target on gripper, rogot at position P3
fResult = CGNX_RunVGR(_VIS_DEV_COM_,3,"1")
fResult = CGNX_RunVGR(_VIS_DEV_COM_,"3","1")
If fResult(0) = FAILED Then Exit Function

tempPos = fResult(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'Runs selected VGR step + Align provide robot tool
'
Function CGNX_RunVGRPicked(ByVal srvID As Integer,_
ByVal stepID As Integer,_
ByVal stepID As String,_
ByVal setTool As Integer) As Integer

Dim resultMode As String = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'Run selected VGR Step
'
Function CGNX_RunVGR(ByVal srvID As Integer,_
ByVal stepID As Integer,_
ByVal stepID As String,_
ByVal resultMode As String) As Variant

Dim recvMsg As Variant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
'Register Golden Robot Pose (For Target)
'
Function CGNX_TTR(ByVal srvID As Integer,_
ByVal stepID As Integer) As Variant
ByVal stepID As String) As Variant

Dim sendMsg As String
Dim recvMsg As String

sendMsg = Sprintf("TTR,%d,%s", stepID, CurPos2Str())
sendMsg = Sprintf("TTR,%s,%s", stepID, CurPos2Str())
recvMsg = CGNX_ExecuteCmd(srvID, sendMsg)
CGNX_TTR = Split(recvMsg, ",")
End Function
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
'Registers Target Feature (Golden Pose Training)
'
Function CGNX_TT(ByVal srvID As Integer,_
ByVal stepID As Integer) As Variant
ByVal stepID As String) As Variant

Dim sendMsg As String
Dim recvMsg As String

sendMsg = Sprintf("TT,%d,%s", stepID, CurPos2Str())
sendMsg = Sprintf("TT,%s,%s", stepID, CurPos2Str())
recvMsg = CGNX_ExecuteCmd(srvID, sendMsg)
CGNX_TT = Split(recvMsg, ",")
End Function
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'Register Golden Pose (Robot CurPos)
'
Function CGNX_TrainVGRMotion(ByVal srvID As Integer,_
ByVal stepID As Integer) As Integer
ByVal stepID As String) As Integer
Dim recvMsg As Variant
CGNX_TrainVGRMotion = FAILED
recvMsg = CGNX_TTR(srvID, stepID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'Register Golden Position (Target)
'
Function CGNX_TrainVGRTarget(ByVal srvID As Integer,_
ByVal stepID As Integer) As Integer
ByVal stepID As String) As Integer
Dim recvMsg As Variant
CGNX_TrainVGRTarget = FAILED
recvMsg = CGNX_TT(srvID, stepID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
'
'Locates a Target Feature
'
Function CGNX_XT(ByVal srvID As Integer, ByVal stepID As Integer,_
Function CGNX_XT(ByVal srvID As Integer, ByVal stepID As String,_
ByVal resultMode As String) As Variant

Dim sendMsg As String
Dim recvMsg As String

sendMsg = Sprintf("XT,%d,%s,%s", stepID,_
sendMsg = Sprintf("XT,%s,%s,%s", stepID,_
resultMode, CurPos2Str)
recvMsg = CGNX_ExecuteCmd(srvID, sendMsg)
CGNX_XT = Split(recvMsg, ",")
Expand Down

0 comments on commit 25b1013

Please sign in to comment.