Commit d4a739f7 authored by claes's avatar claes

Changed error handling so that sporadic error are allowed and does not cause system to halt

parent 98ffea19
/*
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.2 2006-04-12 10:14:49 claes Exp $
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.3 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,6 +58,7 @@ typedef struct {
unsigned int Address;
int Qbus_fp;
int ScanCount[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus AiRangeToCoef(
......@@ -179,6 +180,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb;
qbus_io_write wb;
int timeout;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ai_HVAI32 *) cp->op;
......@@ -241,7 +243,16 @@ static pwr_tStatus IoCardRead (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.3 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -59,6 +59,7 @@ typedef struct {
pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst;
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus AoRangeToCoef(
......@@ -193,6 +194,7 @@ static pwr_tStatus IoCardWrite (
pwr_tFloat32 rawvalue;
qbus_io_write wb;
int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ao_HVAO4 *) cp->op;
......@@ -267,7 +269,16 @@ static pwr_tStatus IoCardWrite (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.5 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -62,6 +62,7 @@ typedef struct {
unsigned int bfb_item;
pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -203,6 +204,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb;
qbus_io_write wb;
io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local);
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Co_PI24BO *) cp->op;
......@@ -305,7 +307,16 @@ static pwr_tStatus IoCardRead (
if ( sts1 == -1 || sts2 == -1)
{
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_di_dix2.c,v 1.5 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_di_dix2.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -59,6 +59,7 @@ typedef struct {
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -147,6 +148,7 @@ static pwr_tStatus IoCardRead (
int sts;
qbus_io_read rb;
int bfb_error = 0;
pwr_tTime now;
op = (pwr_sClass_Di_DIX2 *) cp->op;
......@@ -210,7 +212,16 @@ static pwr_tStatus IoCardRead (
if ( sts <= 0)
{
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.5 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -57,6 +57,7 @@ typedef struct {
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite (
int i;
qbus_io_write wb;
int sts;
pwr_tTime now;
op = (pwr_sClass_Do_HVDO32 *) cp->op;
......@@ -220,7 +222,16 @@ static pwr_tStatus IoCardWrite (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.3 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,7 @@ typedef struct {
unsigned int Address;
int Qbus_fp;
int ScanCount[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus AiRangeToCoef(
......@@ -178,6 +179,7 @@ static pwr_tStatus IoCardRead (
int sts;
qbus_io_read rb;
int bfb_error = 0;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
......@@ -260,7 +262,16 @@ static pwr_tStatus IoCardRead (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.4 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.5 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,6 +58,7 @@ typedef struct {
pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst;
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus AoRangeToCoef(
......@@ -194,6 +195,7 @@ static pwr_tStatus IoCardWrite (
pwr_tFloat32 rawvalue;
qbus_io_write wb;
int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
......@@ -268,7 +270,16 @@ static pwr_tStatus IoCardWrite (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ssab_co.c,v 1.3 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_ssab_co.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -59,6 +59,7 @@ typedef struct {
int Qbus_fp;
pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -200,6 +201,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb;
qbus_io_write wb;
io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local);
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_CO4uP *) cp->op;
......@@ -313,7 +315,16 @@ static pwr_tStatus IoCardRead (
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ssab_di.c,v 1.4 2006-09-05 12:03:01 claes Exp $
* Proview $Id: rt_io_m_ssab_di.c,v 1.5 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -57,6 +57,7 @@ typedef struct {
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -144,6 +145,7 @@ static pwr_tStatus IoCardRead (
int sts;
qbus_io_read rb;
int bfb_error = 0;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDiCard *) cp->op;
......@@ -209,7 +211,16 @@ static pwr_tStatus IoCardRead (
/* Error handling for local Qbus-I/O */
{
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/*
* Proview $Id: rt_io_m_ssab_do.c,v 1.3 2006-07-03 06:20:03 claes Exp $
* Proview $Id: rt_io_m_ssab_do.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,6 +58,7 @@ typedef struct {
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
pwr_tTime ErrTime;
} io_sLocal;
static pwr_tStatus IoCardInit (
......@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite (
int i;
qbus_io_write wb;
int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDoCard *) cp->op;
......@@ -222,7 +224,17 @@ static pwr_tStatus IoCardWrite (
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment