Download WaveForms SDK User's Manual

Transcript
WaveForms SDK User’s Manual
10.7 Analog Discovery System Monitor
HDWF hdwf
STS sts
double deviceVoltage
double deviceCurrent
double deviceTemperature
// open automatically the first available device
FDwfDeviceOpen(-1, &hdwf)
For 1 to 60
// wait before the first reading after device open and between readings
// the update rate is approximately 1Hz
Wait(1)
// fetch analog IO status from device
FDwfAnalogIOStatus(hdwf)
// get system monitor readings
FDwfAnalogIOChannelNodeStatusInfo(hdwf, 2, 0, &deviceVoltage)
FDwfAnalogIOChannelNodeStatusInfo(hdwf, 2, 1, &deviceCurrent)
FDwfAnalogIOChannelNodeStatusInfo(hdwf, 2, 2, &deviceTemperature)
Print(“Device USB supply voltage: ”+deviceVoltage+”V”)
Print(“Device USB supply current: ”+deviceVoltage+”A”)
Print(“Device temperature: ”+deviceVoltage+”C”)
End for
// close the device
FDwfDeviceClose(hdwf)
www.digilentinc.com
page 62 of 63
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.