1.5. Driver Configuration

The Hilscher CIF Driver uses a configuration file to tailor its operation to the requirements of your specific installation. Without this file, the driver will run with a time-limited license and in a basic mode of operation.

1.5.1. Common Configuration Commands

The following list provides a quick summary of the most necessary and commonly used configuration commands (see the cif_sample.cfg file included in the distribution):

cardInitAutodetects and initializes any CIF cards, specify polling vs. interrupt modes.
cardProfileNot required, but very satisfying to confirm expected card(s) were found and are configured correctly.
cardPollIf polling mode is used, specifies the internal data transfer (buffer refresh) period.
bufferUpdateIf polling mode is used, as an alternative to cardPoll, this command explicitly forces a data transfer with the card (buffer refresh) to occur. It is used by a client application, not in the configuration file.
licenseSpecifies a valid commerical license (specific to a CIF card).
attachNamePublishes the administrator name to the QNX name server. Required for access through the API if the attachNS command is not used.

If using the point data model:

digitalCreates a binary bit or integer-valued data point.
analogCreates a real-valued data point.
groupAssociates a set of points into a group that can be refreshed on a periodic basis.
cardGroupAssociates a group directly with the refresh period of a card, in lieu of using an independent group period.

If using the Cascade DataHub:

attachNSConnects the driver to the Cascade NameServer.
datahubActivates the use of the Cascade DataHub, causing input point updates to be published to the datahub, and datahub updates to cause changes to the driver outputs.

1.5.2. Sample Configuration File

The following file could be used to initialize card number 0, with hardware address 0xD0000 and interrupt number 7. This file, cif_sample.cfg, is included in the driver distribution.

;;;
;;; Sample Driver Configuration File for the DRCIF Driver
;;;	Modify to suit requirements of specific system

;;;
;;; Set driver debug/error reporting level:
;;;	(debug level)
;;; where
;;;	0 for no output (only terminal errors produce output)
;;;	1 or 2, normal setting, reports errors and other significant events
;;;	3... reports increasing levels of debug information
(debug 2)

;;;
;;; Initialize card(s)
;;; ------------------
;;; (cardInit [id [addr [size [irq]]]])
;;;
;;; id	 is 0-3, the id for the interface card (default is 0)
;;; addr is the address of the dual port memory, based on jumpers on card,
;;;      in HEX.  Both a 4 digit segment or full 5-digit address is accepted.
;;;	 If not specified, then system is probed for the next CIF card.
;;; size	 is the size of the card dual port memory in Kbytes (2, 8, or 16).
;;;	 If not specified, then the system is probed to determine card size.
;;; irq  is 0-7, based on card jumpers, where 0 is polling mode (default)
;;;
; probe for all cards available, polling
(cardInit)
; probe for card 0 on interrupt 7
;(cardInit 0 0 0 7)
; init card 0 at D0000, probe for size, on interrupt 7
;(cardInit 0 0xD0000 0 7)
; init 8K card as card 0, interrupt 7
;(cardInit 0 0 8 7)

;;; profile the cards
;(cardProfile)

;;;
;;; polled cards must have a specific polling period (ms) assigned
;;;
(cardPoll 0 10)

;;; Publish alternate driver name to Cogent nameserver (see nserve and nsnames)
(attachNS myName)

;;;
;;;  Enable the card-specific license (license device key)
(license 0 0000-0000-0000-0000-0000-0000)
;;;  Alternative is to process file of licenses
;(licenseFile filename)

;;;
;;; read the standard cif card definitions
;;;
(include /usr/cogent/src/cif/cif.cfg)

;;;
;;; read the protocol-specific definitions
;;;
;(include /usr/cogent/src/cif/dnm.cfg)
;(include /usr/cogent/src/cif/ibm.cfg)
;(include /usr/cogent/src/cif/prf.cfg)
;(include /usr/cogent/src/cif/cns.cfg)

;;;
;;; Connect to the DataHub
;;; ----------------------
;;;  Enable connection to Cascade real-time datahub
(datahub y)

;;;  Publish status driver status
;(statusPointDefine)

;;;
;;; Analog and digital points are created through the generic commands below,
;;; where address = 
;;;		[[card:]buffer:]word[;flags]
;;;			for 16-bit analog values
;;;		[[card:]buffer:]word.bit_ofs[;flags]
;;;			for digital bit values
;;;		[[card:]buffer:]word.bit_ofs[.bit_width[;flags]]
;;;			for digital fields
;;;		   
;;; card	0..3 card id
;;; word 	16 bit word offset into buffer memory
;;; buffer	0 write, 1 read
;;; bit_ofs	1..16 bit offset into word
;;; bif_width	1..32 width of field in bits.
;;; flags 	-e0 | -eN (endian swap), -s (signed value)
;;;
;;; NOTE: To be updated automatically, a point MUST be collected into a group (see below)
;;; -----
;;;
;;; Cogent-specific testbed configuration (ref for point definitions examples) is in
;;; (include /usr/cogent/src/cif/testbed.cfg)

;;;
;;; Define analog points
;;; (analog enable-flag name address R|W|RW cycle-millisecs exception-flag
;;;  raw-min raw-max eng-unit-min eng-unit-max)
;;;
;(analog t <name> <address> r 0 t 0 32767 0 <max>)

;;;
;;; Define digital points
;;; (digital enable-flag name address R|W|RW cycle-millisecs exception-flag)
;;;
;(digital t <name> <address> r 0 t)

;;;
;;; Define groups.
;;;	Groups collect together a set of points to be automatically updated.
;;;	The update can occur on the group's specified cycle interval,
;;;	or can be linked to the card's update cycle, using the cardGroup command below.
;;; (group enable-flag name address R|W|RW cycle-millisecs point...)
;;;
;(group t <name> 0 R <ms> inpnt1 inpnt2 inpnt3)
;(group t <name> 0 RW <ms> outpnt1 outpnt2 outpnt3)

;;; 
;;; Associate a group with the cycle of the card (group's cycle-millisecs must be 0)
;;; (cardGroup 0 groupName)
;;;
;(cardGroup 0 <name>)