Low-Energy Muon (LEM) Experiment  0.5.1
ps64.c
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------
2 
3  Name: ps64.c
4  Created by: Andreas Suter 2004/08/30
5  Rewritten by: Andreas Suter 2016/01/25 (new Siemens SPS communication modules)
6 
7  Contents: ps64 vacuum controller; ps64 is the pumping station of
8  the QSM610-612
9 
10 ----------------------------------------------------------------------------*/
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <stdarg.h>
16 #include <string.h>
17 #include <math.h>
18 #include "midas.h"
19 #include "ps64.h"
20 
21 // bits as encoded in the SPS words
22 #define LV_BIT0 0x0100
23 #define LV_BIT1 0x0200
24 #define LV_BIT2 0x0400
25 #define LV_BIT3 0x0800
26 #define LV_BIT4 0x1000
27 #define LV_BIT5 0x2000
28 #define LV_BIT6 0x4000
29 #define LV_BIT7 0x8000
30 #define LV_BIT8 0x0001
31 #define LV_BIT9 0x0002
32 #define LV_BIT10 0x0004
33 #define LV_BIT11 0x0008
34 #define LV_BIT12 0x0010
35 #define LV_BIT13 0x0020
36 #define LV_BIT14 0x0040
37 #define LV_BIT15 0x0080
38 
39 // channels of the SPS input variables
40 #define PS64_LIFESIGN 0
41 #define PS64_GP 1
42 #define PS64_GS64 2
43 #define PS64_SW1 3
44 #define PS64_SW2 4
45 
46 #define SPS_MAX_BYTES 680
47 #define PS64_TIME_CONST 0
48 #define PS64_TIMEOUT_ERROR 3600
49 
50 typedef struct {
53 } PS64_INTERN;
54 
56 #define LAMVAC_INTERN_STR "\
57 Detailed Messages = INT : 0\n\
58 "
59 
61 typedef struct {
62 char in_name[PS64_IN_VARS][NAME_LENGTH];
63 char out_name[NAME_LENGTH];
64 } PS64_NAMES;
65 
67 #define PS64_NAMES_STR "\
68 Input Names = STRING[5] : \n\
69 [32] PS64 Life Sign\n\
70 [32] PS64 GP Pirani\n\
71 [32] PS64 GS64\n\
72 [32] PS64 Status Word 1\n\
73 [32] PS64 Status Word 2\n\
74 Output Names = STRING : [32] PS64 Cmd\n\
75 "
76 
78 typedef struct {
81  char ps64_buffer[SPS_MAX_BYTES];
82  int ps64_diag[6];
83  float ps64_data[PS64_IN_VARS];
84  INT (*bd)(INT cmd, ...);
85  void *bd_info;
86  HNDLE hDB;
87  HNDLE hKey_in;
88  HNDLE hKey_out;
90  DWORD time;
91  DWORD errTime;
94  INT read_error;
96  DWORD last_success;
97 } PS64_INFO;
98 
100 
101 // ps64_sc_vent_state keeps the current state of the sample chamber. It is
102 // encoded the following way:
103 // XXX0 : HV on (HV's in the sample chamber)
104 // XXX1 : HV off
105 // XX0X : T<90K (CF1 of the sample cryo)
106 // XX1X : T>=90K
107 // X0XX : BPVY open
108 // X1XX : BPVY closed
109 // 0XXX : sample chamber pumping station is off
110 // 1XXX : sample chamber pumping station is on
111 //
112 // this means ps64_sc_vent_state = 15 (1111 binary) is needed that the sample chamber can be vented.
114 
115 //----------------------------------------------------------------------------
123 short spsToNumber(unsigned char *buffer)
124 {
125  int val = 0;
126 
127  if (buffer[0] & 0x80)
128  val = (buffer[0] &0x7f) << 8;
129  else
130  val = buffer[0] << 8;
131 
132  if (buffer[1] & 0x80) // sign bit set
133  val += (buffer[1] &0x7f) + 128;
134  else
135  val += buffer[1];
136 
137  return val;
138 }
139 
140 //----------------------------------------------------------------------------
148 int spsToWord(unsigned char *buffer)
149 {
150  short val = buffer[0];
151  val = val << 8;
152  val += buffer[1];
153  return val;
154 }
155 
156 /*----------------------------------------------------------------------------*/
166 double ps64_pkr251(int analog)
167 {
168  return pow(10.0, 1.667 * (double)analog/100.0 - 11.33);
169 }
170 
171 /*----------------------------------------------------------------------------*/
180 double ps64_pirani_tpr280(int analog)
181 {
182  return pow(10.0, (double)analog/100.0 - 5.5);
183 }
184 
185 
186 //----------------------------------------------------------------------------
196 BOOL ps64_decode_data(PS64_INFO *info, const char *buffer)
197 {
198 //int value;
199 static int count=0;
200 
201  if ((buffer[4] != 65) || (buffer[5] != 66)) // check if buffer has the right 'AB' signature
202  return FALSE;
203 
204  info->ps64_data[PS64_LIFESIGN] = spsToNumber((unsigned char*)&buffer[10]); // lifesign counter
205  info->ps64_data[PS64_GP] = ps64_pirani_tpr280(spsToNumber((unsigned char*)&buffer[368])); // PS64 Pirani
206  info->ps64_data[PS64_GS64] = ps64_pkr251(spsToNumber((unsigned char*)&buffer[372])); // PS64 Penning
207  info->ps64_data[PS64_SW1] = spsToWord((unsigned char*)&buffer[360]); // PS64 Status Word 1
208  info->ps64_data[PS64_SW2] = spsToWord((unsigned char*)&buffer[362]); // PS64 Status Word 2
209 
210 // temporarily decode status words
211  if (count++ == 50) {
212  count = 0;
213 /*
214  value = (int)info->ps64_data[PS64_SW1];
215  if ((value & LV_BIT0) && (value & LV_BIT3)) // pump on and running > 80%
216  cm_msg(MDEBUG, "ps64_decode_data", "Turbo On");
217  else if (value & LV_BIT1) // pump off
218  cm_msg(MDEBUG, "ps64_decode_data", "Turbo Off");
219  else if (value & LV_BIT2) // running high
220  cm_msg(MDEBUG, "ps64_decode_data", "Turbo Running High");
221  else if (!(value & LV_BIT2) && (value & LV_BIT0) && !(value & LV_BIT3))
222  cm_msg(MDEBUG, "ps64_decode_data", "Turbo On but <80%%");
223  if ((value & LV_BIT11) && !(value & LV_BIT12))
224  cm_msg(MDEBUG, "ps64_decode_data", "Prepump On");
225  else if (!(value & LV_BIT11) && (value & LV_BIT12))
226  cm_msg(MDEBUG, "ps64_decode_data", "Prepump Off");
227 
228  value = (int)info->ps64_data[PS64_SW2];
229  if (value & LV_BIT0) { // pump station manually off
230  cm_msg(MDEBUG, "ps64_decode_data", "PS64 pump station manually off!");
231  } else if (value & LV_BIT3)
232  cm_msg(MDEBUG, "ps64_decode_data", "PS64 TCP turbo controller error!");
233  else if (value & LV_BIT4) {
234  cm_msg(MDEBUG, "ps64_decode_data", "PS64 turbo pump error!");
235  }
236 */
237  }
238 
239  return TRUE;
240 }
241 
242 //----------------------------------------------------------------------------
252 {
253  INT status;
254  char data[SPS_MAX_BYTES];
255  DWORD now;
256 
257  float delta = ss_time()-info->time;
258  // check timer, if smaller then time constant do nothing
259  if (delta < PS64_TIME_CONST)
260  return;
261 
262  // communication error report handling
263  delta = ss_time()-info->errTime;
264  if (delta > PS64_TIMEOUT_ERROR) {
265  if ((info->tcpip_open_error != 0) || (info->read_error != 0)) {
266  if (info->intern.detailed_msg) {
267  cm_msg(MINFO, "ps64_get_all",
268  "ps64_get_all: No of tcpip open errors = %d, tcpip read errors =%d of %d readings in the last %d secs.",
270  cm_yield(0);
271  }
272  // reset error counters
273  info->tcpip_open_error = 0;
274  info->read_error = 0;
275  info->read_counts = 0;
276  // restart timer
277  info->errTime = ss_time();
278  }
279  }
280 
281  // get data
282  status = info->bd(CMD_READ, info->bd_info, &data[0], sizeof(data), 3000); // read data
283  if (info->intern.detailed_msg) {
284  cm_msg(MDEBUG, "ps64_get_all", "ps64_get_all: get data (status=%d)", status);
285  cm_yield(0);
286  }
287  if (status == SPS_MAX_BYTES) {
288  memcpy(info->ps64_buffer, data, SPS_MAX_BYTES);
289  // feed readback diagnostic array
290  now = ss_time();
291  if (info->last_success == 0) {
292  info->last_success = now;
293  } else {
294  //as THE FOLLOWING DIAGNOSTIC PART SHOULD BE REMOVED WHEN TESTING HAS FINISHED.
295  if (now - info->last_success <= 1.0)
296  info->ps64_diag[0]++;
297  else if (now - info->last_success <= 2.0)
298  info->ps64_diag[1]++;
299  else if (now - info->last_success <= 3.0)
300  info->ps64_diag[2]++;
301  else if (now - info->last_success <= 5.0)
302  info->ps64_diag[3]++;
303  else
304  info->ps64_diag[4]++;
305  info->last_success = now;
306  }
307  } else {
308  if (info->intern.detailed_msg) {
309  cm_msg(MINFO, "ps64_get_all", "ps64_get_all: get.data.status=%d", status);
310  cm_yield(0);
311  }
312  info->read_counts++;
313  info->ps64_diag[5]++;
314  }
315 
316  // check for errors
317  // (error byte set) or (haven't gotten all the data)
318  if (status != SPS_MAX_BYTES) {
319  info->read_error++;
320  return;
321  } else {
322  info->read_counts = 0;
323  if (!ps64_decode_data(info, data)) {
324  info->read_error++;
325  }
326  }
327 
328  info->time = ss_time(); // restart timer
329 }
330 
331 //----------------------------------------------------------------------------
338 {
339  int status;
340 
341  info->tcpip_open_error = 0;
342 
343  // write stuff
344  status = info->bd(CMD_WRITE, info->bd_info, &info->ps64_buffer[0], sizeof(info->ps64_buffer)); // write data
345  if (info->intern.detailed_msg) {
346  cm_msg(MDEBUG, "ps64_write_cmd", "ps64_write_cmd: write data (status=%d)", status);
347  cm_yield(0);
348  }
349 }
350 
351 /*---- device driver routines ------------------------------------------------*/
352 
353 /*----------------------------------------------------------------------------*/
367 INT ps64_in_init(HNDLE hKey, void **pinfo, INT channels, INT (*bd)(INT cmd, ...))
368 {
369  INT status, size, i;
370  char str[512];
371  HNDLE hDB, hkeydd;
372 
373  // allocate info structure
374  gInfo = (PS64_INFO *)calloc(1, sizeof(PS64_INFO));
375  *pinfo = gInfo;
376 
377  // get ODB handle
378  cm_get_experiment_database(&hDB, NULL);
379  // store handles (ODB and DD key) in local structure to keep it for latter use
380  gInfo->hDB = hDB;
381  gInfo->hKey_in = hKey;
382 
383  // create ps64 DD intern structure if not already exists
384  status = db_find_key(hDB, hKey, "DD/intern", &hkeydd);
385  if (status != DB_SUCCESS) { // key doesn't exist yet
386  // create ps64 DD intern
387  status = db_create_record(hDB, hKey, "DD/intern", LAMVAC_INTERN_STR);
388  if ((status != DB_SUCCESS) && (status != DB_OPEN_RECORD)) {
389  cm_msg(MERROR, "ps64_init", "ps64_init: Error creating ps64 intern record in ODB, status=%d", status);
390  cm_yield(0);
391  return FE_ERR_ODB;
392  }
393  }
394  db_find_key(hDB, hKey, "DD/intern", &hkeydd);
395  size = sizeof(gInfo->intern);
396  status = db_get_record(hDB, hkeydd, &gInfo->intern, &size, 0);
397  // open hotlink
398  status = db_open_record(hDB, hkeydd, &gInfo->intern, size, MODE_READ, NULL, NULL);
399 
400  // create ps64 DD names record
401  status = db_create_record(hDB, hKey, "DD/Names", PS64_NAMES_STR);
402  if ((status != DB_SUCCESS) && (status != DB_OPEN_RECORD)) {
403  cm_msg(MERROR, "ps64_init", "ps64_init: Error creating ps64 Names record in ODB, status=%d", status);
404  cm_yield(0);
405  return FE_ERR_ODB;
406  }
407  db_find_key(hDB, hKey, "DD/Names", &hkeydd);
408  size = sizeof(gInfo->ps64_names);
409  db_get_record(hDB, hkeydd, &gInfo->ps64_names, &size, 0);
410 
411 
412  // check if ps64 DD SPS-DB buffer record already exists
413  status = db_find_key(hDB, hKey, "DD/DB_Buffer", &hkeydd);
414  if (status != DB_SUCCESS) { // key doesn't exist yet
415  // create ps64 DD DB buffer
416  strcpy(str, "DB_Buffer = BYTE[680] : \n");
417  for (i=0; i<SPS_MAX_BYTES; i++)
418  strcat(str, " \n");
419  status = db_create_record(hDB, hKey, "DD/DB_Buffer", str);
420  if ((status != DB_SUCCESS) && (status != DB_OPEN_RECORD)) {
421  cm_msg(MERROR, "ps64_init", "ps64_init: Error creating ps64 DB_Buffer record in ODB, status=%d", status);
422  cm_yield(0);
423  return FE_ERR_ODB;
424  }
425  }
426 
427  db_find_key(hDB, hKey, "DD/DB_Buffer", &hkeydd);
428  size = sizeof(gInfo->ps64_buffer);
429  status = db_get_record(hDB, hkeydd, &gInfo->ps64_buffer, &size, 0);
430  // open hotlink
431  status = db_open_record(hDB, hkeydd, &gInfo->ps64_buffer, size, MODE_WRITE, NULL, NULL);
432  gInfo->hKey_DB_Buffer = hkeydd;
433 
434  // initialize driver
435  gInfo->bd = bd; // keep the bus driver entry function
436  gInfo->bd_info = 0; // initialize the pointer to the BD info structure
437  gInfo->time = ss_time(); // timer for error handling
438  gInfo->errTime = ss_time(); // timer for error handling
439  gInfo->read_error = 0; // read error counter
440  gInfo->tcpip_open_error = 0; // open tcpip error counter
441  gInfo->read_counts = 0; // counter how often tcpip reading has benn attempt
442  gInfo->last_success = 0;
443 
444  // open tcpip connection
445  status = gInfo->bd(CMD_INIT, gInfo->hKey_in, &gInfo->bd_info);
446  if (gInfo->intern.detailed_msg) {
447  cm_msg(MDEBUG, "ps64_init", "ps64_init: open tcpip connection (status=%d)", status);
448  cm_yield(0);
449  }
450  if (status != SUCCESS) {
451  gInfo->tcpip_open_error++;
452  if (gInfo->intern.detailed_msg) {
453  cm_msg(MINFO, "ps64_init", "ps64_init: open bounced off");
454  cm_yield(0);
455  }
456  return FE_ERR_DRIVER;
457  }
458 
459  // initialize ps64 status message
460  cm_msg(MINFO, "ps64_init", "ps64 initialized ...");
461  cm_yield(0);
462 
463  return FE_SUCCESS;
464 }
465 
466 /*----------------------------------------------------------------------------*/
478 INT ps64_out_init(HNDLE hKey, void **pinfo, INT channels, INT (*bd)(INT cmd, ...))
479 {
480  *pinfo = gInfo; // since gInfo has been allocated in lemvac_in_init, it is enough to pass the pointer
481 
482  // initialize driver
483  gInfo->hKey_out = hKey; // keep the DD entry key
484 
485  return FE_SUCCESS;
486 }
487 
488 /*----------------------------------------------------------------------------*/
498 {
499  // close all hotlinks
500  db_close_record(info->hDB, info->hKey_DB_Buffer);
501 
502  // close connection
503  info->bd(CMD_EXIT, info->bd_info);
504 
505  free(info);
506  return FE_SUCCESS;
507 }
508 
509 //----------------------------------------------------------------------------
520 INT ps64_in_get_label(PS64_INFO *info, INT channel, char *name)
521 {
522  strcpy(name, info->ps64_names.in_name[channel]);
523  return FE_SUCCESS;
524 }
525 
526 //----------------------------------------------------------------------------
537 INT ps64_out_get_label(PS64_INFO *info, INT channel, char *name)
538 {
539  strcpy(name, info->ps64_names.out_name);
540  return FE_SUCCESS;
541 }
542 
543 //-----------------------------------------------------------------------------
553 INT ps64_get(PS64_INFO *info, INT channel, float *pvalue)
554 {
555  if (info->intern.detailed_msg > 1) {
556  cm_msg(MDEBUG, "ps64_get", "in ps64_get ...");
557  cm_yield(0);
558  }
559 
560  if (channel % PS64_IN_VARS == 0) { // only read if channel is 0 since all data are read at once
561  if (info->intern.detailed_msg) {
562  cm_msg(MDEBUG, "ps64_get", "in ps64_get and will call ps64_get_all(info)");
563  cm_yield(0);
564  }
565  ps64_get_all(info);
566  }
567 
568  *pvalue = info->ps64_data[channel];
569 
570  ss_sleep(10);
571  return FE_SUCCESS;
572 }
573 
575 {
576  cm_msg(MDEBUG, "ps64_start_pump", "ps64_start_pump: will start pump ...");
577  cm_yield(0);
578 
579  info->ps64_buffer[376] = (char)1; // PS_On command
580  ps64_write_cmd(info);
581 }
582 
584 {
585  cm_msg(MDEBUG, "ps64_stop_pump", "ps64_stop_pump: will stop pump ...");
586  cm_yield(0);
587 
588  info->ps64_buffer[376] = (char)2; // PS_Off command
589  ps64_write_cmd(info);
590 }
591 
592 
593 INT ps64_set(PS64_INFO *info, INT channel, float value)
594 {
595  HNDLE hKey;
596  int size;
597  float fval;
598 
599  if (value == 0)
600  return FE_SUCCESS;
601 
602  if (value == 1)
603  ps64_start_pump(info);
604  else if (value == 2)
605  ps64_stop_pump(info);
606 
607  // reset cmd tag, i.e. set it to idle
608  db_find_key(info->hDB, 0, "/Equipment/Ps64Vac/Variables/Output", &hKey);
609  size = sizeof(float);
610  fval = 0.0;
611  db_set_data_index(info->hDB, hKey, &fval, size, 0, TID_FLOAT);
612 
613  return FE_SUCCESS;
614 }
615 
616 //---- device driver entry point -----------------------------------
617 INT ps64_in(INT cmd, ...)
618 {
619 va_list argptr;
620 HNDLE hKey;
621 INT channel, status;
622 float *pvalue;
623 void *info, *bd;
624 char *name;
625 DWORD flags;
626 
627  va_start(argptr, cmd);
628  status = FE_SUCCESS;
629 
630  switch (cmd) {
631  case CMD_INIT:
632  hKey = va_arg(argptr, HNDLE);
633  info = va_arg(argptr, void *);
634  channel = va_arg(argptr, INT);
635  flags = va_arg(argptr, DWORD);
636  bd = va_arg(argptr, void *);
637  status = ps64_in_init(hKey, info, channel, bd);
638  break;
639 
640  case CMD_EXIT:
641  info = va_arg(argptr, void *);
642  status = ps64_exit(info);
643  break;
644 
645  case CMD_GET:
646  info = va_arg(argptr, void *);
647  channel = va_arg(argptr, INT);
648  pvalue = va_arg(argptr, float*);
649  status = ps64_get(info, channel, pvalue);
650  break;
651 
652  case CMD_GET_LABEL:
653  info = va_arg(argptr, void *);
654  channel = va_arg(argptr, INT);
655  name = va_arg(argptr, char *);
656  status = ps64_in_get_label(info, channel, name);
657  break;
658 
659  default:
660  break;
661  }
662 
663  va_end(argptr);
664 
665  return status;
666 }
667 
668 INT ps64_out(INT cmd, ...)
669 {
670 va_list argptr;
671 HNDLE hKey;
672 INT channel, status;
673 float value;
674 void *info, *bd;
675 char *name;
676 DWORD flags;
677 
678  va_start(argptr, cmd);
679  status = FE_SUCCESS;
680 
681  switch (cmd) {
682  case CMD_INIT:
683  hKey = va_arg(argptr, HNDLE);
684  info = va_arg(argptr, void *);
685  channel = va_arg(argptr, INT);
686  flags = va_arg(argptr, DWORD);
687  bd = va_arg(argptr, void *);
688  status = ps64_out_init(hKey, info, channel, bd);
689  break;
690 
691  case CMD_SET:
692  info = va_arg(argptr, void *);
693  channel = va_arg(argptr, INT);
694  value = (float) va_arg(argptr, double);
695  status = ps64_set(info, channel, value);
696  break;
697 
698  case CMD_GET_LABEL:
699  info = va_arg(argptr, void *);
700  channel = va_arg(argptr, INT);
701  name = va_arg(argptr, char *);
702  status = ps64_out_get_label(info, channel, name);
703  break;
704 
705  default:
706  break;
707  }
708 
709  va_end(argptr);
710 
711  return status;
712 }
713 //---- end --------------------------------------------------------------
INT detailed_msg
flag indicating if detailed status/error messages are wanted
Definition: ps64.c:52
Stores DD specific internal information.
Definition: ps64.c:51
INT read_counts
total no of tcpip reading attempts
Definition: ps64.c:95
INT ps64_out(INT cmd,...)
Definition: ps64.c:668
INT ps64_set(PS64_INFO *info, INT channel, float value)
Definition: ps64.c:593
INFO info
Definition: vme_fe.c:206
DWORD last_success
timer of last read success
Definition: ps64.c:96
INT ps64_out_get_label(PS64_INFO *info, INT channel, char *name)
Definition: ps64.c:537
INT ps64_get(PS64_INFO *info, INT channel, float *pvalue)
Definition: ps64.c:553
INT ps64_in_init(HNDLE hKey, void **pinfo, INT channels, INT(*bd)(INT cmd,...))
Definition: ps64.c:367
void ps64_start_pump(PS64_INFO *info)
Definition: ps64.c:574
Stores the names of the various channels which are than transferred form the DD to the variable names...
Definition: ps64.c:61
HNDLE hDB
main ODB handle
Definition: ps64.c:86
INT ps64_in(INT cmd,...)
Definition: ps64.c:617
void * bd_info
pointer to the BD info structure of the input channels
Definition: ps64.c:85
void ps64_get_all(PS64_INFO *info)
Definition: ps64.c:251
#define SPS_MAX_BYTES
length of the data structure exchanged between SPS and midas
Definition: ps64.c:46
#define PS64_SW2
Definition: ps64.c:44
INT read_error
how often there has been a read error
Definition: ps64.c:94
DWORD errTime
timer for error handling concerning tcpip communication
Definition: ps64.c:91
INT tcpip_open_error
how often the attempt to open the tcpip communication failed
Definition: ps64.c:93
HNDLE hKey_in
main device driver handle for input channels
Definition: ps64.c:87
HNDLE hKey
Definition: write_summary.c:97
#define PS64_SW1
Definition: ps64.c:43
#define PS64_GP
Definition: ps64.c:41
#define PS64_LIFESIGN
Definition: ps64.c:40
LEMVAC_INFO * gInfo
global info structure, in/out-init routines need the same structure
Definition: lemvac.c:200
#define PS64_TIMEOUT_ERROR
after what time (sec.) read errors should be reported
Definition: ps64.c:48
HNDLE hDB
Definition: write_summary.c:97
int spsToWord(unsigned char *buffer)
Definition: lemvac.c:419
#define PS64_NAMES_STR
Initializing string for the struct PS64_NAMES.
Definition: ps64.c:67
#define PS64_IN_VARS
number of variables in the get list
Definition: ps64.h:10
double ps64_pirani_tpr280(int analog)
Definition: ps64.c:180
void ps64_write_cmd(PS64_INFO *info)
Definition: ps64.c:337
INT ps64_out_init(HNDLE hKey, void **pinfo, INT channels, INT(*bd)(INT cmd,...))
Definition: ps64.c:478
INT startup_error
tag if there has been an error at startup
Definition: ps64.c:92
float ps64_data[PS64_IN_VARS]
stores decoded values from SPS-DB
Definition: ps64.c:83
DWORD time
trigger timer
Definition: ps64.c:90
HNDLE hKey_out
main device driver handle for input channels
Definition: ps64.c:88
INT ps64_sc_vent_state
Definition: ps64.c:113
short spsToNumber(unsigned char *buffer)
Definition: lemvac.c:394
char ps64_buffer[SPS_MAX_BYTES]
SPS-DB byte buffer.
Definition: ps64.c:81
INT ps64_exit(PS64_INFO *info)
Definition: ps64.c:497
HNDLE hKey_DB_Buffer
handle to the raw SPS-DB data
Definition: ps64.c:89
double ps64_pkr251(int analog)
Definition: ps64.c:166
PS64_NAMES ps64_names
stores the internal DD settings
Definition: ps64.c:80
int ps64_diag[6]
SPS diagnostics readback array (&lt;1, &lt;2, &lt;3, &lt;5, &gt;5, failed)sec.
Definition: ps64.c:82
PS64_INTERN intern
stores DD specific internal settings
Definition: ps64.c:79
char out_name[NAME_LENGTH]
Definition: ps64.c:63
#define PS64_TIME_CONST
trigger time constant for read out of the SPS
Definition: ps64.c:47
char in_name[PS64_IN_VARS][NAME_LENGTH]
Names of the input variable names as found in the ODB.
Definition: ps64.c:62
#define PS64_GS64
Definition: ps64.c:42
This structure contains private variables for the device driver.
Definition: ps64.c:78
INT ps64_in_get_label(PS64_INFO *info, INT channel, char *name)
Definition: ps64.c:520
INT(* bd)(INT cmd,...)
bus driver entry function for reading
Definition: ps64.c:84
#define LAMVAC_INTERN_STR
Initializing string for the struct PS64_INTERN.
Definition: ps64.c:56
void ps64_stop_pump(PS64_INFO *info)
Definition: ps64.c:583
BOOL ps64_decode_data(PS64_INFO *info, const char *buffer)
Definition: ps64.c:196