Largely comments and formatting
r1426 | dcl | 2007-02-05 11:38:40 +1100 (Mon, 05 Feb 2007) | 2 lines
This commit is contained in:
@@ -2,37 +2,30 @@
|
|||||||
N H Q 2 0 0 U T I L
|
N H Q 2 0 0 U T I L
|
||||||
|
|
||||||
A few utility functions for talking to a NHQ 200
|
A few utility functions for talking to a NHQ 200
|
||||||
voltage controller via the SINQ setup: TCP/IP--MAC--RS-232--
|
voltage controller via the SINQ setup:
|
||||||
NHQ200.
|
TCP/IP===MOXA===RS-232===NHQ200.
|
||||||
|
|
||||||
Mark Koennecke, Juli 1997
|
Mark Koennecke, Juli 1997
|
||||||
Mark Lesha, January 2006 (based on ITC4 code)
|
Mark Lesha, January 2006 (based on ITC4 code)
|
||||||
Douglas Clowes, December 2006 (based on LAKESHORE340 code)
|
Douglas Clowes, December 2006 (based on LAKESHORE340 code)
|
||||||
|
|
||||||
----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#ifndef SINQNHQ200
|
#ifndef NHQ200_UTIL_H
|
||||||
#define SINQNHQ200
|
#define NHQ200_UTIL_H
|
||||||
|
|
||||||
/*----------------------- ERRORCODES--------------------------------------
|
/*----------------------- 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:
|
defined are those defined for serialsinq plus a few additional ones:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NHQ200__BADCOM -501
|
#define NHQ200__BADCOM -501 /* command not recognized */
|
||||||
/* command not recognized */
|
#define NHQ200__BADPAR -502 /* bad parameter to command */
|
||||||
#define NHQ200__BADPAR -502
|
#define NHQ200__BADMALLOC -503 /* error allocating memory */
|
||||||
/* bad parameter to command */
|
#define NHQ200__BADREAD -504 /* error analysing command string on Read */
|
||||||
#define NHQ200__BADMALLOC -503
|
#define NHQ200__FAULT -505 /* fault or overload condition exists in NHQ200 */
|
||||||
/* error allocating memory */
|
#define NHQ200__NONHQ200 -510 /* Controller is not NHQ200 */
|
||||||
#define NHQ200__BADREAD -504
|
#define NHQ200__BADSET -530 /* failed three times to set voltage */
|
||||||
/* error analysing command string on Read */
|
#define NHQ200__READONLY -531
|
||||||
#define NHQ200__FAULT -505
|
|
||||||
/* fault or overload condition exists in NHQ200 */
|
|
||||||
#define NHQ200__NONHQ200 -510
|
|
||||||
/* Controller is not NHQ200 */
|
|
||||||
#define NHQ200__BADSET -530
|
|
||||||
/* failed three times to set temperature */
|
|
||||||
#define NHQ200__READONLY -531
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
typedef struct __NHQ200 {
|
typedef struct __NHQ200 {
|
||||||
int iRead;
|
int iRead;
|
||||||
@@ -73,16 +66,16 @@ void NHQ200_Close(pNHQ200 *pData);
|
|||||||
|
|
||||||
int NHQ200_Config(pNHQ200 *pData, int iTmo, int iRead,
|
int NHQ200_Config(pNHQ200 *pData, int iTmo, int iRead,
|
||||||
int iControl, float fDiv, float fMult);
|
int iControl, float fDiv, float fMult);
|
||||||
/***** configure some aspects of a NHQ200temperature controller.
|
/***** configure some aspects of a NHQ200 voltage controller.
|
||||||
The parameter are:
|
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
|
returned by NHQ200_Open
|
||||||
- a value for the connection timeout
|
- a value for the connection timeout
|
||||||
- the temperature sensor to use for reading the
|
- the voltage sensor to use for reading the
|
||||||
temperature.
|
voltage.
|
||||||
- the temperature sensor used by the NHQ200controller
|
- the voltage sensor used by the NHQ200controller
|
||||||
for regulating the temperature.
|
for regulating the voltage.
|
||||||
- the divisor needed to calculate the real temperature
|
- the divisor needed to calculate the real voltage
|
||||||
from the sensor.
|
from the sensor.
|
||||||
The function returns 1 on success, a negative error code on
|
The function returns 1 on success, a negative error code on
|
||||||
failure.
|
failure.
|
||||||
@@ -100,7 +93,7 @@ int NHQ200_Send(pNHQ200 *pData, char *pCommand, char *pReply, int iLen);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int NHQ200_Read(pNHQ200 *pData, float *fVal);
|
int NHQ200_Read(pNHQ200 *pData, float *fVal);
|
||||||
/******* reads the current actual temperature of the sensor
|
/******* reads the current actual voltage of the sensor
|
||||||
configured by ConfigNHQ200for reading. The value is returned
|
configured by ConfigNHQ200for reading. The value is returned
|
||||||
in fVal. The first parameter is a pointer to a NHQ200
|
in fVal. The first parameter is a pointer to a NHQ200
|
||||||
data structure as returned by NHQ200_Open.
|
data structure as returned by NHQ200_Open.
|
||||||
@@ -110,7 +103,7 @@ int NHQ200_Read(pNHQ200 *pData, float *fVal);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int NHQ200_Set(pNHQ200 *pData, float fVal);
|
int NHQ200_Set(pNHQ200 *pData, float fVal);
|
||||||
/****** sets a new preset temperature in the NHQ200temperature
|
/****** sets a new preset voltage in the NHQ200 voltage
|
||||||
controller. Parameters are:
|
controller. Parameters are:
|
||||||
- a pointer to a NHQ200data structure as returned by NHQ200_Open.
|
- a pointer to a NHQ200data structure as returned by NHQ200_Open.
|
||||||
- the new preset value.
|
- the new preset value.
|
||||||
@@ -126,6 +119,6 @@ void NHQ200_ErrorTxt(pNHQ200 *pData, int iCode, char *pError, int iLen);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif /* NHQ200_UTIL_H */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user