- Introduced a new trace facility
- Fixed performance problems in many protocol drivers.
This commit is contained in:
@ -67,6 +67,7 @@ int JulchoHandler(Ascon * a)
|
||||
a->state = AsconTimeout;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -62,6 +62,7 @@ static int PhytronHandler(Ascon * a)
|
||||
a->state = AsconTimeout;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
19
pmacprot.c
19
pmacprot.c
@ -16,6 +16,10 @@
|
||||
* copyright: see file COPYRIGHT
|
||||
*
|
||||
* Mark Koennecke, December 2008
|
||||
*
|
||||
* Introduced a delay on read in order to throttle requests
|
||||
*
|
||||
* Mark Koennecke, June 2011
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <ascon.h>
|
||||
@ -79,8 +83,12 @@ typedef struct {
|
||||
char *ptr;
|
||||
int bytesToWrite;
|
||||
int expectACK;
|
||||
double startTime;
|
||||
} PMACPrivate, *pPMACPrivate;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* wait period before read
|
||||
----------------------------------------------------------------------------*/
|
||||
#define READDELAY .05
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int PMACHandler(Ascon * a)
|
||||
{
|
||||
@ -123,11 +131,19 @@ static int PMACHandler(Ascon * a)
|
||||
a->wrPos += ret;
|
||||
if (a->wrPos >= priv->bytesToWrite) {
|
||||
a->state = AsconWriteDone;
|
||||
priv->startTime = DoubleTime();
|
||||
} else {
|
||||
priv->ptr += ret;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AsconReadStart:
|
||||
DynStringClear(a->rdBuffer);
|
||||
if(DoubleTime() > priv->startTime + READDELAY){
|
||||
a->start = DoubleTime();
|
||||
a->state = AsconReading;
|
||||
}
|
||||
break;
|
||||
case AsconReading:
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
if (ret < 0) {
|
||||
@ -166,6 +182,7 @@ static int PMACHandler(Ascon * a)
|
||||
a->state = AsconTimeout;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -6,6 +6,8 @@
|
||||
copyright: see copyright.h
|
||||
|
||||
Uwe Filges, November 2001
|
||||
|
||||
Various edits, added rotaion_speed_targtes, Mark Koennecke, 2011
|
||||
----------------------------------------------------------------------------*/
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
@ -24,6 +26,7 @@
|
||||
#include "polterwrite.h"
|
||||
#include "sicsvar.h"
|
||||
#include "nxscript.h"
|
||||
#include "sicshipadaba.h"
|
||||
|
||||
/*
|
||||
diaphragm1 - chopper
|
||||
@ -128,9 +131,18 @@ static void writePolterdiGlobal(NXhandle hfil, NXdict hdict,
|
||||
/*-------------------------------------------------------------------*/
|
||||
static void writeChopper(NXhandle hfil, NXdict hdict, SConnection * pCon)
|
||||
{
|
||||
pHdb node = NULL;
|
||||
float fVal;
|
||||
|
||||
SNXSPutVariable(pServ->pSics, pCon, hfil, hdict, "cname", "choppername");
|
||||
SNXSPutDrivable(pServ->pSics, pCon, hfil, hdict, "chopperspeed", "crot");
|
||||
SNXSPutDrivable(pServ->pSics, pCon, hfil, hdict, "chopperphase", "cphase");
|
||||
|
||||
node = FindHdbNode(NULL,"/sics/choco/chopper/nspee", NULL);
|
||||
if(node != NULL){
|
||||
fVal = (float)node->value.v.doubleValue;
|
||||
NXDputalias(hfil,hdict,"crottarget",&fVal);
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
|
8
spss7.c
8
spss7.c
@ -164,7 +164,7 @@ static char *S7WriteHandler(void *actionData, char *reply, int comerror)
|
||||
static void UpdateSPSDataBase(pS7Action self)
|
||||
{
|
||||
char *pPtr;
|
||||
char name[15], unit[9], description[25], reference[11], error[50];
|
||||
char name[15], unit[9], description[25], reference[11], error[50], alarms[10];
|
||||
unsigned char type, alarm;
|
||||
unsigned short val;
|
||||
int ival;
|
||||
@ -220,6 +220,8 @@ static void UpdateSPSDataBase(pS7Action self)
|
||||
snprintf(error,50,"Alarm %d on par",alarm);
|
||||
SetHdbProperty(node,"geterror", error);
|
||||
}
|
||||
snprintf(alarms,sizeof(alarms),"%d",alarm);
|
||||
SetHdbProperty(node,"alarm", alarms);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------
|
||||
@ -308,7 +310,7 @@ static hdbCallbackReturn S7WriteCallback(pHdb currentNode,
|
||||
static void InitializeSPSDataBase(pS7Action self, pHdb parent)
|
||||
{
|
||||
char *pPtr;
|
||||
char name[15], unit[9], description[25], reference[11], num[11], error[50];
|
||||
char name[15], unit[9], description[25], reference[11], num[11], error[50], alarms[10];
|
||||
unsigned char type, alarm;
|
||||
short val;
|
||||
int ival;
|
||||
@ -364,6 +366,8 @@ static void InitializeSPSDataBase(pS7Action self, pHdb parent)
|
||||
snprintf(error,10,"Alarm %d on par",alarm);
|
||||
SetHdbProperty(node,"geterror", error);
|
||||
}
|
||||
snprintf(alarms,sizeof(alarms),"%d",alarm);
|
||||
SetHdbProperty(node,"alarm", alarms);
|
||||
SetHdbProperty(node,"unit", unit);
|
||||
SetHdbProperty(node,"description", description);
|
||||
SetHdbProperty(node,"reference", reference);
|
||||
|
Reference in New Issue
Block a user