
Documentation Number UD128A8D4602 Manual Chapter 5 45
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
Calculate Reading for display as mV or Volts
‘ \ Calculate VstepVar once when Vref is selected
VstepVar = 1.2208 ‘\ Voltage Step Variable
‘ \ Vvar becomes Voltage in mV
Vvar = Reading * VstepVal
Vvar = Int(Vvar + 0.5) ‘\ Round for 4 digits
‘ \ then display value of Vvar as mV
‘ \ or change mV to volts
Vvar = Vvar / 1000
‘ \ then display formatted value as volts
Calculate Reading for display as %full scale
Vvar = Reading / 4095
Vvar = Vvar * 1000
Vvar = Vvar + 0.5
Vvar = Int(Vvar)
Vvar = Vvar / 10
‘ \ then display value as %FS
Calculate Reading for display as mA
‘ \ using a 249 ohm 1% resistor
Vvar = Reading / 204 '\ counts per 1mA
‘ \ display Vvar as mA of current
Setting Analog I/O
An analog output channel is Read/Write. It is set using the Value property.
Device1.IoPoints(DA_0).Value = 0
‘ \ This sets the DA0 Output to 0 counts.
‘ \ Values from 0 to 1023 are valid. Values are 5V/1024 per step.
Dim Setting as Long
Setting = Device1.IoPoints(DA_0).Value
‘ \ This returns the current setting of DA0
‘ \ if want to output mV values from 0 to 5000 mV
DAVoltVar = 5000 ‘ \ or set another value
Commenti su questo manuale