Low-Energy Muon (LEM) Experiment
0.5.1
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include "midas.h"
#include "msystem.h"
#include "LakeShore340.h"
#include "ets_logout.h"
#include "lemSCWatchdog.h"
Go to the source code of this file.
Data Structures | |
struct | LS340_SENSORS |
stores internal informations within the DD. More... | |
struct | LS340_LOOP1 |
stores internal informations within the DD. More... | |
struct | LS340_INTERNAL |
stores internal informations within the DD. More... | |
struct | LS340_SETTINGS |
stores internal informations within the DD. More... | |
struct | LS340_ODB_NAMES |
stores internal informations within the DD. More... | |
struct | LS340_INFO |
Macros | |
#define | LS340_SHUTDOWN -999 |
#define | LS340_MAX_SENSORS 10 |
max. number of possible input sensors More... | |
#define | LS340_DELTA_R 2.0 |
max. allowed deviation between ODB heater resistance and LS340 readback More... | |
#define | LS340_TIME_OUT 2000 |
time out in msecs for read (rs232) More... | |
#define | LS340_MAX_ERROR 3 |
maximum number of error messages More... | |
#define | LS340_DELTA_TIME_ERROR 3600 |
reset error counter after LS340_DELTA_TIME_ERROR seconds More... | |
#define | LS340_MAX_TRY_MANY 10 |
maximum number of communication attempts for important reads More... | |
#define | LS340_MAX_TRY_LESS 3 |
maximum number of communication attempts for less important reads More... | |
#define | LS340_WAIT 500 |
time (ms) to wait between commands More... | |
#define | LS340_INIT_ERROR -2 |
initialize error tag More... | |
#define | LS340_READ_ERROR -1 |
read error tag More... | |
#define | LS340_MAX_AVG 100 |
max. length of the average array More... | |
#define | LS340_DEBUG 0 |
debug tag, if set to TRUE, additional messages will be displayed at execution time More... | |
#define | LS340_MAX_READBACK_FAILURE 5 |
maximum number of readback failures before a reconnect will take place More... | |
#define | LS340_MAX_RECONNECTION_FAILURE 5 |
#define | LS340_ETS_LOGOUT_SLEEP 10000 |
sleep time (us) between the telnet commands of the ets_logout More... | |
#define | LS340_SENSORS_STR "\Date and Time = STRING : [32] \n\Sensor Type = INT[10]: \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\Calibration Curve = INT[10]: \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\Channel = STRING[10]: \n\[4] A\n\[4] B\n\[4] C1\n\[4] C2\n\[4] C3\n\[4] C4\n\[4] D1\n\[4] D2\n\[4] D3\n\[4] D4\n\Sensor Name = STRING[10]: \n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\Raw Input Ch 1 = FLOAT : 0.0\n\Raw Input Ch 2 = FLOAT : 0.0\n\Raw Input Ch 3 = FLOAT : 0.0\n\Raw Input Ch 4 = FLOAT : 0.0\n\Raw Input Ch 5 = FLOAT : 0.0\n\Raw Input Ch 6 = FLOAT : 0.0\n\Raw Input Ch 7 = FLOAT : 0.0\n\Raw Input Ch 8 = FLOAT : 0.0\n\Raw Input Ch 9 = FLOAT : 0.0\n\Raw Input Ch 10 = FLOAT : 0.0\n\" |
initializing string for LS340_SENSORS More... | |
#define | LS340_LOOP1_STR "\CTRL_CH = STRING : [4] A\n\SetPoint Limit = FLOAT : 350.f\n\Max. Current Tag = INT : 4\n\Max. User Current = FLOAT : 0.85\n\Max. Heater Range = INT : 5\n\Heater Resistance = FLOAT : 25.0\n\" |
initializing string for LS340_LOOP1 More... | |
#define | LS340_INTERNAL_STR "\Detailed Messages = INT : 0\n\ETS_IN_USE = INT : 1\n\SCW_IN_USE = INT : 0\n\No Connection = INT : 1\n\Reconnection Timeout = INT : 10\n\Read Timeout = INT : 5\n\Read Raw Data = BOOL : FALSE\n\ODB Offset = INT : 0\n\ODB Output Path = STRING : [64] /Equipment/LS340 Moddy/Variables/Output\n\Remote = INT : 1\n\# Sensors = INT : 7\n\" |
initializing string for LS340_INTERNAL More... | |
#define | LS340_ZONE_STR "\Zone = STRING[10]: \n\[32] 1, 1, 7, 500, 300, 0, 0, 3\n\[32] 1, 2, 10, 500, 200, 2, 0, 4\n\[32] 1, 3, 15, 500, 100, 2, 0, 4\n\[32] 1, 4, 20, 500, 50, 2, 0, 4\n\[32] 1, 5, 30, 500, 20, 2, 0, 4\n\[32] 1, 6, 320, 500, 20, 2, 0, 5\n\[32] 1, 7, 320, 500, 20, 2, 0, 5\n\[32] 1, 8, 320, 500, 20, 2, 0, 5\n\[32] 1, 9, 320, 500, 20, 2, 0, 5\n\[32] 1, 10, 320, 500, 20, 2, 0, 5\n\" |
#define | LS340_ODB_NAMES_STR "\LakeShore 340 Name = STRING : [32] Moderator\n\Names In = STRING[8] : \n\[32] LS_Heater\n\[32] LS_SetPoint (read back)\n\[32] LS_Gain P (read back)\n\[32] LS_Reset I (read back)\n\[32] LS_Rate D (read back)\n\[32] LS_HeaterRange (read back)\n\[32] LS_ControlMode (read back)\n\[32] LS_Ramp (read back)\n\Names Out = STRING[8] : \n\[32] LS_Remote (1/0)\n\[32] LS_SetPoint (K)\n\[32] LS_Gain P\n\[32] LS_Reset I\n\[32] LS_Rate D\n\[32] LS_HeaterRange\n\[32] LS_ControlMode\n\[32] LS_Ramp\n\" |
initializing string for LS340_ODB_NAMES More... | |
#define | LS340_SCW_STR "\Proc Name = STRING : [32]\n\PID = INT : -1\n\Log Name = STRING : [64]\n\DD Name = STRING : [32]\n\Last Updated = DWORD : 0\n\Timeout = DWORD : 180\n\" |
defines the slowcontrol default watchdog info structure More... | |
Functions | |
INT | ls340_send_rcv (LS340_INFO *info, char *cmd, char *str, int max_try) |
INT | ls340_get_decode (LS340_INFO *info, INT ch, int *sub_tag) |
INT | ls340_force_update (LS340_INFO *info) |
void | ls340_no_connection (LS340_INFO *info, INT value) |
void | ls340_cryo_name_changed (HNDLE hDB, HNDLE dummy, void *pinfo) |
INT | ls340_in_init (HNDLE hKey, void **pinfo, INT channels, INT(*bd)(INT cmd,...)) |
INT | ls340_out_init (HNDLE hKey, void **pinfo, INT channels, INT(*bd)(INT cmd,...)) |
INT | ls340_exit (LS340_INFO *info) |
INT | ls340_set (LS340_INFO *info, INT channel, float value) |
void | ls340_check_heater (LS340_INFO *info) |
INT | ls340_get (LS340_INFO *info, INT channel, float *pvalue) |
INT | ls340_in_get_label (LS340_INFO *info, INT channel, char *name) |
INT | ls340_out_get_label (LS340_INFO *info, INT channel, char *name) |
INT | ls340_in (INT cmd,...) |
INT | ls340_out (INT cmd,...) |
Variables | |
LS340_INFO * | info |
global info structure, in/out-init routines need the same structure More... | |
#define LS340_DEBUG 0 |
debug tag, if set to TRUE, additional messages will be displayed at execution time
Definition at line 52 of file LakeShore340.c.
Referenced by ls340_send_rcv(), and ls340_set().
#define LS340_DELTA_R 2.0 |
max. allowed deviation between ODB heater resistance and LS340 readback
Definition at line 34 of file LakeShore340.c.
Referenced by ls340_cryo_name_changed(), and ls340_in_init().
#define LS340_DELTA_TIME_ERROR 3600 |
reset error counter after LS340_DELTA_TIME_ERROR seconds
Definition at line 39 of file LakeShore340.c.
Referenced by ls340_get().
#define LS340_ETS_LOGOUT_SLEEP 10000 |
sleep time (us) between the telnet commands of the ets_logout
Definition at line 59 of file LakeShore340.c.
Referenced by ls340_get().
#define LS340_INIT_ERROR -2 |
#define LS340_INTERNAL_STR "\Detailed Messages = INT : 0\n\ETS_IN_USE = INT : 1\n\SCW_IN_USE = INT : 0\n\No Connection = INT : 1\n\Reconnection Timeout = INT : 10\n\Read Timeout = INT : 5\n\Read Raw Data = BOOL : FALSE\n\ODB Offset = INT : 0\n\ODB Output Path = STRING : [64] /Equipment/LS340 Moddy/Variables/Output\n\Remote = INT : 1\n\# Sensors = INT : 7\n\" |
initializing string for LS340_INTERNAL
Definition at line 177 of file LakeShore340.c.
Referenced by ls340_in_init().
#define LS340_LOOP1_STR "\CTRL_CH = STRING : [4] A\n\SetPoint Limit = FLOAT : 350.f\n\Max. Current Tag = INT : 4\n\Max. User Current = FLOAT : 0.85\n\Max. Heater Range = INT : 5\n\Heater Resistance = FLOAT : 25.0\n\" |
initializing string for LS340_LOOP1
Definition at line 151 of file LakeShore340.c.
Referenced by ls340_in_init().
#define LS340_MAX_AVG 100 |
max. length of the average array
Definition at line 49 of file LakeShore340.c.
Referenced by ls340_get(), and ls340_in_init().
#define LS340_MAX_ERROR 3 |
maximum number of error messages
Definition at line 38 of file LakeShore340.c.
Referenced by ls340_get().
#define LS340_MAX_READBACK_FAILURE 5 |
maximum number of readback failures before a reconnect will take place
Definition at line 55 of file LakeShore340.c.
Referenced by ls340_get().
#define LS340_MAX_RECONNECTION_FAILURE 5 |
Definition at line 56 of file LakeShore340.c.
Referenced by ls340_get().
#define LS340_MAX_SENSORS 10 |
max. number of possible input sensors
Definition at line 33 of file LakeShore340.c.
Referenced by ls340_get(), and ls340_in_init().
#define LS340_MAX_TRY_LESS 3 |
maximum number of communication attempts for less important reads
Definition at line 41 of file LakeShore340.c.
Referenced by ls340_check_heater(), and ls340_get().
#define LS340_MAX_TRY_MANY 10 |
maximum number of communication attempts for important reads
Definition at line 40 of file LakeShore340.c.
Referenced by ls340_cryo_name_changed(), ls340_force_update(), ls340_in_init(), and ls340_set().
#define LS340_ODB_NAMES_STR "\LakeShore 340 Name = STRING : [32] Moderator\n\Names In = STRING[8] : \n\[32] LS_Heater\n\[32] LS_SetPoint (read back)\n\[32] LS_Gain P (read back)\n\[32] LS_Reset I (read back)\n\[32] LS_Rate D (read back)\n\[32] LS_HeaterRange (read back)\n\[32] LS_ControlMode (read back)\n\[32] LS_Ramp (read back)\n\Names Out = STRING[8] : \n\[32] LS_Remote (1/0)\n\[32] LS_SetPoint (K)\n\[32] LS_Gain P\n\[32] LS_Reset I\n\[32] LS_Rate D\n\[32] LS_HeaterRange\n\[32] LS_ControlMode\n\[32] LS_Ramp\n\" |
initializing string for LS340_ODB_NAMES
Definition at line 232 of file LakeShore340.c.
Referenced by ls340_in_init().
#define LS340_READ_ERROR -1 |
#define LS340_SCW_STR "\Proc Name = STRING : [32]\n\PID = INT : -1\n\Log Name = STRING : [64]\n\DD Name = STRING : [32]\n\Last Updated = DWORD : 0\n\Timeout = DWORD : 180\n\" |
defines the slowcontrol default watchdog info structure
Definition at line 255 of file LakeShore340.c.
Referenced by ls340_in_init().
#define LS340_SENSORS_STR "\Date and Time = STRING : [32] \n\Sensor Type = INT[10]: \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\Calibration Curve = INT[10]: \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\1 \n\Channel = STRING[10]: \n\[4] A\n\[4] B\n\[4] C1\n\[4] C2\n\[4] C3\n\[4] C4\n\[4] D1\n\[4] D2\n\[4] D3\n\[4] D4\n\Sensor Name = STRING[10]: \n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\[32] LS_\n\Raw Input Ch 1 = FLOAT : 0.0\n\Raw Input Ch 2 = FLOAT : 0.0\n\Raw Input Ch 3 = FLOAT : 0.0\n\Raw Input Ch 4 = FLOAT : 0.0\n\Raw Input Ch 5 = FLOAT : 0.0\n\Raw Input Ch 6 = FLOAT : 0.0\n\Raw Input Ch 7 = FLOAT : 0.0\n\Raw Input Ch 8 = FLOAT : 0.0\n\Raw Input Ch 9 = FLOAT : 0.0\n\Raw Input Ch 10 = FLOAT : 0.0\n\" |
initializing string for LS340_SENSORS
Definition at line 81 of file LakeShore340.c.
Referenced by ls340_in_init().
#define LS340_SHUTDOWN -999 |
Definition at line 31 of file LakeShore340.c.
Referenced by ls340_get(), and ls340_send_rcv().
#define LS340_TIME_OUT 2000 |
time out in msecs for read (rs232)
Definition at line 35 of file LakeShore340.c.
Referenced by ls340_send_rcv().
#define LS340_WAIT 500 |
time (ms) to wait between commands
Definition at line 43 of file LakeShore340.c.
Referenced by ls340_send_rcv(), and ls340_set().
#define LS340_ZONE_STR "\Zone = STRING[10]: \n\[32] 1, 1, 7, 500, 300, 0, 0, 3\n\[32] 1, 2, 10, 500, 200, 2, 0, 4\n\[32] 1, 3, 15, 500, 100, 2, 0, 4\n\[32] 1, 4, 20, 500, 50, 2, 0, 4\n\[32] 1, 5, 30, 500, 20, 2, 0, 4\n\[32] 1, 6, 320, 500, 20, 2, 0, 5\n\[32] 1, 7, 320, 500, 20, 2, 0, 5\n\[32] 1, 8, 320, 500, 20, 2, 0, 5\n\[32] 1, 9, 320, 500, 20, 2, 0, 5\n\[32] 1, 10, 320, 500, 20, 2, 0, 5\n\" |
initializing string for the zone settings. Each zone string has the following syntax:
loop, zone, top_temp, P, I, D, man_out, range
Definition at line 198 of file LakeShore340.c.
Referenced by ls340_in_init().
void ls340_check_heater | ( | LS340_INFO * | info | ) |
checks the state of the heater and tries to switch it on again if it is disabled.
info | is a pointer to the DD specific info structure |
Definition at line 1553 of file LakeShore340.c.
References LS340_INFO::bd_connected, LS340_INFO::cmode, LS340_INTERNAL::detailed_msg, LS340_INFO::heater_setting, LS340_SETTINGS::intern, LS340_MAX_TRY_LESS, ls340_no_connection(), LS340_INFO::ls340_odb_names, ls340_send_rcv(), LS340_INFO::ls340_settings, LS340_ODB_NAMES::ls_name, LS340_INFO::setpoint, and LS340_SETTINGS::zone.
Referenced by ls340_get().
void ls340_cryo_name_changed | ( | HNDLE | hDB, |
HNDLE | dummy, | ||
void * | pinfo | ||
) |
Hotlink routine which is switching LakeShore340 and ODB relevant informations. Here the details:
Under the DD entry in the ODB, there is a tree Cryos. For each used cryostat there should be an entry with its name (e.g. DD/Cryos/Konti-1). The cryo sub-tree is structured as follows:
The routine does the following:
This procedure assures that even after a restart of the frontend, the settings of the new cryo will be used.
WARNING: Two things one should be aware of:
hDB | main ODB handle |
dummy | not used |
pinfo | is a pointer to the DD specific info structure |
Definition at line 575 of file LakeShore340.c.
References LS340_INFO::cryo_name, LS340_INFO::hDB, hKey, LS340_INFO::hkey, info, LS340_SETTINGS::intern, LS340_SETTINGS::loop1, LS340_DELTA_R, LS340_MAX_TRY_MANY, LS340_INFO::ls340_odb_names, ls340_send_rcv(), LS340_INFO::ls340_settings, LS340_ODB_NAMES::ls_name, LS340_LOOP1::max_current_tag, LS340_LOOP1::max_heater_range, LS340_LOOP1::max_user_current, LS340_INTERNAL::no_of_sensors, LS340_INTERNAL::odb_offset, and LS340_LOOP1::setpoint_limit.
Referenced by ls340_in_init().
INT ls340_exit | ( | LS340_INFO * | info | ) |
terminates the bus driver and free's the memory allocated for the info structure LS340_INFO.
Return: FE_SUCCESS
info | is a pointer to the DD specific info structure |
Definition at line 1388 of file LakeShore340.c.
References LS340_INFO::bd, LS340_INFO::bd_info, LS340_SETTINGS::intern, LS340_INFO::ls340_settings, LS340_INFO::scw, LS340_INTERNAL::scw_in_use, and LS340_INFO::startup_error.
Referenced by ls340_in().
INT ls340_force_update | ( | LS340_INFO * | info | ) |
Forces an update when switching to remote. This is necessary, since otherwise there is no synchronization between the Input and Output settings.
Return:
info | is a pointer to the DD specific info structure |
Definition at line 424 of file LakeShore340.c.
References hDB, LS340_SETTINGS::intern, LS340_MAX_TRY_MANY, LS340_INFO::ls340_odb_names, ls340_send_rcv(), LS340_INFO::ls340_settings, LS340_ODB_NAMES::ls_name, LS340_INTERNAL::odb_offset, LS340_INTERNAL::odb_output, and LS340_INFO::setpoint.
Referenced by ls340_set().
INT ls340_get | ( | LS340_INFO * | info, |
INT | channel, | ||
float * | pvalue | ||
) |
reads the values of the LS340.
Return: FE_SUCCESS
info | is a pointer to the DD specific info structure |
channel | to be set |
pvalue | pointer to the result |
Definition at line 1701 of file LakeShore340.c.
References LS340_INFO::bd, LS340_INFO::bd_connected, LS340_INFO::bd_info, LS340_SENSORS::channel, LS340_INFO::cmode, LS340_INTERNAL::detailed_msg, LS340_INFO::errorcount, LS340_INTERNAL::ets_in_use, ets_logout(), LS340_INFO::first_bd_error, LS340_INFO::hDB, LS340_INFO::heater_setting, LS340_INFO::his_full, LS340_INFO::history, LS340_INFO::hkey, LS340_INFO::hkey_datetime, LS340_INFO::hkey_raw_value, LS340_INFO::ihis, LS340_SETTINGS::intern, LS340_INFO::last_reconnect, LS340_INFO::last_value, LS340_INFO::lasterrtime, ls340_check_heater(), LS340_DELTA_TIME_ERROR, LS340_ETS_LOGOUT_SLEEP, ls340_get_decode(), LS340_INIT_ERROR, LS340_MAX_AVG, LS340_MAX_ERROR, LS340_MAX_READBACK_FAILURE, LS340_MAX_RECONNECTION_FAILURE, LS340_MAX_SENSORS, LS340_MAX_TRY_LESS, ls340_no_connection(), LS340_INFO::ls340_odb_names, LS340_READ_ERROR, ls340_send_rcv(), LS340_INFO::ls340_settings, LS340_SHUTDOWN, LS340_ODB_NAMES::ls_name, LS340_SENSORS::name, LS340_INTERNAL::read_raw_data, LS340_INTERNAL::read_timeout, LS340_INFO::read_timer, LS340_INFO::readback_err, LS340_INFO::readback_failure, LS340_INTERNAL::reconnect_timeout, LS340_INFO::reconnection_failures, LS340_INFO::scw, LS340_INTERNAL::scw_in_use, LS340_SETTINGS::sensor, LS340_INFO::setpoint, and LS340_INFO::startup_error.
Referenced by ls340_in().
INT ls340_get_decode | ( | LS340_INFO * | info, |
INT | ch, | ||
int * | sub_tag | ||
) |
delivers the correct command tags for LS340_get.
Return: command tag
info | is a pointer to the DD specific info structure |
ch | current channel |
sub_tag | pointer to a sub_tag (for PID settings) |
Definition at line 360 of file LakeShore340.c.
References LS340_SETTINGS::intern, LS340_INFO::ls340_settings, and LS340_INTERNAL::no_of_sensors.
Referenced by ls340_get().
INT ls340_in | ( | INT | cmd, |
... | |||
) |
LakeShore 340 device driver (DD). It is handling the communication between the LS340 and midas.
LS340_in is the part, which handles the communication LS340->MIDAS
RS232: 19200 baud, 8 data bits, 1 stop bit, no parity bit, no hardware protocol, no software protocol, termination: \ r\n (CR LF)
Device Driver info structure entries are organized as:
info |___ ls340_odb_names | | | |__ ls_name | |__ names_in | |__ names_out | |___ ls340_settings | |__ intern | |__ ets_in_use | |__ reconnect_timeout | |__ odb_offset | |__ odb_ouput | |__ remote | |__ no_of_senors | |__ loop1 | |__ ctrl_ch | |__ setpoint_limit | |__ max_current_tag | |__ max_heater_range | |__ heater_resitance | |__ sensor | |__ datetime | |__ type | |__ channel | |__ name | |__ raw_value | |__ zone |__ zone1 |__ zone2 |__ zone3 |__ zone4 |__ zone5 |__ zone6 |__ zone7 |__ zone8 |__ zone9 |__ zone10
ls340_settings: keeps configuration settings, etc.
Definition at line 2002 of file LakeShore340.c.
References hKey, info, ls340_exit(), ls340_get(), ls340_in_get_label(), and ls340_in_init().
INT ls340_in_get_label | ( | LS340_INFO * | info, |
INT | channel, | ||
char * | name | ||
) |
at startup, after initialization of the DD, this routine allows to write default names of the channels into the ODB.
Return: FE_SUCCESS
info | is a pointer to the DD specific info structure |
channel | of the name to be set |
name | pointer to the ODB name |
Definition at line 1975 of file LakeShore340.c.
References LS340_SETTINGS::intern, LS340_INFO::ls340_odb_names, LS340_INFO::ls340_settings, LS340_SENSORS::name, LS340_ODB_NAMES::names_in, LS340_INTERNAL::no_of_sensors, and LS340_SETTINGS::sensor.
Referenced by ls340_in().
INT ls340_in_init | ( | HNDLE | hKey, |
void ** | pinfo, | ||
INT | channels, | ||
INT(*)(INT cmd,...) | bd | ||
) |
Initializes the LS340 device driver, i.e. generates all the necessary structures in the ODB if necessary, initializes the bus driver and the LS340 temperature controller.
Return:
hKey | is the device driver handle given from the class driver |
pinfo | is needed to store the internal info structure |
channels | is the number of channels of the device (from the class driver) |
bd | is a pointer to the bus driver |
Definition at line 1000 of file LakeShore340.c.
References LS340_INFO::bd, LS340_INFO::bd_connected, LS340_INFO::bd_info, LS340_SENSORS::channel, LS340_INFO::cryo_name, LS340_LOOP1::ctrl_ch, LS340_SENSORS::curve, LS340_INFO::errorcount, LS340_INFO::first_bd_error, hDB, LS340_INFO::hDB, LS340_LOOP1::heater_resistance, LS340_INFO::heater_setting, LS340_INFO::his_full, LS340_INFO::history, hKey, LS340_INFO::hkey, LS340_INFO::hkey_datetime, LS340_INFO::hkey_no_connection, LS340_INFO::hkey_raw_value, LS340_INFO::ihis, info, LS340_SETTINGS::intern, LS340_INFO::last_reconnect, LS340_INFO::lasterrtime, LS340_SETTINGS::loop1, ls340_cryo_name_changed(), LS340_DELTA_R, LS340_INTERNAL_STR, LS340_LOOP1_STR, LS340_MAX_AVG, LS340_MAX_SENSORS, LS340_MAX_TRY_MANY, ls340_no_connection(), LS340_INFO::ls340_odb_names, LS340_ODB_NAMES_STR, LS340_SCW_STR, ls340_send_rcv(), LS340_SENSORS_STR, LS340_INFO::ls340_settings, LS340_ZONE_STR, LS340_ODB_NAMES::ls_name, LS340_LOOP1::max_current_tag, LS340_LOOP1::max_heater_range, LS340_LOOP1::max_user_current, LS340_INTERNAL::no_of_sensors, LS340_INFO::num_channels_in, LS340_INFO::read_timer, LS340_INFO::readback_err, LS340_INFO::readback_failure, LS340_INFO::reconnection_failures, LS340_INFO::scw, LS340_INTERNAL::scw_in_use, LS340_SETTINGS::sensor, LS340_INFO::set_startup_counter, LS340_LOOP1::setpoint_limit, LS340_INFO::startup_error, LS340_SENSORS::type, and LS340_SETTINGS::zone.
Referenced by ls340_in().
void ls340_no_connection | ( | LS340_INFO * | info, |
INT | value | ||
) |
Set's the no connection flag.
info | is a pointer to the DD specific info structure. |
value | equal 1 if the connection is available, otherwise 0. |
Definition at line 529 of file LakeShore340.c.
References LS340_INFO::hDB, and LS340_INFO::hkey_no_connection.
Referenced by ls340_check_heater(), ls340_get(), and ls340_in_init().
INT ls340_out | ( | INT | cmd, |
... | |||
) |
LakeShore 340 device driver (DD). It is handling the communication between the LS340 and midas.
LS340_out is the part, which handles the communication LS340<-MIDAS
Definition at line 2053 of file LakeShore340.c.
References hKey, info, ls340_out_get_label(), ls340_out_init(), and ls340_set().
INT ls340_out_get_label | ( | LS340_INFO * | info, |
INT | channel, | ||
char * | name | ||
) |
at startup, after initialization of the DD, this routine allows to write default names of the channels into the ODB.
Return: FE_SUCCESS
info | is a pointer to the DD specific info structure |
channel | of the name to be set |
name | pointer to the ODB name |
Definition at line 1995 of file LakeShore340.c.
References LS340_INFO::ls340_odb_names, and LS340_ODB_NAMES::names_out.
Referenced by ls340_out().
INT ls340_out_init | ( | HNDLE | hKey, |
void ** | pinfo, | ||
INT | channels, | ||
INT(*)(INT cmd,...) | bd | ||
) |
Initializes the LS340 device driver.
Return:
hKey | is the device driver handle given from the class driver |
pinfo | is needed to store the internal info structure |
channels | is the number of channels of the device (from the class driver) |
bd | is a pointer to the bus driver |
Definition at line 1373 of file LakeShore340.c.
References info, and LS340_INFO::num_channels_out.
Referenced by ls340_out().
INT ls340_send_rcv | ( | LS340_INFO * | info, |
char * | cmd, | ||
char * | str, | ||
int | max_try | ||
) |
send/recieve routine. loops LS340_MAX_TRY times if there would be a communication problem.
Return: number of read bytes
info | is a pointer to the DD specific info structure |
cmd | command string |
str | reply string |
max_try | maximal number of read trials |
Definition at line 314 of file LakeShore340.c.
References LS340_INFO::bd_connected, LS340_DEBUG, LS340_INFO::ls340_odb_names, LS340_SHUTDOWN, LS340_TIME_OUT, LS340_WAIT, and LS340_ODB_NAMES::ls_name.
Referenced by ls340_check_heater(), ls340_cryo_name_changed(), ls340_force_update(), ls340_get(), ls340_in_init(), and ls340_set().
INT ls340_set | ( | LS340_INFO * | info, |
INT | channel, | ||
float | value | ||
) |
sets the values of the LS340, if the device is remote. It relies on a specific order in the ODB (see code).
Return: FE_SUCCESS
info | is a pointer to the DD specific info structure |
channel | to be set |
value | to be sent to the LS330 |
Definition at line 1412 of file LakeShore340.c.
References LS340_INFO::bd_connected, LS340_INFO::first_bd_error, LS340_INFO::heater_setting, LS340_SETTINGS::intern, LS340_SETTINGS::loop1, LS340_DEBUG, ls340_force_update(), LS340_MAX_TRY_MANY, LS340_INFO::ls340_odb_names, ls340_send_rcv(), LS340_INFO::ls340_settings, LS340_WAIT, LS340_ODB_NAMES::ls_name, LS340_LOOP1::max_heater_range, LS340_INFO::num_channels_out, LS340_INTERNAL::remote, LS340_INFO::set_startup_counter, LS340_INFO::setpoint, LS340_LOOP1::setpoint_limit, and LS340_INFO::startup_error.
Referenced by ls340_out().
LS340_INFO* info |
global info structure, in/out-init routines need the same structure
Definition at line 302 of file LakeShore340.c.