Peripheral Devices
594
9836 3521 01
Setting a Boolean value in the target system
This example assumes that there are textboxes for address and value, and a dropdown list for the bit
value.
Private Sub cmdSetBool_Click()
'
' Abstract: Set PLC Bool 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)
Value = CBool(txtValue)
Ret = mPowApi.SetPLCBool(Address, Val(cboBit), Value)
if Ret <> eRetOk then msgBox "SetPLCBool returned: " & Ret
Exit Sub
ErrorHandler:
If Err.Number = 13 Then
MsgBox "Value must be a valid boolean"
txtAddress.SetFocus
Exit Sub
End If
MsgBox err.description
exit sub
End Sub
Содержание PowerMACS 4000
Страница 1: ...User guide PowerMACS 4000 Atlas Copco Tools and Assembly Systems 9836 3521 01 2010 11 Edition 10 3 0...
Страница 2: ......
Страница 46: ...System Architecture 46 9836 3521 01...
Страница 127: ...Set Up and Maintenance 9836 3521 01 127 See chapter Station Set Up for a description of the parameters...
Страница 267: ...Tightening 9836 3521 01 267...
Страница 400: ...Tightening 400 9836 3521 01...
Страница 422: ...Peripheral Devices 422 9836 3521 01 When connected to a system the form will show show the signal values in realtime...
Страница 486: ...Peripheral Devices 486 9836 3521 01...
Страница 622: ...Peripheral Devices 622 9836 3521 01...
Страница 664: ...References 664 9836 3521 01...
Страница 668: ...9836 3521 01 2010 11 Edition 10 3 0 www atlascopco com...