Low-Energy Muon (LEM) Experiment  0.5.1
sep61vac.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "sep61vac.h"
Include dependency graph for sep61vac.c:

Go to the source code of this file.

Data Structures

struct  SEP61VAC_INTERN
 Stores DD specific internal information. More...
 
struct  SEP61VAC_NAMES
 Stores the names of the various channels which are than transferred form the DD to the variable names. More...
 
struct  SEP61VAC_Vac_Labels
 description structure for the DB labels More...
 
struct  SEP61VAC_DB50
 This is the c-structure holding the DB50 information of the SEP61VAC. More...
 
struct  SEP61VAC_INFO
 This structure contains private variables for the device driver. More...
 

Macros

#define SEP61VAC_READ_TIME_CONST   7
 trigger time constant for read out of the SPS More...
 
#define SEP61VAC_TIMEOUT_ERROR   3600
 after what time (sec.) read errors should be reported More...
 
#define SEP61VAC_REQ_SIZE   16
 SPS fetch/write request size. More...
 
#define SEP61VAC_SPS_MAX_BYTES   840
 number of bytes in the SPS protocol More...
 
#define SEP61VAC_SPS_MAX_OBJ   25
 number of objects in the DB50 More...
 
#define SEP61VAC_INTERN_STR   "\Detailed Messages = INT : 0\n\"
 Initializing string for the struct SEP61VAC_INTERN. More...
 
#define SEP61VAC_NAMES_STR   "\Input Names = STRING[11] : \n\[32] SEP61VAC Life Sign\n\[32] SEP61VAC GP Pirani\n\[32] SEP61VAC GS63\n\[32] SEP61VAC GFE\n\[32] SEP61VAC GFA\n\[32] SEP61VAC Status Word 1\n\[32] SEP61VAC Status Word 2\n\[32] SEP61VAC VSDE Status Word\n\[32] SEP61VAC VSDA Status Word\n\[32] SEP61VAC GTS63 Status Word\n\[32] SEP61VAC GIS63 Status Word\n\"
 Initializing string for the struct SEP61VAC_NAMES. More...
 
#define SEP61VAC_DB50_STR   "\testnumber = SHORT : 0\n\teststring = CHAR[4] : \n\"" \n\telegramlength = SHORT : 0\n\generaltype = SHORT : 0\n\lifesign = SHORT : 0\n\res_12 = SHORT : 0\n\res_14 = SHORT : 0\n\res_16 = SHORT : 0\n\res_18 = SHORT : 0\n\no_of_objects = SHORT : 0\n\obj1 = CHAR[10] : \n\""\n\subtype1 = SHORT : 0\n\offset1 = SHORT : 0\n\obj2 = CHAR[10] : \n\""\n\subtype2 = SHORT : 0\n\offset2 = SHORT : 0\n\obj3 = CHAR[10] : \n\""\n\subtype3 = SHORT : 0\n\offset3 = SHORT : 0\n\obj4 = CHAR[10] : \n\""\n\subtype4 = SHORT : 0\n\offset4 = SHORT : 0\n\obj5 = CHAR[10] : \n\""\n\subtype5 = SHORT : 0\n\offset5 = SHORT : 0\n\obj6 = CHAR[10] : \n\""\n\subtype6 = SHORT : 0\n\offset6 = SHORT : 0\n\obj7 = CHAR[10] : \n\""\n\subtype7 = SHORT : 0\n\offset7 = SHORT : 0\n\obj8 = CHAR[10] : \n\""\n\subtype8 = SHORT : 0\n\offset8 = SHORT : 0\n\obj9 = CHAR[10] : \n\""\n\subtype9 = SHORT : 0\n\offset9 = SHORT : 0\n\obj10 = CHAR[10] : \n\""\n\subtype10 = SHORT : 0\n\offset10 = SHORT : 0\n\obj11 = CHAR[10] : \n\""\n\subtype11 = SHORT : 0\n\offset11 = SHORT : 0\n\obj12 = CHAR[10] : \n\""\n\subtype12 = SHORT : 0\n\offset12 = SHORT : 0\n\obj13 = CHAR[10] : \n\""\n\subtype13 = SHORT : 0\n\offset13 = SHORT : 0\n\obj14 = CHAR[10] : \n\""\n\subtype14 = SHORT : 0\n\offset14 = SHORT : 0\n\obj15 = CHAR[10] : \n\""\n\subtype15 = SHORT : 0\n\offset15 = SHORT : 0\n\obj16 = CHAR[10] : \n\""\n\subtype16 = SHORT : 0\n\offset16 = SHORT : 0\n\obj17 = CHAR[10] : \n\""\n\subtype17 = SHORT : 0\n\offset17 = SHORT : 0\n\obj18 = CHAR[10] : \n\""\n\subtype18 = SHORT : 0\n\offset18 = SHORT : 0\n\obj19 = CHAR[10] : \n\""\n\subtype19 = SHORT : 0\n\offset19 = SHORT : 0\n\obj20 = CHAR[10] : \n\""\n\subtype20 = SHORT : 0\n\offset20 = SHORT : 0\n\obj21 = CHAR[10] : \n\""\n\subtype21 = SHORT : 0\n\offset21 = SHORT : 0\n\obj22 = CHAR[10] : \n\""\n\subtype22 = SHORT : 0\n\offset22 = SHORT : 0\n\obj23 = CHAR[10] : \n\""\n\subtype23 = SHORT : 0\n\offset23 = SHORT : 0\n\obj24 = CHAR[10] : \n\""\n\subtype24 = SHORT : 0\n\offset24 = SHORT : 0\n\obj25 = CHAR[10] : \n\""\n\subtype25 = SHORT : 0\n\offset25 = SHORT : 0\n\unused_1 = CHAR[128] : \n\""\n\ps60_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps60_gp = SHORT : 0\n\ps60_aw2 = SHORT : 0\n\ps60_aw3 = SHORT : 0\n\ps60_aw4 = SHORT : 0\n\ps60_cmdword = SHORT : 0\n\unused_2 = SHORT : 0\n\ps61_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps61_gp = SHORT : 0\n\ps61_aw2 = SHORT : 0\n\ps61_aw3 = SHORT : 0\n\ps61_aw4 = SHORT : 0\n\ps61_cmdword = SHORT : 0\n\unused_3 = SHORT : 0\n\ps62_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps62_gp = SHORT : 0\n\ps62_aw2 = SHORT : 0\n\ps62_aw3 = SHORT : 0\n\ps62_aw4 = SHORT : 0\n\ps62_cmdword = SHORT : 0\n\unused_4 = SHORT : 0\n\ps63_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps63_gp = SHORT : 0\n\ps63_gfe = SHORT : 0\n\ps63_gfa = SHORT : 0\n\ps63_aw4 = SHORT : 0\n\ps63_cmdword = SHORT : 0\n\unused_5 = SHORT : 0\n\ps64_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps64_gp = SHORT : 0\n\ps64_aw2 = SHORT : 0\n\ps64_aw3 = SHORT : 0\n\ps64_aw4 = SHORT : 0\n\ps64_cmdword = SHORT : 0\n\unused_6 = SHORT : 0\n\ps65_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps65_gp = SHORT : 0\n\ps65_aw2 = SHORT : 0\n\ps65_aw3 = SHORT : 0\n\ps65_aw4 = SHORT : 0\n\ps65_cmdword = SHORT : 0\n\unused_7 = SHORT : 0\n\ps66_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps66_gp = SHORT : 0\n\ps66_aw2 = SHORT : 0\n\ps66_aw3 = SHORT : 0\n\ps66_aw4 = SHORT : 0\n\ps66_cmdword = SHORT : 0\n\unused_8 = SHORT : 0\n\ps67_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps67_gp = SHORT : 0\n\ps67_aw2 = SHORT : 0\n\ps67_aw3 = SHORT : 0\n\ps67_aw4 = SHORT : 0\n\ps67_cmdword = SHORT : 0\n\unused_9 = SHORT : 0\n\pz_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\pz_gv1 = SHORT : 0\n\pz_gv2 = SHORT : 0\n\pz_aw3 = SHORT : 0\n\pz_aw4 = SHORT : 0\n\pz_cmdword = SHORT : 0\n\unused_10 = SHORT : 0\n\gts60_statusword = SHORT : 0\n\gis60_statusword = SHORT : 0\n\gts60_value = SHORT : 0\n\gis60_value = SHORT : 0\n\unused_11 = SHORT : 0\n\gts61_statusword = SHORT : 0\n\gis61_statusword = SHORT : 0\n\gts61_value = SHORT : 0\n\gis61_value = SHORT : 0\n\unused_12 = SHORT : 0\n\gts62_statusword = SHORT : 0\n\gis62_statusword = SHORT : 0\n\gts62_value = SHORT : 0\n\gis62_value = SHORT : 0\n\unused_13 = SHORT : 0\n\gts63_statusword = SHORT : 0\n\gis63_statusword = SHORT : 0\n\gts63_value = SHORT : 0\n\gis63_value = SHORT : 0\n\unused_14 = SHORT : 0\n\gts64_statusword = SHORT : 0\n\gis64_statusword = SHORT : 0\n\gts64_value = SHORT : 0\n\gis64_value = SHORT : 0\n\unused_15 = SHORT : 0\n\gts65_statusword = SHORT : 0\n\gis65_statusword = SHORT : 0\n\gts65_value = SHORT : 0\n\gis65_value = SHORT : 0\n\unused_16 = SHORT : 0\n\gts66_statusword = SHORT : 0\n\gis66_statusword = SHORT : 0\n\gts66_value = SHORT : 0\n\gis66_value = SHORT : 0\n\unused_17 = SHORT : 0\n\gts67_statusword = SHORT : 0\n\gis67_statusword = SHORT : 0\n\gts67_value = SHORT : 0\n\gis67_value = SHORT : 0\n\unused_18 = SHORT : 0\n\vsd60_statusword = SHORT[2] :\n\0\n\0\n\vsd60_cmdword = SHORT : 0\n\unused_19 = DWORD : 0\n\vsd61_statusword = SHORT[2] :\n\0\n\0\n\vsd61_cmdword = SHORT : 0\n\unused_20 = DWORD : 0\n\vsd62_statusword = SHORT[2] :\n\0\n\0\n\vsd62_cmdword = SHORT : 0\n\unused_21 = DWORD : 0\n\vsd63_statusword = SHORT[2] :\n\0\n\0\n\vsd63_cmdword = SHORT : 0\n\unused_22 = DWORD : 0\n\vsd64_statusword = SHORT[2] :\n\0\n\0\n\vsd64_cmdword = SHORT : 0\n\unused_23 = DWORD : 0\n\vsd65_statusword = SHORT[2] :\n\0\n\0\n\vsd65_cmdword = SHORT : 0\n\unused_24 = DWORD : 0\n\vsd66_statusword = SHORT[2] :\n\0\n\0\n\vsd66_cmdword = SHORT : 0\n\unused_25 = DWORD : 0\n\vsd67_statusword = SHORT[2] :\n\0\n\0\n\vsd67_cmdword = SHORT : 0\n\unused_26 = DWORD : 0\n\"
 

Functions

double sep61vac_pkr251 (int analog)
 
double sep61vac_pirani_tpr280 (int analog)
 
short sep61vac_spsToNumber (unsigned char *buffer)
 
int sep61vac_spsToWord (unsigned char *buffer)
 
INT sep61vac_decode_str (SEP61VAC_INFO *info, char *buffer)
 
void sep61vac_update_data (SEP61VAC_INFO *info)
 
INT sep61vac_init (HNDLE hKey, void **pinfo, INT channels, INT(*bd)(INT cmd,...))
 
INT sep61vac_exit (SEP61VAC_INFO *info)
 
void sep61vac_get_all (SEP61VAC_INFO *info)
 
INT sep61vac_get (SEP61VAC_INFO *info, INT channel, float *pvalue)
 
INT sep61vac_get_label (SEP61VAC_INFO *info, INT channel, char *name)
 
INT sep61vac (INT cmd,...)
 

Variables

SEP61VAC_INFOgInfo
 global info structure, in/out-init routines need the same structure More...
 

Macro Definition Documentation

#define SEP61VAC_DB50_STR   "\testnumber = SHORT : 0\n\teststring = CHAR[4] : \n\"" \n\telegramlength = SHORT : 0\n\generaltype = SHORT : 0\n\lifesign = SHORT : 0\n\res_12 = SHORT : 0\n\res_14 = SHORT : 0\n\res_16 = SHORT : 0\n\res_18 = SHORT : 0\n\no_of_objects = SHORT : 0\n\obj1 = CHAR[10] : \n\""\n\subtype1 = SHORT : 0\n\offset1 = SHORT : 0\n\obj2 = CHAR[10] : \n\""\n\subtype2 = SHORT : 0\n\offset2 = SHORT : 0\n\obj3 = CHAR[10] : \n\""\n\subtype3 = SHORT : 0\n\offset3 = SHORT : 0\n\obj4 = CHAR[10] : \n\""\n\subtype4 = SHORT : 0\n\offset4 = SHORT : 0\n\obj5 = CHAR[10] : \n\""\n\subtype5 = SHORT : 0\n\offset5 = SHORT : 0\n\obj6 = CHAR[10] : \n\""\n\subtype6 = SHORT : 0\n\offset6 = SHORT : 0\n\obj7 = CHAR[10] : \n\""\n\subtype7 = SHORT : 0\n\offset7 = SHORT : 0\n\obj8 = CHAR[10] : \n\""\n\subtype8 = SHORT : 0\n\offset8 = SHORT : 0\n\obj9 = CHAR[10] : \n\""\n\subtype9 = SHORT : 0\n\offset9 = SHORT : 0\n\obj10 = CHAR[10] : \n\""\n\subtype10 = SHORT : 0\n\offset10 = SHORT : 0\n\obj11 = CHAR[10] : \n\""\n\subtype11 = SHORT : 0\n\offset11 = SHORT : 0\n\obj12 = CHAR[10] : \n\""\n\subtype12 = SHORT : 0\n\offset12 = SHORT : 0\n\obj13 = CHAR[10] : \n\""\n\subtype13 = SHORT : 0\n\offset13 = SHORT : 0\n\obj14 = CHAR[10] : \n\""\n\subtype14 = SHORT : 0\n\offset14 = SHORT : 0\n\obj15 = CHAR[10] : \n\""\n\subtype15 = SHORT : 0\n\offset15 = SHORT : 0\n\obj16 = CHAR[10] : \n\""\n\subtype16 = SHORT : 0\n\offset16 = SHORT : 0\n\obj17 = CHAR[10] : \n\""\n\subtype17 = SHORT : 0\n\offset17 = SHORT : 0\n\obj18 = CHAR[10] : \n\""\n\subtype18 = SHORT : 0\n\offset18 = SHORT : 0\n\obj19 = CHAR[10] : \n\""\n\subtype19 = SHORT : 0\n\offset19 = SHORT : 0\n\obj20 = CHAR[10] : \n\""\n\subtype20 = SHORT : 0\n\offset20 = SHORT : 0\n\obj21 = CHAR[10] : \n\""\n\subtype21 = SHORT : 0\n\offset21 = SHORT : 0\n\obj22 = CHAR[10] : \n\""\n\subtype22 = SHORT : 0\n\offset22 = SHORT : 0\n\obj23 = CHAR[10] : \n\""\n\subtype23 = SHORT : 0\n\offset23 = SHORT : 0\n\obj24 = CHAR[10] : \n\""\n\subtype24 = SHORT : 0\n\offset24 = SHORT : 0\n\obj25 = CHAR[10] : \n\""\n\subtype25 = SHORT : 0\n\offset25 = SHORT : 0\n\unused_1 = CHAR[128] : \n\""\n\ps60_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps60_gp = SHORT : 0\n\ps60_aw2 = SHORT : 0\n\ps60_aw3 = SHORT : 0\n\ps60_aw4 = SHORT : 0\n\ps60_cmdword = SHORT : 0\n\unused_2 = SHORT : 0\n\ps61_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps61_gp = SHORT : 0\n\ps61_aw2 = SHORT : 0\n\ps61_aw3 = SHORT : 0\n\ps61_aw4 = SHORT : 0\n\ps61_cmdword = SHORT : 0\n\unused_3 = SHORT : 0\n\ps62_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps62_gp = SHORT : 0\n\ps62_aw2 = SHORT : 0\n\ps62_aw3 = SHORT : 0\n\ps62_aw4 = SHORT : 0\n\ps62_cmdword = SHORT : 0\n\unused_4 = SHORT : 0\n\ps63_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps63_gp = SHORT : 0\n\ps63_gfe = SHORT : 0\n\ps63_gfa = SHORT : 0\n\ps63_aw4 = SHORT : 0\n\ps63_cmdword = SHORT : 0\n\unused_5 = SHORT : 0\n\ps64_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps64_gp = SHORT : 0\n\ps64_aw2 = SHORT : 0\n\ps64_aw3 = SHORT : 0\n\ps64_aw4 = SHORT : 0\n\ps64_cmdword = SHORT : 0\n\unused_6 = SHORT : 0\n\ps65_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps65_gp = SHORT : 0\n\ps65_aw2 = SHORT : 0\n\ps65_aw3 = SHORT : 0\n\ps65_aw4 = SHORT : 0\n\ps65_cmdword = SHORT : 0\n\unused_7 = SHORT : 0\n\ps66_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps66_gp = SHORT : 0\n\ps66_aw2 = SHORT : 0\n\ps66_aw3 = SHORT : 0\n\ps66_aw4 = SHORT : 0\n\ps66_cmdword = SHORT : 0\n\unused_8 = SHORT : 0\n\ps67_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\ps67_gp = SHORT : 0\n\ps67_aw2 = SHORT : 0\n\ps67_aw3 = SHORT : 0\n\ps67_aw4 = SHORT : 0\n\ps67_cmdword = SHORT : 0\n\unused_9 = SHORT : 0\n\pz_statusword = SHORT[4] :\n\0\n\0\n\0\n\0\n\pz_gv1 = SHORT : 0\n\pz_gv2 = SHORT : 0\n\pz_aw3 = SHORT : 0\n\pz_aw4 = SHORT : 0\n\pz_cmdword = SHORT : 0\n\unused_10 = SHORT : 0\n\gts60_statusword = SHORT : 0\n\gis60_statusword = SHORT : 0\n\gts60_value = SHORT : 0\n\gis60_value = SHORT : 0\n\unused_11 = SHORT : 0\n\gts61_statusword = SHORT : 0\n\gis61_statusword = SHORT : 0\n\gts61_value = SHORT : 0\n\gis61_value = SHORT : 0\n\unused_12 = SHORT : 0\n\gts62_statusword = SHORT : 0\n\gis62_statusword = SHORT : 0\n\gts62_value = SHORT : 0\n\gis62_value = SHORT : 0\n\unused_13 = SHORT : 0\n\gts63_statusword = SHORT : 0\n\gis63_statusword = SHORT : 0\n\gts63_value = SHORT : 0\n\gis63_value = SHORT : 0\n\unused_14 = SHORT : 0\n\gts64_statusword = SHORT : 0\n\gis64_statusword = SHORT : 0\n\gts64_value = SHORT : 0\n\gis64_value = SHORT : 0\n\unused_15 = SHORT : 0\n\gts65_statusword = SHORT : 0\n\gis65_statusword = SHORT : 0\n\gts65_value = SHORT : 0\n\gis65_value = SHORT : 0\n\unused_16 = SHORT : 0\n\gts66_statusword = SHORT : 0\n\gis66_statusword = SHORT : 0\n\gts66_value = SHORT : 0\n\gis66_value = SHORT : 0\n\unused_17 = SHORT : 0\n\gts67_statusword = SHORT : 0\n\gis67_statusword = SHORT : 0\n\gts67_value = SHORT : 0\n\gis67_value = SHORT : 0\n\unused_18 = SHORT : 0\n\vsd60_statusword = SHORT[2] :\n\0\n\0\n\vsd60_cmdword = SHORT : 0\n\unused_19 = DWORD : 0\n\vsd61_statusword = SHORT[2] :\n\0\n\0\n\vsd61_cmdword = SHORT : 0\n\unused_20 = DWORD : 0\n\vsd62_statusword = SHORT[2] :\n\0\n\0\n\vsd62_cmdword = SHORT : 0\n\unused_21 = DWORD : 0\n\vsd63_statusword = SHORT[2] :\n\0\n\0\n\vsd63_cmdword = SHORT : 0\n\unused_22 = DWORD : 0\n\vsd64_statusword = SHORT[2] :\n\0\n\0\n\vsd64_cmdword = SHORT : 0\n\unused_23 = DWORD : 0\n\vsd65_statusword = SHORT[2] :\n\0\n\0\n\vsd65_cmdword = SHORT : 0\n\unused_24 = DWORD : 0\n\vsd66_statusword = SHORT[2] :\n\0\n\0\n\vsd66_cmdword = SHORT : 0\n\unused_25 = DWORD : 0\n\vsd67_statusword = SHORT[2] :\n\0\n\0\n\vsd67_cmdword = SHORT : 0\n\unused_26 = DWORD : 0\n\"

Definition at line 206 of file sep61vac.c.

Referenced by sep61vac_init().

#define SEP61VAC_INTERN_STR   "\Detailed Messages = INT : 0\n\"

Initializing string for the struct SEP61VAC_INTERN.

Definition at line 31 of file sep61vac.c.

Referenced by sep61vac_init().

#define SEP61VAC_NAMES_STR   "\Input Names = STRING[11] : \n\[32] SEP61VAC Life Sign\n\[32] SEP61VAC GP Pirani\n\[32] SEP61VAC GS63\n\[32] SEP61VAC GFE\n\[32] SEP61VAC GFA\n\[32] SEP61VAC Status Word 1\n\[32] SEP61VAC Status Word 2\n\[32] SEP61VAC VSDE Status Word\n\[32] SEP61VAC VSDA Status Word\n\[32] SEP61VAC GTS63 Status Word\n\[32] SEP61VAC GIS63 Status Word\n\"

Initializing string for the struct SEP61VAC_NAMES.

Definition at line 40 of file sep61vac.c.

Referenced by sep61vac_init().

#define SEP61VAC_READ_TIME_CONST   7

trigger time constant for read out of the SPS

Definition at line 19 of file sep61vac.c.

Referenced by sep61vac_get().

#define SEP61VAC_REQ_SIZE   16

SPS fetch/write request size.

Definition at line 21 of file sep61vac.c.

Referenced by sep61vac_get_all().

#define SEP61VAC_SPS_MAX_BYTES   840

number of bytes in the SPS protocol

Definition at line 22 of file sep61vac.c.

Referenced by sep61vac_decode_str(), and sep61vac_get_all().

#define SEP61VAC_SPS_MAX_OBJ   25

number of objects in the DB50

Definition at line 23 of file sep61vac.c.

Referenced by sep61vac_decode_str().

#define SEP61VAC_TIMEOUT_ERROR   3600

after what time (sec.) read errors should be reported

Definition at line 20 of file sep61vac.c.

Referenced by sep61vac_get_all().

Function Documentation

INT sep61vac ( INT  cmd,
  ... 
)

sep61 vacuum controller device driver (read routines) entry function. Establishes the communication with the SPS controll unit of the sep61 vacuum control (ps63) and reads the state of the pumps, valves, and the pressure values.

Definition at line 1216 of file sep61vac.c.

References hKey, info, sep61vac_exit(), sep61vac_get(), sep61vac_get_label(), and sep61vac_init().

INT sep61vac_decode_str ( SEP61VAC_INFO info,
char *  buffer 
)

decodes the buffer and fills the SEP61VAC data structre.

return: 0

Parameters
infopointer to DD info structure
bufferraw data as read from the tcp/ip interface

Definition at line 604 of file sep61vac.c.

References SEP61VAC_DB50::generaltype, SEP61VAC_DB50::gis60_statusword, SEP61VAC_DB50::gis60_value, SEP61VAC_DB50::gis61_statusword, SEP61VAC_DB50::gis61_value, SEP61VAC_DB50::gis62_statusword, SEP61VAC_DB50::gis62_value, SEP61VAC_DB50::gis63_statusword, SEP61VAC_DB50::gis63_value, SEP61VAC_DB50::gis64_statusword, SEP61VAC_DB50::gis64_value, SEP61VAC_DB50::gis65_statusword, SEP61VAC_DB50::gis65_value, SEP61VAC_DB50::gis66_statusword, SEP61VAC_DB50::gis66_value, SEP61VAC_DB50::gis67_statusword, SEP61VAC_DB50::gis67_value, SEP61VAC_DB50::gts60_statusword, SEP61VAC_DB50::gts60_value, SEP61VAC_DB50::gts61_statusword, SEP61VAC_DB50::gts61_value, SEP61VAC_DB50::gts62_statusword, SEP61VAC_DB50::gts62_value, SEP61VAC_DB50::gts63_statusword, SEP61VAC_DB50::gts63_value, SEP61VAC_DB50::gts64_statusword, SEP61VAC_DB50::gts64_value, SEP61VAC_DB50::gts65_statusword, SEP61VAC_DB50::gts65_value, SEP61VAC_DB50::gts66_statusword, SEP61VAC_DB50::gts66_value, SEP61VAC_DB50::gts67_statusword, SEP61VAC_DB50::gts67_value, SEP61VAC_DB50::label, SEP61VAC_DB50::lifesign, SEP61VAC_DB50::no_of_objects, SEP61VAC_Vac_Labels::obj, SEP61VAC_Vac_Labels::offset, SEP61VAC_DB50::ps60_aw2, SEP61VAC_DB50::ps60_aw3, SEP61VAC_DB50::ps60_aw4, SEP61VAC_DB50::ps60_cmdword, SEP61VAC_DB50::ps60_gp, SEP61VAC_DB50::ps60_statusword, SEP61VAC_DB50::ps61_aw2, SEP61VAC_DB50::ps61_aw3, SEP61VAC_DB50::ps61_aw4, SEP61VAC_DB50::ps61_cmdword, SEP61VAC_DB50::ps61_gp, SEP61VAC_DB50::ps61_statusword, SEP61VAC_DB50::ps62_aw2, SEP61VAC_DB50::ps62_aw3, SEP61VAC_DB50::ps62_aw4, SEP61VAC_DB50::ps62_cmdword, SEP61VAC_DB50::ps62_gp, SEP61VAC_DB50::ps62_statusword, SEP61VAC_DB50::ps63_aw4, SEP61VAC_DB50::ps63_cmdword, SEP61VAC_DB50::ps63_gfa, SEP61VAC_DB50::ps63_gfe, SEP61VAC_DB50::ps63_gp, SEP61VAC_DB50::ps63_statusword, SEP61VAC_DB50::ps64_aw2, SEP61VAC_DB50::ps64_aw3, SEP61VAC_DB50::ps64_aw4, SEP61VAC_DB50::ps64_cmdword, SEP61VAC_DB50::ps64_gp, SEP61VAC_DB50::ps64_statusword, SEP61VAC_DB50::ps65_aw2, SEP61VAC_DB50::ps65_aw3, SEP61VAC_DB50::ps65_aw4, SEP61VAC_DB50::ps65_cmdword, SEP61VAC_DB50::ps65_gp, SEP61VAC_DB50::ps65_statusword, SEP61VAC_DB50::ps66_aw2, SEP61VAC_DB50::ps66_aw3, SEP61VAC_DB50::ps66_aw4, SEP61VAC_DB50::ps66_cmdword, SEP61VAC_DB50::ps66_gp, SEP61VAC_DB50::ps66_statusword, SEP61VAC_DB50::ps67_aw2, SEP61VAC_DB50::ps67_aw3, SEP61VAC_DB50::ps67_aw4, SEP61VAC_DB50::ps67_cmdword, SEP61VAC_DB50::ps67_gp, SEP61VAC_DB50::ps67_statusword, SEP61VAC_DB50::psz_aw3, SEP61VAC_DB50::psz_aw4, SEP61VAC_DB50::psz_cmdword, SEP61VAC_DB50::psz_gv1, SEP61VAC_DB50::psz_gv2, SEP61VAC_DB50::psz_statusword, SEP61VAC_DB50::res_12, SEP61VAC_DB50::res_14, SEP61VAC_DB50::res_16, SEP61VAC_DB50::res_18, SEP61VAC_INFO::sep61vac_db50, SEP61VAC_SPS_MAX_BYTES, SEP61VAC_SPS_MAX_OBJ, sep61vac_spsToNumber(), sep61vac_spsToWord(), SEP61VAC_Vac_Labels::subtype, SEP61VAC_DB50::telegramlength, SEP61VAC_DB50::testnumber, SEP61VAC_DB50::teststring, SEP61VAC_DB50::unused_1, SEP61VAC_DB50::unused_10, SEP61VAC_DB50::unused_11, SEP61VAC_DB50::unused_12, SEP61VAC_DB50::unused_13, SEP61VAC_DB50::unused_14, SEP61VAC_DB50::unused_15, SEP61VAC_DB50::unused_16, SEP61VAC_DB50::unused_17, SEP61VAC_DB50::unused_18, SEP61VAC_DB50::unused_2, SEP61VAC_DB50::unused_3, SEP61VAC_DB50::unused_4, SEP61VAC_DB50::unused_5, SEP61VAC_DB50::unused_6, SEP61VAC_DB50::unused_7, SEP61VAC_DB50::unused_8, SEP61VAC_DB50::unused_9, SEP61VAC_DB50::vsd60_cmdword, SEP61VAC_DB50::vsd60_statusword, SEP61VAC_DB50::vsd61_cmdword, SEP61VAC_DB50::vsd61_statusword, SEP61VAC_DB50::vsd62_cmdword, SEP61VAC_DB50::vsd62_statusword, SEP61VAC_DB50::vsd63_cmdword, SEP61VAC_DB50::vsd63_statusword, SEP61VAC_DB50::vsd64_cmdword, SEP61VAC_DB50::vsd64_statusword, SEP61VAC_DB50::vsd65_cmdword, SEP61VAC_DB50::vsd65_statusword, SEP61VAC_DB50::vsd66_cmdword, SEP61VAC_DB50::vsd66_statusword, SEP61VAC_DB50::vsd67_cmdword, and SEP61VAC_DB50::vsd67_statusword.

Referenced by sep61vac_get_all().

INT sep61vac_exit ( SEP61VAC_INFO info)

close all the hotlinks and free's the memory allocated for the info structure

SEP61VAC_INFO

.

return: FE_SUCCESS

Parameters
infois a pointer to the DD specific info structure

Definition at line 1073 of file sep61vac.c.

References SEP61VAC_INFO::hDB, SEP61VAC_INFO::hKeyDB50, and SEP61VAC_INFO::hKeyDB50Buffer.

Referenced by sep61vac().

INT sep61vac_get ( SEP61VAC_INFO info,
INT  channel,
float *  pvalue 
)

reads the status of the Sep61Vac SPS vacuum control unit (PS63)

return: FE_SUCCESS

Parameters
infois a pointer to the DD specific info structure
channelto be read back
pvaluepointer to the ODB value

Definition at line 1177 of file sep61vac.c.

References SEP61VAC_INFO::read_timer, SEP61VAC_INFO::sep61vac_data, sep61vac_get_all(), and SEP61VAC_READ_TIME_CONST.

Referenced by sep61vac().

void sep61vac_get_all ( SEP61VAC_INFO info)

Establishes the communication to the SPS controll unit for reading, reads the data and stores them in the local structure

sep61vac_data

. The SPS is setup for the fetch protocol. Since the communication sometimes fails, an error protocol system is implemented as well. It records the errors over a period of 10 min. and records them (cm_msg).

Parameters
infois a pointer to the DD specific info structure

Definition at line 1094 of file sep61vac.c.

References SEP61VAC_INFO::bd, SEP61VAC_INFO::bd_info, SEP61VAC_INTERN::detailed_msg, SEP61VAC_INFO::errTime, SEP61VAC_INFO::hKeyDD, SEP61VAC_INFO::intern, SEP61VAC_INFO::read_counts, SEP61VAC_INFO::read_error, SEP61VAC_INFO::sep61vac_db50_buffer, sep61vac_decode_str(), SEP61VAC_REQ_SIZE, SEP61VAC_SPS_MAX_BYTES, SEP61VAC_TIMEOUT_ERROR, sep61vac_update_data(), and SEP61VAC_INFO::tcpip_open_error.

Referenced by sep61vac_get().

INT sep61vac_get_label ( SEP61VAC_INFO info,
INT  channel,
char *  name 
)

at startup, after initialization of the DD, this routine allows to write default names into the ODB.

return: FE_SUCCESS

Parameters
infois a pointer to the DD specific info structure
channelof the name to be set
namepointer to the ODB name

Definition at line 1209 of file sep61vac.c.

References SEP61VAC_NAMES::name, and SEP61VAC_INFO::sep61vac_names.

Referenced by sep61vac().

INT sep61vac_init ( HNDLE  hKey,
void **  pinfo,
INT  channels,
INT(*)(INT cmd,...)  bd 
)

Initializes the ps64 device driver for reading, i.e. generates all the necessary structures in the ODB if necessary, initializes the bus driver and the ps64.

return:

  • FE_SUCCESS if everthing is OK
  • FE_ERR_ODB if a severe error occured
Parameters
hKeyis the device driver handle given from the class driver
**pinfois needed to store the internal info structure
channelsis the number of channels of the device (from the class driver)
*bdis a pointer to the bus driver

Definition at line 973 of file sep61vac.c.

References SEP61VAC_INFO::bd, SEP61VAC_INFO::bd_info, gInfo, hDB, SEP61VAC_INFO::hDB, hKey, SEP61VAC_INFO::hKeyDB50, SEP61VAC_INFO::hKeyDB50Buffer, SEP61VAC_INFO::hKeyDD, SEP61VAC_INFO::intern, SEP61VAC_INFO::read_timer, SEP61VAC_INFO::sep61vac_db50, SEP61VAC_INFO::sep61vac_db50_buffer, SEP61VAC_DB50_STR, SEP61VAC_INTERN_STR, SEP61VAC_INFO::sep61vac_names, and SEP61VAC_NAMES_STR.

Referenced by sep61vac().

double sep61vac_pirani_tpr280 ( int  analog)

Conversion of the analog output (mV) of the Pirani TPR280 to real pressure in (mbar). The TPR280 has the same calibration curve as the TPR265!

return: pressure in (mbar)

Parameters
analogpressure in (mV)

Definition at line 549 of file sep61vac.c.

Referenced by sep61vac_update_data().

double sep61vac_pkr251 ( int  analog)

Conversion of the analog output (mV) of the all range pressure gauge PKR 251 to real pressure in (mbar).

return: pressure in (mbar)

Parameters
analogpressure in (mV)

Definition at line 535 of file sep61vac.c.

Referenced by sep61vac_update_data().

short sep61vac_spsToNumber ( unsigned char *  buffer)

This routine converts the 2 byte input to a integer number.

return: number

Parameters
bufferpointer to 2 bytes

Definition at line 562 of file sep61vac.c.

Referenced by sep61vac_decode_str().

int sep61vac_spsToWord ( unsigned char *  buffer)

This routine converts the 2 byte input to a word (16 bit).

return: number

Parameters
bufferpointer to 2 bytes

Definition at line 587 of file sep61vac.c.

Referenced by sep61vac_decode_str().

void sep61vac_update_data ( SEP61VAC_INFO info)

Local storage of all the data. Since the SPS Ethernet is rather slow, the device driver reads the status of all values at once and stores them locally. This way the ethernet communication rate can be cut down. The values of these variables are than transferred to the class driver.

Parameters
infois a pointer to the DD specific info structure

Definition at line 942 of file sep61vac.c.

References SEP61VAC_DB50::gis63_statusword, SEP61VAC_DB50::gis63_value, SEP61VAC_DB50::gts63_statusword, SEP61VAC_DB50::lifesign, SEP61VAC_DB50::ps63_gfa, SEP61VAC_DB50::ps63_gfe, SEP61VAC_DB50::ps63_gp, SEP61VAC_DB50::ps63_statusword, SEP61VAC_INFO::sep61vac_data, SEP61VAC_INFO::sep61vac_db50, sep61vac_pirani_tpr280(), sep61vac_pkr251(), SEP61VAC_DB50::vsd62_statusword, and SEP61VAC_DB50::vsd63_statusword.

Referenced by sep61vac_get_all().

Variable Documentation

SEP61VAC_INFO* gInfo

global info structure, in/out-init routines need the same structure

Definition at line 521 of file sep61vac.c.