
Documentation Number UD128A8D4602 Manual Chapter 5 43
B&B Electronics Mfg Co – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Comm. Pk. – Oranmore, Galway, Ireland – Ph 353-91-792444 – Fax 353-91-792445
10. Before Running, make an a Exit Routine to cleanup & End
Public Sub CleanExit()
‘ \ VB’s End does not close or clean up – you must!
Clean-up – Closing - Exit
‘ \ Cleanup before End
On Error Resume Next
Device1.Close
' \ To remove the variable holding a device,
‘ \ Set it to Nothing.
Set Device1 = Nothing
' \ To remove the list of connected devices,
‘ \ set it to Nothing.
Set Connected = Nothing
' \ Any alias I/O point variables created should
‘ \ also be set to Nothing
' \ Set ad0 = Nothing
End
End Sub
11. Next Set the Configurations for Inputs and Outputs
Digital I/O Configuration
Device1.IoPointGroups(DIG_GROUP_1).Configuration _
= DIGITAL_INPUT
‘ \ Sets Digital I/O 0-3 to Inputs
‘ \ The space underscore ( _) is the VB line continuation char
Device1.IoPointGroups(DIG_GROUP_2).Configuration _
= DIGITAL_OUTPUT
‘ \ sets Digital I/O 4-7 to Outputs
Note: The UD128A8D has only 1 type of digital I/O (No latches or
counters), so no other configurations are necessary. Future units
may require that each I/O Point be configured.
Commenti su questo manuale