NEC Express5800 Maintenance Manual page 125

Hide thumbs Also See for Express5800:
Table of Contents

Advertisement

Chapter 3 Appendix
End If
Record_LS = outparams.ResponseData(1)
Record_MS = outparams.ResponseData(2)
If Record_LS = &hff And Record_MS = &hff Then
exit For
End If
End If
Next
Sub GetSensorType(rv_ls, rv_ms, rc_ls, rc_ms, sensorType)
Dim outtmp
oinparams.networkfunction = &ha
oinparams.lun = 0
oinparams.responderaddress = &h20
oinparams.command = &h23
oinparams.requestdata = array(rv_ls, rv_ms, rc_ls, rc_ms, 12, 2)
oinparams.requestdatasize = 6
set outtmp = oipmi.execmethod_("requestresponse",oinparams)
sensorType = outtmp.ResponseData(3)
End Sub
Sub GetSensor(rv_ls, rv_ms, rc_ls, rc_ms, sensorNum)
Dim outtmp, units1, units2, sensortype
oinparams.networkfunction = &ha
oinparams.lun = 0
oinparams.responderaddress = &h20
oinparams.command = &h23
oinparams.requestdata = array(rv_ls, rv_ms, rc_ls, rc_ms, 20, 14)
oinparams.requestdatasize = 6
set outtmp = oipmi.execmethod_("requestresponse",oinparams)
units1 = outtmp.ResponseData(3)
Select Case outtmp.ResponseData(4)
case 0: units2 = "unspecified"
case 1: units2 = "degrees C"
case 6: units2 = "Watts"
case else: units2 = "Refer to IPMI Specification: Type=0x" _
End Select
' (Get Sendor Reading)
Dim sensorData, rawData, currentValue
oinparams.networkfunction = &h4
oinparams.lun = 0
oinparams.responderaddress = &h20
oinparams.command = &h2d
oinparams.requestdata = array(sensorNum)
oinparams.requestdatasize = 1
set sensorData = oipmi.execmethod_("requestresponse",oinparams)
If sensorData.Completioncode <> 0 Then
'WScript.Echo " Sensor Not Available"
exit Sub
End If
rawData = sensorData.ResponseData(1)
If units1 and &h40 Then
If rawData And &h80 Then
rawData = rawData Xor &hff
End If
Elseif units1 and &h80 Then
call get2complement(rawData, rawData, 8)
End If
If (sensorData.ResponseData(2) And &h80) = 0 Or _
(sensorData.ResponseData(2) And &h40) = 0 Or _
(sensorData.ResponseData(2) And &h20) Then
WScript.Echo " Event Status: Unavailable"
Else
'WScript.Echo " Event Status: ok"
Dim M,B,k1,k2
Dim ret
M = (outtmp.ResponseData(8) And &hc0) * 4 + outtmp.ResponseData(7)
B = (outtmp.ResponseData(10) And &hc0) * 4 + outtmp.ResponseData(9)
call get2complement(M, M, 10)
call get2complement(B, B, 10)
call get2complement(outtmp.ResponseData(12) And &h0f, k1, 4)
call get2complement((outtmp.ResponseData(12) And &hf0)/16, k2, 4)
currentValue = CDbl (((M * rawData) + (B * (10 ^ k1))) * (10 ^ k2))
WScript.Echo " Current Value = " & currentValue & " " & units2
End If
End Sub
Sub get2complement(raw, rv, bit)
Select Case bit
case 4:
If raw And &h8 Then
rv = 0 - ((&h10 - raw) and &h0f)
Else
rv = raw
End If
case 8:
Express5800/A1040b, A2040b, A2020b, A2010b Maintenance Guide
3. Accessing Data for Electric Power, Temperature, and Processor Utilization
& hex(outtmp.ResponseData(4))
125

Advertisement

Table of Contents
loading

Table of Contents