26-12-2012, 04:28 PM
Advanced Database Topics
Advanced Database.PPT (Size: 89.5 KB / Downloads: 33)
Record Processing -
EventEvents are produced in software by calling post_event(number) and cause records to process that have a SCAN of Event with an EVNT of (number)
This functionality is built into the timing and event records. They will generate events whenever the records are processed. This is a method of causing records without event support in the driver to be scanned on event.
State notation programs or any other task in the same vxWorks environment (IOC) can also call post_event().
Record Processing - Passive
FLNK fields will cause records with SCAN = Passive that have PACT = 0 to process
Any INP field with an attribute of PP (Process Passive) will cause the record specified in the INP field to process if the SCAN = Passive and the PACT = 0
A record containing an INP field with an attribute of CPP will be processed any time referenced record posts a monitor and the SCAN field is also Passive and the PACT = 0. If the INP field has an attribute of CP, the record containing the link processes any time the record referenced in the link posts a monitor regardless of the SCAN field of the record containing the link.
A Channel access put from any channel access client program will cause process a record that has a SCAN of Passive. If the record is currently active, the lock set is locked and the channel access server will wait until completion of the record processing to place the new value into the record. The field being written must have a Process the Record attribute of true - for this to be the case. These are defined in the .dbd file for each record.
Setting the PINI field of a Passive record to True will cause the record to process once on initialization.
Putting a 1 to the .PROC field of a Passive record will cause processing
Record Processing - Disable Scanning
Conditional scanning can be accomplished using the fields in each database record for disabling the scan.
When the DISV field has the same value as DISA, then the record and any records processed as a result of this record (FLNKs, INPs and OUTs).
SDIS is an address field that specifies the channel from which to fetch the DISA value. If this field is not specified, then whatever is placed into DISA will be used to determine if scanning is disabled.
DISS is the alarm severity of the record having it’s scanned disabled. Default is No Alarm.
Database - Simulation Mode
A set of fields to support simulation are supplied on all hardware input records.
SIMM = YES makes this record a simulation record.
A link to a database value to put the record into simulation mode is specified in the SIML. A non-zero number puts the record into simulation mode.
SVAL is the engineering units value used when the record is in simulation mode.
SIOL is a database location from which to fetch SVAL when the record is in simulation mode.
SIMS is the alarm severity of the record if it is in simulation mode.
Database - Analog Input
Used to read an analog transducer.
Conversions for linear transducers accomplished using LINR = Linear and placing the full range of the conversion in EGUF and the low end of the range in EGUL
A weighted average is built in for smoothing in the form
VAL(new) * (1-SMOO) + VAL(previous) * SMOO
Break point tables used for non-linear conversions or tables.
Database - Binary Output
The binary output is a momentary output if the HIGH field is set to a non-zero
value. If HIGH is .5 and the VAL is set to 1, .5 seconds later the VAL is set to 0 and the record is processed.
Also note the fields that are used by all output records for performing closed loop control and reacting to errors on the values used to determine the new outputs.