- Added a a general data handling object

- Extended the callback interface to register scipts on callbacks
- Fixed a stop bug in the anticollision object
- Modified the HM code to do zero through a client connection
This commit is contained in:
cvs
2003-06-13 11:35:35 +00:00
parent f3853c20f0
commit 6819991e85
26 changed files with 1649 additions and 98 deletions

View File

@ -105,7 +105,7 @@ int GPIBAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]){
pGPIB self = (pGPIB)pData;
int boardID, devID, tmo, count, eoi, eot, address,
secondaryAddress, status, terminator;
secondaryAddress, status, terminator, value;
char pBuffer[1024];
char *result = NULL;
@ -267,10 +267,36 @@ int GPIBAction(SConnection *pCon, SicsInterp *pSics, void *pData,
SCWrite(pCon,pBuffer,eValue);
return 1;
} else {
sprintf(pBuffer,"ERROR: error %d on send", status);
sprintf(pBuffer,"ERROR: error %d on read", status);
SCWrite(pCon,pBuffer,eError);
return 0;
}
} else if(strcmp(argv[1],"readnum") == 0){
/*
readnum command
*/
if(argc < 2){
SCWrite(pCon,"ERROR: insufficient number of arguments to read",
eError);
return 0;
}
if(Tcl_GetInt(pSics->pTcl,argv[2],&devID) != TCL_OK){
SCWrite(pCon,"ERROR: failed to convert arguments to integer",
eError);
return 0;
}
status = GPIBread(self,devID,&value, 4);
if(status > 0){
sprintf(pBuffer,"gpib %d = %d",devID,value);
SCWrite(pCon,pBuffer,eValue);
return 1;
} else {
/*
sprintf(pBuffer,"ERROR: error %d on read", status);
SCWrite(pCon,pBuffer,eError);
*/
return 0;
}
} else if(strcmp(argv[1],"readtillterm") == 0){
/*
read command