3. Accessing Data for Electric Power, Temperature, and Processor UtilizationExpress5800/R120f-2E, T120f Maintenance Guide 217Chapter 3 AppendixIf outparams.Completioncode = 0 ThenIf outparams.ResponseData(6) = 1 Then ' Full Sensor Recordcall GetSensorType(Reserve_LS, Reserve_MS, Record_LS, Record_MS, sensorType)If sensorType = 1 Then ' TemperatureWScript.Echo "==========================================="call GetIDString(Reserve_LS, Reserve_MS, Record_LS, Record_MS)WScript.Echo " Sensor Type = Temperature"sensorNum = outparams.ResponseData(10)call GetSensor(Reserve_LS, Reserve_MS, Record_LS, Record_MS,sensorNum)End IfEnd IfRecord_LS = outparams.ResponseData(1)Record_MS = outparams.ResponseData(2)If Record_LS = &hff And Record_MS = &hff Thenexit ForEnd IfEnd IfNextSub GetSensorType(rv_ls, rv_ms, rc_ls, rc_ms, sensorType)Dim outtmpoinparams.networkfunction = &haoinparams.lun = 0oinparams.responderaddress = &h20oinparams.command = &h23oinparams.requestdata = array(rv_ls, rv_ms, rc_ls, rc_ms, 12, 2)oinparams.requestdatasize = 6set outtmp = oipmi.execmethod_("requestresponse",oinparams)sensorType = outtmp.ResponseData(3)End SubSub GetSensor(rv_ls, rv_ms, rc_ls, rc_ms, sensorNum)Dim outtmp, units1, units2, sensortypeoinparams.networkfunction = &haoinparams.lun = 0oinparams.responderaddress = &h20oinparams.command = &h23oinparams.requestdata = array(rv_ls, rv_ms, rc_ls, rc_ms, 20, 14)oinparams.requestdatasize = 6set 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" _& hex(outtmp.ResponseData(4))End Select' (Get Sendor Reading)Dim sensorData, rawData, currentValueoinparams.networkfunction = &h4oinparams.lun = 0oinparams.responderaddress = &h20oinparams.command = &h2doinparams.requestdata = array(sensorNum)oinparams.requestdatasize = 1set sensorData = oipmi.execmethod_("requestresponse",oinparams)If sensorData.Completioncode <> 0 Then'WScript.Echo " Sensor Not Available"exit SubEnd IfrawData = sensorData.ResponseData(1)If units1 and &h40 ThenIf rawData And &h80 ThenrawData = rawData Xor &hffEnd IfElseif units1 and &h80 Thencall get2complement(rawData, rawData, 8)End IfIf (sensorData.ResponseData(2) And &h80) = 0 Or _(sensorData.ResponseData(2) And &h40) = 0 Or _(sensorData.ResponseData(2) And &h20) ThenWScript.Echo " Event Status: Unavailable"Else'WScript.Echo " Event Status: ok"Dim M,B,k1,k2Dim retM = (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 & " " & units2End IfEnd Sub