Solar Guppy Discussion Forum http://solar-guppy.com/forum/ |
|
Xantrex: Interpreting Data http://solar-guppy.com/forum/viewtopic.php?f=19&t=655 |
Page 1 of 1 |
Author: | AlanStewart [ Mon Jul 14, 2008 4:39 pm GMT EthGMT ] |
Post subject: | Xantrex: Interpreting Data |
Hello. I'm a programmer at the British Columbia Institute of Technology in Canada. We've got a PV tower with 4 faces (North, East, West, South). This thing was set up a long time ago with Xantrex Suntie XR inverters. All the serial connections are hooked up and I can (mostly) get data from them. I am getting the expected 34-byte bursts every second. I am extremely grateful for the breakdown of the bytes given in these links: http://www.solar-guppy.com/forum/viewto ... t=mppthigh http://www.xantrex.com/forum/forum_post ... 39&KW=STXR However, I'm a little unsure of the units being used and any conversions required. Are the "Message intpretation constants" given in the first link accurate? Mostly I'm unsure about the negative temperature slopes. I'm assuming that all other values in Fishbowl are calculated from the known quantities. And I understand that what I'm basically asking for is knowledge of the inner workings of Fishbowl and that perhaps that information shouldn't be publicly disclosed. Thank you, Alan Stewart Research Assistant Group for Advanced Information Technology (GAIT) Laboratory British Columbia Institute of Technology tel: 604-432-8281 web: bcit.ca/appliedresearch/gait |
Author: | AlanStewart [ Tue Jul 15, 2008 5:18 pm GMT EthGMT ] |
Post subject: | Faults and Modes |
Further to my previous query, I'd also like to know what the possible Fault and Modes settings are. I've seen values of 0x20 and 0x32 (as opposed to the "normal" 0x00 values) so I know they've got to mean something. I'm surprized there aren't data sheet with all this info on them. Alan Stewart, GAIT, BCIT |
Author: | Solar Guppy [ Tue Jul 15, 2008 7:39 pm GMT EthGMT ] |
Post subject: | |
Its been awhile since I looked at this stuff, below is a cut&paste from the FishBowl source that should answer your questions, your on your own, but should help your efforts: On the byte decoding, Sync mode means its a UPG , meaning the comm stream is scanned and when "XR\UPG" is found that the beginning of the data if its an older XR, then the timeout methode is needed if (SyncMode == true) { MsgBuff[BuffPtr] = TMainForm::COMM->ReadByte(); check[0] = check[1]; check[1] = check[2]; check[2] = check[3]; check[3] = check[4]; check[4] = check[5]; check[5] = MsgBuff[BuffPtr]; if ((check[0] == 'X') && (check[1] == 'R') && (check[2] == '\\') && (check[3] == 'G') && (check[4] == 'P')) { if (BuffPtr == 33) found_sync = true; BuffPtr = 0; } else BuffPtr++; } else { MsgBuff[BuffPtr] = TMainForm::COMM->ReadByte(); BuffPtr++; } if (((BuffPtr == 32) && (SyncMode == false)) || ((SyncMode == true) && (found_sync == true))) // received complete message DECODING OF THE COMM STREAM: if (fault0 == 0) fault0 = MsgBuff[0]; newmodes = MsgBuff[1]; Version = MsgBuff[2]; VAChigh = MsgBuff[4]; VAClow = MsgBuff[5]; FREQhigh = MsgBuff[6]; FREQlow = MsgBuff[7]; AC_WATTShigh = MsgBuff[8]; AC_WATTSlow = MsgBuff[9]; FAULTTIMER = MsgBuff[10]; DC_VOLTS = MsgBuff[11]; if (SyncMode) { DC_AMPS = MsgBuff[12]; DC_AMPS_LO = MsgBuff[15]; mppthi = MsgBuff[3]; mpptlo = MsgBuff[13]; } else { DC_AMPS = 0; mppthi = 0; mpptlo = 0; DC_AMPS_LO = 0; } DC_VOLTS_LO = MsgBuff[14]; Power_Limit_Hi = MsgBuff[16]; Power_Limit_Lo = MsgBuff[17]; dp_volts_hi = MsgBuff[19]; dp_volts_lo = MsgBuff[20]; dp_amps_hi = MsgBuff[21]; dp_amps_lo = MsgBuff[22]; dp_peak_hi = MsgBuff[23]; dp_peak_lo = MsgBuff[24]; AmbientTemp = MsgBuff[25]; HeatSinkTemp = MsgBuff[26]; dp_volts_hi_p1 = MsgBuff[27]; dp_volts_lo_p1 = MsgBuff[28]; dp_amps_hi_p1 = MsgBuff[29]; dp_amps_lo_p1 = MsgBuff[30]; // Mains AC Voltage ac_volts = (VAChigh * 256 ) + VAClow; // Mains Freq ffreq = (float)((FREQhigh * 256 ) + FREQlow ) / 10; //DC Volts dc_volts = (((DC_VOLTS << 8 ) + DC_VOLTS_LO ) >> 5) * .125; // Instant power ac_watts = (AC_WATTShigh * 256 ) + AC_WATTSlow ; // Dc Amps dc_amps = (DC_AMPS + ((DC_AMPS_LO >> 4 ) * .0625)); // Dc Watts if (SyncMode) dc_power = dc_amps * dc_volts; else dc_power = 0; // dp stuff is the peak delta power reading , cleared every 24 less power cycles // volts and amps are the values for the dp_peak reading stored //dp volts dp_volts = ((dp_volts_hi << 8 ) + dp_volts_lo) * .0625; dp_volts_p1 = ((dp_volts_hi_p1 << 8 ) + dp_volts_lo_p1) * .0625; // dp Amps dp_amps = ((dp_amps_hi << 8 ) + dp_amps_lo) * .0625; dp_amps_p1 = ((dp_amps_hi_p1 << 8 ) + dp_amps_lo_p1) * .0625; // dp peak power dp_peak = (dp_peak_hi * 256) + dp_peak_lo; // Mppt mppt_volts = (((mppthi << 8 ) + mpptlo) >> 5) * .125 ; // Ambient Temp AmbientTemp = ((((255 - AmbientTemp) * .01953) / .032) + 10); AmbientTempF = (AmbientTemp * 1.8 ) + 32; // Heat Sink HeatSinkTemp = ((((255 - HeatSinkTemp) * .01953) / .032) + 10); HeatSinkTempF = (HeatSinkTemp * 1.8 ) + 32; // do math for efficiency stuff acp = ac_watts; dcp = dc_power; if (dcp > 0 ) eff = acp/dcp * 100; else eff = 0 ; if (eff > 99.9 )eff = 99.9; // peak ac watts if((ac_watts > ac_watts_peak) && (ac_watts < 2800 )) ac_watts_peak = ac_watts; // running total math ac_power_total = ac_power_total + ((AC_WATTShigh << 8 ) + AC_WATTSlow); ac_kwh = ac_power_total / 3600; if (FAULTTIMER == 0 ) { online_seconds++; } if (online_seconds == 60 ) { online_seconds = 0; online_minutes++; } if (online_minutes == 60) { online_minutes = 0; online_hours++; } } FAULT DECODING if (fault0 == 255) strcpy(fault_text,"AC over 264 vac"); else if(fault0 == 253) strcpy(fault_text,"AC under 211 vac"); else if(fault0 == 251) strcpy(fault_text,"Line freq over 60.5"); else if(fault0 == 249) strcpy(fault_text,"Line freq under 59.3"); else if(fault0 == 247) strcpy(fault_text,"DC input volts over 125 VDC"); else if(fault0 == 245) strcpy(fault_text,"DC input volts under 40VDC"); else if (newmodes & 0x01) { strcpy(tempstr,""); maxpower = (Power_Limit_Hi * 256) + Power_Limit_Lo; strcpy(fault_text,"Tempature derating enabled , maximum allowed power = "); itoa(maxpower, tempstr, 10); strcat(fault_text,tempstr); strcat(fault_text," Watts"); } else if(fault0 != 0) { strcpy(tempstr,""); itoa(fault0, tempstr, 10); strcpy(fault_text,"Fault detected , code = "); strcat(fault_text,tempstr); } else if((fault0 == 0) & (FAULTTIMER != 0 ) ) { strcpy(tempstr,""); strcpy(fault_text,"Offline, connect in "); itoa(FAULTTIMER*2, tempstr, 10); strcat(fault_text,tempstr); strcat(fault_text," seconds"); } else strcpy(fault_text,"Normal operation"); |
Author: | AlanStewart [ Tue Jul 15, 2008 7:50 pm GMT EthGMT ] |
Post subject: | Thanks! |
This is excellent. I'm sure I'll be able to figure out what I need from your code. Well, once I do a quick search'n'replace and change all the "Cool" guy with shades into the proper "8 )", that is. Thank you! Alan STewart, GAIT, BCIT |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |