The midas.h & midas.c


Modules

Midas #define
Midas Macros
Midas Error definition
Midas Structure Declaration
Midas Message Functions (msg_xxx)
Midas Common Functions (cm_xxx)
Midas Buffer Manager Functions (bm_xxx)
Midas RPC Functions (rpc_xxx)
Midas Bank Functions (bk_xxx)
Midas History Functions (hs_xxx)
Midas Elog Functions (el_xxx)
Midas Alarm Functions (al_xxx)
Midas Dual Buffer Memory Functions (dm_xxx)

Defines

#define TAPE_BUFFER_SIZE   0x8000
#define NET_TCP_SIZE   0xFFFF
#define OPT_TCP_SIZE   8192
#define NET_UDP_SIZE   8192
#define EVENT_BUFFER_SIZE   0x100000
#define EVENT_BUFFER_NAME   "SYSTEM"
#define MAX_EVENT_SIZE   0x80000
#define DEFAULT_EVENT_BUFFER_SIZE   0x200000;
#define DEFAULT_ODB_SIZE   0x100000
#define NAME_LENGTH   32
#define HOST_NAME_LENGTH   256
#define MAX_CLIENTS   32
#define MAX_EVENT_REQUESTS   10
#define MAX_OPEN_RECORDS   100
#define MAX_ODB_PATH   256
#define MAX_EXPERIMENT   32
#define BANKLIST_MAX   32
#define STRING_BANKLIST_MAX   BANKLIST_MAX * 4
#define CH_BS   8
#define LAM_SOURCE(c, s)   (c<<24 | ((s) & 0xFFFFFF))
#define LAM_STATION(s)   (1<<(s-1))
#define LAM_SOURCE_CRATE(c)   (c>>24)
#define LAM_SOURCE_STATION(s)   ((s) & 0xFFFFFF)
#define CNAF   0x1
#define ANA_CONTINUE   1


Define Documentation

#define ANA_CONTINUE   1
 

dox**************************************************************

Definition at line 1063 of file midas.h.

#define ANA_SKIP   0
 

Definition at line 1064 of file midas.h.

#define BANKLIST_MAX   32
 

max # of banks in event

Definition at line 578 of file midas.h.

Referenced by bk_list().

#define CH_BS   8
 

special characters

Definition at line 723 of file midas.h.

#define CH_CR   13
 

Definition at line 725 of file midas.h.

#define CH_DELETE   (CH_EXT+2)
 

Definition at line 731 of file midas.h.

#define CH_DOWN   (CH_EXT+7)
 

Definition at line 736 of file midas.h.

#define CH_END   (CH_EXT+3)
 

Definition at line 732 of file midas.h.

#define CH_EXT   0x100
 

Definition at line 727 of file midas.h.

#define CH_HOME   (CH_EXT+0)
 

Definition at line 729 of file midas.h.

#define CH_INSERT   (CH_EXT+1)
 

Definition at line 730 of file midas.h.

#define CH_LEFT   (CH_EXT+9)
 

Definition at line 738 of file midas.h.

#define CH_PDOWN   (CH_EXT+5)
 

Definition at line 734 of file midas.h.

#define CH_PUP   (CH_EXT+4)
 

Definition at line 733 of file midas.h.

#define CH_RIGHT   (CH_EXT+8)
 

Definition at line 737 of file midas.h.

#define CH_TAB   9
 

Definition at line 724 of file midas.h.

#define CH_UP   (CH_EXT+6)
 

Definition at line 735 of file midas.h.

#define CNAF   0x1
 

CNAF commands

Definition at line 768 of file midas.h.

#define CNAF_CRATE_CLEAR   0x102
 

Definition at line 773 of file midas.h.

#define CNAF_CRATE_ZINIT   0x103
 

Definition at line 774 of file midas.h.

#define CNAF_INHIBIT_CLEAR   0x101
 

Definition at line 772 of file midas.h.

#define CNAF_INHIBIT_SET   0x100
 

Definition at line 771 of file midas.h.

#define CNAF_nQ   0x2
 

Definition at line 769 of file midas.h.

#define CNAF_TEST   0x110
 

Definition at line 775 of file midas.h.

#define DEFAULT_EVENT_BUFFER_SIZE   0x200000;
 

2M

Definition at line 568 of file midas.h.

#define DEFAULT_ODB_SIZE   0x100000
 

online database 1M

Definition at line 569 of file midas.h.

Referenced by cm_connect_experiment(), cm_connect_experiment1(), and main().

#define DEFAULT_RPC_TIMEOUT   10000
 

Definition at line 585 of file midas.h.

#define DEFAULT_WATCHDOG_TIMEOUT   10000
 

Definition at line 588 of file midas.h.

Referenced by cm_connect_experiment(), and cm_connect_experiment1().

#define EVENT_BUFFER_NAME   "SYSTEM"
 

buffer name for commands

Definition at line 566 of file midas.h.

#define EVENT_BUFFER_SIZE   0x100000
 

buffer used for events

Definition at line 565 of file midas.h.

Referenced by main(), and source_booking().

#define HOST_NAME_LENGTH   256
 

length of TCP/IP names

Definition at line 572 of file midas.h.

Referenced by cm_connect_client(), cm_connect_experiment1(), cm_disconnect_experiment(), cm_set_client_info(), cm_shutdown(), cm_transition(), and main().

#define LAM_SOURCE c,
 )     (c<<24 | ((s) & 0xFFFFFF))
 

Code the LAM crate and LAM station into a bitwise register.

Parameters:
c Crate number
s Slot number

Definition at line 746 of file midas.h.

#define LAM_SOURCE_CRATE  )     (c>>24)
 

Convert the coded LAM crate to Crate number.

Parameters:
c coded crate

Definition at line 758 of file midas.h.

#define LAM_SOURCE_STATION  )     ((s) & 0xFFFFFF)
 

Convert the coded LAM station to Station number.

Parameters:
s Slot number

Definition at line 764 of file midas.h.

#define LAM_STATION  )     (1<<(s-1))
 

Code the Station number bitwise for the LAM source.

Parameters:
s Slot number

Definition at line 752 of file midas.h.

#define MAX_CLIENTS   32
 

client processes per buf/db

Definition at line 573 of file midas.h.

Referenced by bm_close_buffer(), bm_open_buffer(), cm_cleanup(), db_close_database(), and db_open_database().

#define MAX_EVENT_REQUESTS   10
 

event requests per client

Definition at line 574 of file midas.h.

Referenced by bm_remove_event_request().

#define MAX_EVENT_SIZE   0x80000
 

maximum event size 512k

Definition at line 567 of file midas.h.

Referenced by bm_send_event(), dm_buffer_create(), main(), and rpc_send_event().

#define MAX_EXPERIMENT   32
 

number of different exp.

Definition at line 577 of file midas.h.

Referenced by cm_connect_experiment1(), cm_list_experiments(), cm_scan_experiments(), and cm_select_experiment().

#define MAX_ODB_PATH   256
 

length of path in ODB

Definition at line 576 of file midas.h.

Referenced by db_copy().

#define MAX_OPEN_RECORDS   100
 

number of open DB records

Definition at line 575 of file midas.h.

#define MIDAS_TCP_PORT   1175
 

Definition at line 582 of file midas.h.

Referenced by cm_list_experiments(), and cm_transition().

#define MIDAS_VERSION   "1.9.3"
 

Definition at line 418 of file midas.h.

Referenced by cm_get_version().

#define NAME_LENGTH   32
 

length of names, mult.of 8!

Definition at line 571 of file midas.h.

Referenced by bm_open_buffer(), cm_check_client(), cm_connect_client(), cm_connect_experiment1(), cm_exist(), cm_get_client_info(), cm_list_experiments(), cm_select_experiment(), cm_set_client_info(), cm_shutdown(), cm_transition(), and db_open_database().

#define NET_TCP_SIZE   0xFFFF
 

maximum TCP transfer

Definition at line 561 of file midas.h.

Referenced by rpc_send_event(), and scheduler().

#define NET_UDP_SIZE   8192
 

maximum UDP transfer

Definition at line 563 of file midas.h.

#define OPT_TCP_SIZE   8192
 

optimal TCP buffer size

Definition at line 562 of file midas.h.

#define STRING_BANKLIST_MAX   BANKLIST_MAX * 4
 

for bk_list()

Definition at line 579 of file midas.h.

#define TAPE_BUFFER_SIZE   0x8000
 

buffer size for taping data

Definition at line 559 of file midas.h.

#define WATCHDOG_INTERVAL   1000
 

Definition at line 586 of file midas.h.

Referenced by cm_cleanup(), cm_set_client_info(), cm_set_watchdog_params(), and ss_sleep().


Variable Documentation

INT _call_watchdog = TRUE [static]
 

Definition at line 1658 of file midas.c.

Referenced by cm_get_watchdog_params(), and cm_set_watchdog_params().

char _client_name[NAME_LENGTH] [static]
 

Definition at line 1656 of file midas.c.

HNDLE _hDB = 0 [static]
 

Definition at line 1655 of file midas.c.

Referenced by cm_get_experiment_database(), and cm_set_experiment_database().

HNDLE _hKeyClient = 0 [static]
 

Definition at line 1654 of file midas.c.

Referenced by cm_connect_experiment1(), cm_get_experiment_database(), and cm_set_experiment_database().

INT _mutex_alarm
 

Definition at line 1660 of file midas.c.

Referenced by db_close_database().

INT _mutex_elog
 

Definition at line 1660 of file midas.c.

Referenced by db_close_database().

char _path_name[MAX_STRING_LENGTH] [static]
 

Definition at line 1657 of file midas.c.

Referenced by cm_get_path(), and cm_set_path().

INT _watchdog_timeout = DEFAULT_WATCHDOG_TIMEOUT [static]
 

Definition at line 1659 of file midas.c.

Referenced by cm_get_watchdog_params(), and cm_set_watchdog_params().


Midas DOC Version 1.9.3 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Suzannah Daviel - Doxygen - Peter Green - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - Konstantin Olchanski - Renee Poutissou - Andreas Suter - Piotr Adam Zolnierczuk