time2 ReadTimeDateP_Short(void) { QueryOpenP(); if (ElsInput(1) != SER_GOODCHECK) return GetTime2Error(); DelayOff(); QueryModeP(); if (ElsInput(0) != SER_GOODCHECK) return GetTime2Error(); DelayOff(); QueryPasswordP(); if (ElsInput(2) != SER_GOODCHECK) return GetTime2Error(); DelayOff(); QueryTimeP(); if (ElsInput(0) != SER_GOODCHECK) return GetTime2Error(); QueryCloseP(); return GetTime2(ReadTimeP(), true); }
bool ReadTimeDateD_Short(void) { DelayOff(); QueryOpenD(); if (ExtInput() != SER_GOODCHECK) return(0); DelayOff(); QueryPasswordD(); if (ExtInput() != SER_GOODCHECK) return(0); if (InBuff(2) != 0) return(0); DelayOff(); QueryTimeD(); if (ExtInput() != SER_GOODCHECK) return(0); ReadTimeD(); QueryCloseD(0); return(1); }
// чтение вснй накопленной энергии для счётчиков ABB Альфа bool ReadAllEnergyD(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryEnergyD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(75); ibMinor = 0; ReadEnergyD(); while (ibMinor < GetEnergyBlocksD()) { for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryContinueD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(76 + ibMinor); ReadEnergyD(); } for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryStopD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(100); ReadQuadrantsD(); return(1); }
// чтение коэффициентов для счётчика Меркурий-230 bool ReadKoeffDeviceB_Special(void) { uchar i; if (QueryOpenB_Full(25) == 0) return(0); for (i=0; i<bMINORREPEATS; i++) { InitPush(0); PushChar(diCurr.bAddress); PushChar(8); PushChar(2); // чтение коэффициентов DelayOff(); QueryIO(1+4+2, 2+1+2); if (Input() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(50); // K трансформации dbKtrans = (InBuff(1)*0x100 + InBuff(2)) * (InBuff(3)*0x100 + InBuff(4)); // K преобразования dbKpulse = 2000; return(1); }
bool AutomaticP(void) { Clear(); if (OpenDeviceP() == 0) return(0); uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryTransP(); if (ElsInput(0) == SER_GOODCHECK) break; } if (i == bMINORREPEATS) return(0); ShowPercent(50); ReadTransP(); // K трансформации QueryCloseP(); dbKpulse = 5000; // K преобразования SetCanalsAll(); return(1); }
double2 ReadTrans31_Full(void) { if (QueryOpen31_Full(25) == false) return GetDouble2Error(); uchar r; for (r=0; r<MaxRepeats(); r++) { DelayOff(); QueryTrans31(); if (Input31() == SER_GOODCHECK) break; if (fKey == true) return GetDouble2Error(); } if (r == MaxRepeats()) return GetDouble2Error(); ShowPercent(50); InitPop(3+4+4+1); double dbTransU = PopDouble31(); double dbTransI = PopDouble31(); return GetDouble2(dbTransU*dbTransI, true); }
time2 ReadTimeDateB_Short(void) { DelayOff(); QueryOpenB(); if (Input() != SER_GOODCHECK) return GetTime2Error(); DelayOff(); QueryTimeB(); if (Input() != SER_GOODCHECK) return GetTime2Error(); return GetTime2(ReadTimeB(), true); }
// открытие канала для счётчиков Elster A1140 bool OpenDeviceP(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { QueryOpenP(); if (ElsInput(1) == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(20); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryModeP(); if (ElsInput(0) == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(30); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryPasswordP(); if (ElsInput(2) == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(40); return(1); }
time2 ReadTimeDateC_Short(void) { DelayOff(); QueryTimeC(); if (RevInput() != SER_GOODCHECK) return GetTime2Error(); return GetTime2(ReadTimeC(), true); }
bool ReadKoeffDeviceG(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { QueryOpenG(); if (CodInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); if (ReadOpenG() == 0) return(0); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); InitPushCod(); PushChar(0x7E); PushChar(0x03); PushChar(0x06); PushCharCod(0x03); PushCharCod(0x00); PushCharCod(0x00); CodQueryIO(3+25+1, 3+3+1); if (CodInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(50); InitPop(3); for (i=0; i<9; i++) PopChar(); if (ExtVersionCod()) PopRealExt_G(); else PopRealBCD_G(); dbKtrans = reBuffA; if (ExtVersionCod()) PopRealExt_G(); else PopRealBCD_G(); dbKtrans *= reBuffA; // K трансформации reBuffA = 10000; // K преобразования return(1); }
bool ReadTimeDateZ_Short(void) { DelayOff(); QueryTimeZ(); if (ZetInput() != SER_GOODCHECK) return(0); ReadTimeAltZ(); return(1); }
bool ReadTimeDateT_Short(void) { DelayOff(); QueryTimeT(); if (TxtInput() != SER_GOODCHECK) return(0); ReadTimeAltT(); return(1); }
bool ReadModemQuality(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryModemBaud(0); if (ModInputOK(1) == 1) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) ; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryModemCommon(0); if (ModInputOK(1) == 1) break; if (fKey == true) return(0); sprintf(szLo+15, "%1u", i+1); } if (i == bMINORREPEATS) return(0); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryModemQuality(); if (ModQualityOK(1) == 1) break; if (fKey == true) return(0); sprintf(szLo+15, "%1u", i+1); } return(1); }
// открытие канала для счётчиков ABB Альфа bool OpenDeviceD(void) { uchar i; for (i=0; i<bMAJORREPEATS; i++) { ShowPercent(i); DelayOff(); QueryOpenD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMAJORREPEATS) return(0); ShowPercent(48); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryPasswordD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(49); if (InBuff(2) != 0) return(0); ShowPercent(50); return(1); }
time2 QueryTimeC_Full(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryTimeC(); if (RevInput() == SER_GOODCHECK) break; if (fKey == true) return GetTime2Error(); } if (i == bMINORREPEATS) return GetTime2Error(); return GetTime2(ReadTimeC(), true); }
time2 QueryTimeS_Full(uchar bPercent) { uchar i; for (i=0; i<MaxRepeats(); i++) { DelayOff(); QueryTimeS(); if (InputS() == SER_GOODCHECK) break; if (fKey == true) return GetTime2Error(); } if (i == MaxRepeats()) return GetTime2Error(); ShowPercent(bPercent); return GetTime2(ReadTimeS(), true); }
ulong2 ReadSerialCanC(uchar ibCan) { uchar r; for (r=0; r<MaxRepeats(); r++) { DelayOff(); QueryOpenC(); if (RevInput() == SER_GOODCHECK) break; if (fKey == true) return GetLong2Error(); } if (r == MaxRepeats()) return GetLong2Error(); ShowPercent(25); return QuerySerialC_Full(ibCan); }
time2 QueryTime31_Full(uchar bPercent) { uchar r; for (r=0; r<MaxRepeats(); r++) { DelayOff(); QueryTime31(); if (Input31() == SER_GOODCHECK) break; if (fKey == true) return GetTime2Error(); } if (r == MaxRepeats()) return GetTime2Error(); ShowPercent(bPercent); return GetTime2(ReadTime31(), true); }
bool QueryEventA_Full(uchar ibEvent, uchar j, uchar bPercent) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryEventA(ibEvent,j); if (Input() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(bPercent+j); return(1); }
// задание параметров для счётчиков СС-301 bool AutomaticC(void) { if (ReadKoeffDeviceC() == 0) return(0); SetCanalsAll(); // сохранение К преобразования и К трасформации DelayOff(); QueryEnergyAbsC(); // чтение накопленной энергии if (RevInput() != SER_GOODCHECK) return(0); ShowPercent(100); /* ReadEnergyC(); SetEnergyAll(); // сохранение показаний счётчиков */ return(1); }
bool QueryConfigS_Full(uchar bPercent) { uchar i; for (i=0; i<MaxRepeats(); i++) { DelayOff(); QueryConfigS(); if (InputS() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == MaxRepeats()) return(0); ShowPercent(bPercent); ReadConfigS(); return(1); }
bool QueryEngMonS_Full(uchar bTime, uchar bPercent) { uchar i; for (i=0; i<MaxRepeats(); i++) { DelayOff(); QueryEngMonS(bTime); if (InputS() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == MaxRepeats()) return(0); ShowPercent(bPercent); ReadEnergyS(); return(1); }
bool ReadTimeDateH_Short(void) { QueryOpenH(); if (CodInput() != SER_GOODCHECK) return(0); if (ReadOpenH() == 0) return(0); DelayOff(); QueryTimeH(); if (CodInput() != SER_GOODCHECK) return(0); ReadTimeAltH(); return(1); }
bool QueryEngAbs31_Full(uchar bPercent) { uchar r; for (r=0; r<MaxRepeats(); r++) { DelayOff(); QueryEngAbs31(); if (Input31() == SER_GOODCHECK) break; if (fKey == true) return false; } if (r == MaxRepeats()) return false; ShowPercent(bPercent); ReadEng31(); return true; }
bool ReadKoeffDeviceP(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryRegisterP(); if (ElsInput(0) != SER_GOODCHECK) continue; else break; } if (i == bMINORREPEATS) return(0); ShowPercent(60); ReadRegisterP(); return(1); }
bool QueryEnergyAbsC_Full2(uchar bPercent) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryEnergyAbsC(); if (RevInput() == SER_GOODCHECK) break; if (fKey == true) return false; if (QueryIdC_Full() == 0) return false; } if (i == bMINORREPEATS) return false; ShowPercent(bPercent); ReadEnergyC(); return(1); }
bool QueryIdC_Full(void) { uchar i; for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryIdC(); if ((RevInput() == SER_GOODCHECK) && (ReadIdC() == 1)) break; if (fKey == true) return false; ShowLo(szFailure20); Delay(1000); mpcwFailure2[ibDig]++; } Clear(); if (i == bMINORREPEATS) return false; return(1); }
bool QueryOpen31_Full(uchar bPercent) { Clear(); uchar r; for (r=0; r<MaxRepeats(); r++) { DelayOff(); QueryOpen31(); if (Input31() == SER_GOODCHECK) break; if (fKey == true) return false; } if (r == MaxRepeats()) return false; ShowPercent(bPercent); if (ReadOpen31() == false) return false; return true; }
// задание параметров для счётчиков ABB Альфа bool AutomaticD(void) { uchar i; if (OpenDeviceD() == 0) return(0); for (i=0; i<bMINORREPEATS; i++) { DelayOff(); QueryConfigD(); if (ExtInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(51); if (InBuff(2) != 0) return(0); ShowPercent(52); ReadConfigD(); if (ReadAllEnergyD() == 0) return(0); QueryCloseD(0); MakeEnergyD(); SetCanReal(mpreCount,ibDig); return(1); }
// задание параметров для сумматора СЭМ-2 bool AutomaticE(void) { uchar i; if (OpenDeviceE() == 0) return(0); for (i=0; i<bMINORREPEATS; i++) { InitPush(0); PushChar(0x1B); PushChar('w'); Query(300+1, 2, 1); if (EscInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(75); InitPop((uint)132 + diCurr.ibLine*3);// K трансформации PopRealBCD(); dbKtrans = reBuffA; InitPop((uint)180 + diCurr.ibLine*3); // K преобразования PopRealBCD(); SetCanalsAll(); // сохранение К преобразования и К трасформации DelayOff(); for (i=0; i<bMINORREPEATS; i++) // чтение накопленной энергии { InitPush(0); PushChar(0x1B); PushChar('S'); Query(64+1, 2, 1); if (EscInput() == SER_GOODCHECK) break; if (fKey == true) return(0); } if (i == bMINORREPEATS) return(0); ShowPercent(100); InitPop(diCurr.ibLine*4); coFloat.mpbBuff[0] = PopChar(); coFloat.mpbBuff[1] = PopChar(); coFloat.mpbBuff[2] = PopChar(); coFloat.mpbBuff[3] = PopChar(); ToReal(); SetCanReal(mpreCount,ibDig); // сохранение показаний счётчиков return(1); }