Peripheral Devices
9836 3521 01
595
Reading an Integer PLC value from the target system
This example assumes that there are textboxes for address and value.
Private Sub cmdSetBool_Click()
'
' Abstract: Get PLC Integer from API-server and display it
'
On Error GoTo ErrorHandler
Dim Ret As RetCodeEnum
Dim Address As Integer
Dim Value As Boolean
If Val(txtAddress) < 1 Or Val(txtAddress) > 999 Then
MsgBox "Address must be between 1 and 999"
txtAddress.SetFocus
Exit Sub
End If
Address = CInt(txtAddress)
Ret = mPowApi.GetPLCInt(Address, Value)
if Ret <> eRetOk Then
msgBox "GetPLCInt returned: " & Ret
else
txtValue = CStr(Value)
end if
Exit Sub
ErrorHandler:
MsgBox err.description
exit sub
End Sub
Summary of Contents for PowerMACS 4000
Page 2: ......
Page 46: ...System Architecture 46 9836 3521 01...
Page 267: ...Tightening 9836 3521 01 267...
Page 400: ...Tightening 400 9836 3521 01...
Page 486: ...Peripheral Devices 486 9836 3521 01...
Page 622: ...Peripheral Devices 622 9836 3521 01...
Page 664: ...References 664 9836 3521 01...
Page 668: ...9836 3521 01 2010 11 Edition 10 3 0 www atlascopco com...