Sub readFromPLC_DB3()
Cells(1, 2) = "Test de lecture"
Dim ph As Long, di As Long, dc As Long, x As Integer, NbBytes As Integer
res = initialize(ph, di, dc)
NbBytes = 2
If res = 0 Then
'res2 = daveReadBytes(dc, daveFlags, 0, 0, 16, 0)
res2 = daveReadBytes(dc, daveDB, 3, 20, NbBytes, 0)
If res2 = 0 Then
For x = 0 To NbBytes - 2
Cells(32, 3) = daveGetS16(dc)
Next
End If
.
.
.
.
.
res2 = daveReadBytes(dc, daveDB, 3, 158, NbBytes, 0)
If res2 = 0 Then
For x = 0 To NbBytes - 2
Cells(50, 3) = daveGetS16(dc)
Next
End If
'***********************
End If
Call cleanUp(ph, di, dc)
End Sub