The configuration file contains a number of commands that are used at startup. These commands give the driver its initial, static configuration.
A configuration file can also be invoked at run time, either programmatically or during an interactive session. The special command include is used for this purpose. This command lets you send a predetermined block of commands to the driver on the fly.
Below is a sample configuration file. This file, sstpfb_sample.cfg, is included in the distribution. Because this is Lisp syntax, comment lines start with one or more semicolon (;) characters.
;;; ;;; Sample Driver Configuration File for the DR5136PFB 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 [port [addr [irq]]]]) ;;; ;;; id is 0-3, the id for the interface card (default is 0) ;;; port for ISA cards, the port address set by the SW1 switches ;;; addr for ISA cards, location of 16K memory window ;;; irq for ISA, interrupt number, or -1 for polling mode ;;; ; probe for all PCI cards available, use interrupts (cardInit) ; init card 0 at port x260, using 16K memory block at xCC00, polled ;(cardInit 0 0x260 0xCC00) ; init card 0 at port x260, using 16K memory block at xCC00, using interrupt 7 ;(cardInit 0 0x260 0xCC00 7) ;(cardInit 0 0x250 0xCC00 0 PFBPROFI.SS1) ;;; 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) ;;; ;;; Configure and Start Profibus Activity ;;; -------------------------------------- ;;; ;;; load some helpful command definitions (include /usr/cogent/src/dr5136pfb/pfbDefines.cfg) (include /usr/cogent/src/dr5136pfb/pfbDpMaster.cfg) ;(include /usr/cogent/src/dr5136pfb/pfbDpSlave.cfg) ;(include /usr/cogent/src/dr5136pfb/pfbFdlMsg.cfg) ;(include /usr/cogent/src/dr5136pfb/pfbFdlSap.cfg) (pfbNetParms 0 0 ACTIVE BAUD_1m5 * (bor OPTION_REPEATER OPTION_FMS)) ; just report the default bus parameters (pfbBusParms 0) ; attempt to determine the slave configuration using SST's auto feature (pfbLoadCfg 0 AUTO) (pfbOnline 0 DpMaster) ; enable input and outputs (pfbRunMode 0) ;;; ;;; 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 ;;; buffer 0 master write, 1 master read, 2 slave write, 3 slave read ;;; word 16 bit word offset into buffer memory ;;; 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: Points MUST be collected into a group (see below) to be updated automatically ;;; ----- ;;; ;;; Cogent-specific testbed configuration (ref for point definitions examples) is in ;;; (include /usr/cogent/src/dr5136pfb/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>) ;;; ------------------------------------------ ;;; Check profibus status (for setup/debug) ;(pfbStationStatus 0) ;(pfbDiagStatus 0)
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.