DALI User Manual: Server Setup

Overview

The DALI server executable is located in the /bin/ sub-directory of the DALI install directory. There are a number of options which specify the configuration of the DALI server. These options can either be specified on the command line when the DALI server is run, or added to a simple key=value INI file which is checked by the server when it starts.

By default the INI file is called dali.ini and it is located in the DALI install directory. Here is an example dali.ini file:

port=8444
passwordfile=/usr/local/dali/etc/passwd

These options could be specified on the command line when running the DALI server instead, as in this example:

$ dalid -port 8444 -passwordfile /usr/local/dali/etc/passwd

Board Locking

Data acquisition boards are not designed to support multiple programs interacting with them at the same time. DALI will malfunction, or disrupt other programs if they try to use a board while DALI is servicing a request for the same board. If possible, all software should use DALI to communicate with the data acquisition hardware rather than programming the boards directly.

However, if you must communicate with the DAQ hardware independant of DALI a feature called Board Locking is supported which allows you to sychronize your operations with DALI to ensure that only one program is talking to the board at a time.

The lockboards directive which is documented below enables this feature. When enabled, DALI will lock the board automatically before each board access, and unlock it when done. Any 3rd party program which will sychronize access to the board with DALI must do the same. When a "lock" is in use, the other program should wait until the "lock" is released before accessing the board.

On Linux and QNX, DALI will create lock files in the boards directory. The lock file for a board will be the name of the board followed by ".lock". The following code should be added to any 3rd party program which will use these lock files to synchronize with the DALI server.


	char *lockfile = "/usr/local/dali/boards/myboard.lock";
	int fd = open(lockfile, O_RDONLY|O_CREAT, S_IREAD);
	flock(fd, LOCK_EX);
	// Your DAQ programming code goes here
	flock(fd, LOCK_UN);
	close(fd);

On Windows, Named Mutexes are used instead. For example, a mutex named DALI_IPC_MUTEX_MYBOARD is created by the DALI server if you have a board named myboard. The following code should be added to any 3rd party program which will use these lock files to synchronize with the DALI server.


	HANDLE hdl = CreateMutex(NULL, FALSE, "DALI_IPC_MUTEX_MYBOARD");
	WaitForSingleObject(hdl, INFINIE);
	// Your DAQ programming code goes here
	ReleaseMutex(hdl);
	CloseHandle(hdl);

Note that board locking has a serious impact on DALI A/D performance. Since DALI can no longer assume it has full control of a board, it must repeat A/D mode setup before each A/D sample.

Server Configuration Directives

Directive Default Value
port 8444
TCP/IP port used for DALI communications protocol. DALI clients connect to the DALI server at this port.


Directive Default Value
sslport 4443
TCP/IP port used for SSL encrypted DALI communications protocol. DALI clients using SSL connect to the DALI server at this port.


Directive Default Value
boards /usr/local/dali/boards (on Linux)
The directory the DALI server will search for board configuration files. See the Board Configuration section of this documentation for more information on these files.


Directive Default Value
lockboards 0
The DALI server will lock a file (Linux and QNX) or mutex (Win32) to allow sychronization of board access with 3rd party software. See the section on Board Locking at the top of this page for more information. Set to 1 to enable board locking.


Directive Default Value
passwordfile /usr/local/dali/etc/passwd (on Linux)
The full path to the password file used to authenticate DALI users. See the Users and Groups section of this manual for more information on this file.


Directive Default Value
groupfile /usr/local/dali/etc/group (on Linux)
The full path to the group file used to authenticate DALI users. See the Users and Groups section of this manual for more information on this file.


Directive Default Value
sslcert /usr/local/dali/ssl/server.crt (on Linux)
Full path to the signed SSL certificate file in PEM format. See the SSL Configuration section of the manual for more information on this file.


Directive Default Value
sslpassword dali
The password used to decrypt the SSL certificate. See the SSL Configuration section of the manual for more information on this parameter.


Directive Default Value
passwordfile /usr/local/dali/etc/license (on Linux)
Full path to the license file provided by Diamond Systems. See the Licensing section of the documentation for more information on this file.


Directive Default Value
alarms /usr/local/dali/alarms/ (on Linux)
The directory scanned by the DALI server at startup to register built-in alarms. See the Alarms section of the documentation for more information.


Directive Default Value
inifile /usr/local/dali/dali.ini
The full path to the INI file to be read for startup options when the server loads. This parameter can only be used as a command line parameter.


Directive Default Value
hostname (see description below)
The valid DNS hostname or IP address for the DALI system. Used for the Alarm system when publishing details about the alarm source to clients. If a hostname is not specified, the server attepts to discover this setting from the system which may be unreliable.