Huge changes, remove non-multichan code
r1511 | dcl | 2007-02-19 12:33:58 +1100 (Mon, 19 Feb 2007) | 2 lines
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
N H Q 2 0 0 U T I L
|
||||
|
||||
A few utility functions for talking to a NHQ 200
|
||||
voltage controller via the SINQ setup:
|
||||
voltage controller via the ANSTO setup:
|
||||
TCP/IP===MOXA===RS-232===NHQ200.
|
||||
|
||||
Mark Koennecke, Juli 1997
|
||||
@@ -14,7 +14,7 @@
|
||||
#define NHQ200_UTIL_H
|
||||
|
||||
/*----------------------- ERRORCODES--------------------------------------
|
||||
Most functions return a negative error code on failure. Error codes
|
||||
Most functions return a negative error code on failure. Error codes
|
||||
defined are those defined for serialsinq plus a few additional ones:
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
#define NHQ200__BADSET -530 /* failed three times to set voltage */
|
||||
#define NHQ200__READONLY -531
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
typedef struct __NHQ200 {
|
||||
pMultiChan mcc;
|
||||
int iRead;
|
||||
int iControl;
|
||||
void *pData;
|
||||
@@ -37,9 +39,25 @@ typedef struct __NHQ200 {
|
||||
but force the value to 1.0 all the time */
|
||||
float fDiv;
|
||||
float fMult;
|
||||
float fValue;
|
||||
int iError;
|
||||
int iReadOnly;
|
||||
prs232 controller;
|
||||
} NHQ200;
|
||||
int iState;
|
||||
char serial_number[20];
|
||||
char software_version[20];
|
||||
char voltage_max[20];
|
||||
char current_max[20];
|
||||
char status_s[20];
|
||||
char status_t[20];
|
||||
int module_status;
|
||||
int vmax_percent;
|
||||
int imax_percent;
|
||||
int ramp_input;
|
||||
char* transReply;
|
||||
int transWait;
|
||||
int iGetOut;
|
||||
struct timeval tv_last;
|
||||
} NHQ200;
|
||||
|
||||
typedef struct __NHQ200 *pNHQ200;
|
||||
|
||||
@@ -55,29 +73,29 @@ iMode: 1 for ReadOnly, 0 for normal mode
|
||||
Return values are 1 for success, a negative error code on
|
||||
failure.
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
void NHQ200_Close(pNHQ200 *pData);
|
||||
/****** close a connection to an NHQ200controller and frees its
|
||||
data structure. The only parameter is a pointer to the data
|
||||
data structure. The only parameter is a pointer to the data
|
||||
structure for this controller. This pointer will be invalid after
|
||||
this call.
|
||||
*/
|
||||
*/
|
||||
|
||||
int NHQ200_Config(pNHQ200 *pData, int iTmo, int iRead,
|
||||
int NHQ200_Config(pNHQ200 *pData, int iTmo, int iRead,
|
||||
int iControl, float fDiv, float fMult);
|
||||
/***** configure some aspects of a NHQ200 voltage controller.
|
||||
The parameter are:
|
||||
- a pointer to the data structure for the controller as
|
||||
- a pointer to the data structure for the controller as
|
||||
returned by NHQ200_Open
|
||||
- a value for the connection timeout
|
||||
- the voltage sensor to use for reading the
|
||||
- the voltage sensor to use for reading the
|
||||
voltage.
|
||||
- the voltage sensor used by the NHQ200controller
|
||||
- the voltage sensor used by the NHQ200controller
|
||||
for regulating the voltage.
|
||||
- the divisor needed to calculate the real voltage
|
||||
from the sensor.
|
||||
The function returns 1 on success, a negative error code on
|
||||
from the sensor.
|
||||
The function returns 1 on success, a negative error code on
|
||||
failure.
|
||||
*/
|
||||
|
||||
@@ -116,7 +134,7 @@ void NHQ200_ErrorTxt(pNHQ200 *pData, int iCode, char *pError, int iLen);
|
||||
/******* translates one of the negative error NHQ200error codes
|
||||
into text. Maximum iLen bytes will be copied to the
|
||||
buffer pError;
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
#endif /* NHQ200_UTIL_H */
|
||||
|
||||
Reference in New Issue
Block a user