你不是臺灣來的嗎?怎麼不在臺灣那邊發問?
你的CALL有問題,CALL回來的東西要放那裡?誰(程式)會知道?
當然就錯誤了。
一樣,直接給你現成的CODE,有問題再討論
VB語法不懂的,請自行找資料了解。
================================================
'讀取sv位置資料
Public Sub ReadSVData(iSVAxis As Integer)
Dim arrData As Variant
Dim iCnt As Integer
Select Case iSVAxis
Case 1:
arrData = Read32Bit("D1000", "D1002", "D1004", "D1006", "D1008", "D1010", "D1012")
For iCnt = LBound(arrData) To UBound(arrData)
lblAxis1Poistion(iCnt).Caption = arrData(iCnt)
Next iCnt
Case 2:
arrData = Read32Bit("D1018", "D1020", "D1024", "D1026", "D1028", "D1030", "D1032")
For iCnt = LBound(arrData) To UBound(arrData)
lblAxis2Poistion(iCnt).Caption = arrData(iCnt)
Next iCnt
Case 3:
arrData = Read32Bit("D1034", "D1036", "D1038", "D1040", "D1042", "D1044", "D1046", "D1048", "D1050")
For iCnt = LBound(arrData) To UBound(arrData)
lblAxis3Poistion(iCnt).Caption = arrData(iCnt)
Next iCnt
Case 4:
arrData = Read32Bit("D1054", "D1056", "D1058", "D1060", "D1062", "D1064", "D1066", "D1070", "D1072", "D1074", "D1076", "D1078", "D1080")
For iCnt = LBound(arrData) To UBound(arrData)
lblAxis4Poistion(iCnt).Caption = Format(arrData(iCnt) / 100, "##00.00")
Next iCnt
End Select
End Sub