The DVN 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.
The following list provides a quick summary of the most necessary and commonly used configuration commands (see the sstdvn_sample.cfg file included in the distribution):
| cardInit | Autodetects and initializes any SST DeviceNet cards, specify polling vs. interrupt modes. |
| cardPoll | If polling mode is used, specifies the internal data transfer (buffer refresh) period. |
| bufferUpdate | If 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. |
Commands related to dnscan:
| dnsOnline | Initializes the dnscan DeviceNet interface. |
| dnsScanStart | Starts the dnscan client scanner function. |
| dnsDeviceAdd | Adds a device configuration to the dnscan device list. |
If using the point data model:
| digital | Creates a binary bit or integer-valued data point. |
| analog | Creates a real-valued data point. |
| group | Associates a set of points into a group that can be refreshed on a periodic basis. |
| cardGroup | Associates a group directly with the refresh period of a card, in lieu of using an independent group period. |
If using the Cascade DataHub:
The following file could be used to initialize card number 0 for port 0x260 and hardware address 0xCC00. This file, sstdvn_sample.cfg, is included in the driver distribution.
;;; ;;; Sample Driver Configuration File for the drsstdvn 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) ;;; 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 DeviceNet Activity ;;; -------------------------------------- ;;; Bring card online ;;; (dnsOnline card ScannerMacId BaudRate [ServerOutputSize ServerInputSize [ConnectionType]] ;;; where ;;; BaudRate is one of 0 | 1 | 2 or BAUD_125K | BAUD_250K | BAUD_500K ;;; ;;; Start Scanning DeviceNet ;;; (dnsScanStart card) ;;; ;;; Add/Configure devices ;;; (dnsAddDevice card DeviceMacId) autoprobes for Polled connection I/O sizes ;;; (dnsAddDevice card DeviceMacId OutputSize InputSize [OutputOfs InputOfs [MsgSize [ConnectionType]]]) ;;; where ;;; ConnectionType is combination of ;;; CONN_FLAG_EX, CONN_FLAG_AKS and one of the following IO flags ;;; CONN_FLAG_P, CONN_FLAG_ST, CONN_FLAG_COS, CONN_FLAG_CYC ;;; if not specified, default is CONN_FLAG_P (recommended) ;;; ;;; load some helpful command definitions (include /usr/cogent/src/drsstdvn/dnsDefines.cfg) (include /usr/cogent/src/drsstdvn/dnsMsg.cfg) (dnsOnline 0 0 BAUD_125K) (dnsScanStart 0) (dnsDeviceAdd 0 2) ;;; ;;; 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[.device]:]word[;flags] ;;; for 16-bit analog values ;;; [[card:]buffer[.device]:]word.bit_ofs[;flags] ;;; for digital bit values ;;; [[card:]buffer[.device]:]word.bit_ofs[.bit_width[;flags]] ;;; for digital fields ;;; ;;; card 0..3 card id ;;; buffer 0 scanner write, 1 scanner read, 2 server write, 3 server read ;;; device word offset is relative to specified field device id ;;; 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/drsstdvn/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>)
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.