Table of Contents Previous Chapter Chapter 27: pulseDelay

Chapter 27: pulseDelay

1. Introduction

The normal use for the pulseDelay record type is to generate output pulses.

2. Field Summary

--------------------------------------------------------------
Field  Type       DCT  Initial  Access  Modify  Rec Proc   PP   
                                                Monitor         
--------------------------------------------------------------
OUT    OUTLINK    Yes  0        No      No      N/A        No   
UNIT   RECCHOICE  Yes  0        Yes     Yes     No         No   
DLY    DOUBLE     Yes  0        Yes     Yes     Yes        Yes  
WIDE   DOUBLE     Yes  0        Yes     Yes     Yes        Yes  
ODLY   DOUBLE     No   0        Yes     No                 No   
OWID   DOUBLE     No   0        Yes     No                 No   
CTYP   RECCHOICE  Yes  0        Yes     Yes     No         No   
CEDG   RECCHOICE  Yes  0        Yes     Yes     No         No   
ECS    SHORT      Yes  0        Yes     Yes     No         No   
ECR    DOUBLE     Yes  0        Yes     Yes     No         No   
VAL    RECCHOICE  No   0        Yes     Yes     Yes        No   
PFLD   USHORT     No   0        Yes     No                 No   
LLOW   RECCHOICE  Yes  0        Yes     Yes     No         No   
TTYP   RECCHOICE  Yes  0        Yes     Yes     No         No   
HTS    ENUM       Yes  0        Yes     Yes     No         Yes  
STL    INLINK     Yes  0        No      No      N/A        No   
STV    RECCHOICE  Yes  0        Yes     Yes     No         Yes  
HOPR   FLOAT      Yes  0        Yes     Yes     No         No   
LOPR   FLOAT      Yes  0        Yes     Yes     No         No   
PREC   SHORT      Yes  0        Yes     Yes     No         No   
GATE   RECCHOICE  Yes  1        Yes     Yes     No         Yes  
GLNK   INLINK     Yes  0        Yes     No      N/A        No   
--------------------------------------------------------------

3. Field Descriptions

-----------------------------------------------------------------------------------------
Name  Summary             Description                                                      
-----------------------------------------------------------------------------------------
OUT   Output Link         This field is used by the device support routines to decide      
                          where to send output. For soft records, it can be a              
                          constant, a database link, or a channel access link. If the      
                          link is a constant, the result is no output.                     
UNIT  Time units          Time units of delay and width.  (Seconds, Milliseconds,          
                          Microseconds, Nanoseconds, Picoseconds).                         
DLY   Pulse Delay, in     Delay after trigger edge until beginning of pulse.               
      UNITS of time                                                                        
WIDE  Pulse Width, in     Width of pulse generated.                                        
      UNITS of time                                                                        
ODLY  Old Delay           Value when last monitors for delay were triggered.               
OWID  Old Width           Value when last monitors for width were triggered.               
CTYP  Clock Type          Hardware/Software.  If software selected, then clock             
                          automatically determined by software.  If hardware               
                          selected, then clock determined by ECS and ECR.                  
CEDG  Clock Signal Edge   This can be Rising Edge or Falling Edge.  This field forces      
                          clock timing on rising or falling edge of source signal.         
ECS   External Clock      If CTYP is internal, this field is ignored.  If CTYP is          
      Source              external, then this field is device dependent.                   
ECR   External Clock      Clock rate for external clock source.                            
      Rate, in Hz                                                                          
VAL   Value               This field is will contain value 1 if a trigger was detected     
                          since the last time the record was processed and a 0             
                          otherwise.                                                       
PFLD  Processing Field    This field is set to indicate if which of the following fields   
                          changed since last processed: DLY, WIDE, STV,  GATE, or          
                          HTS.                                                             
LLOW  Low Logic Level     0:  Logic Low=0                                                  
                          1:  Logic Low=1                                                  
TTYP  Trigger Type.       This field indicates where the pulse trigger will come           
      (Hardware/          from.  Hardware indicates HTS will be used, software will        
      Software)           use STL, STV.                                                    
HTS   Hardware Trigger    The source of the delayed pulse trigger.                         
      source                                                                               
STL   Soft Trigger        This value for STV will be read from here if this is set.        
      Location (Input                                                                      
      link)                                                                                
STV   Soft Trigger Value  This can be enabled or disable.  This will trigger a delayed     
                          pulse if TTYP set to software and device allows it.              
HOPR  High Operating      These fields determine the upper and lower display limits        
      Range               for graphics displays and the upper and lower control            
                          limits for control displays. The fields are used by record       
                          support to honor calls to get_graphic_double or                  
                          get_control_double.                                              
LOPR  Low Operating                                                                        
      Range                                                                                
PREC  Display Precision   Precision with which to display DLY.  This field is used by      
                          record support to supply a value when get_precision              
                          is called.                                                       
GATE  Gate for enable/    This field can be used to enable and disable the pulses.         
      disable of pulse                                                                     
      generation                                                                           
GLNK  Gate Location       This field is used to determine where to get the value for       
                          GATE.                                                            
-----------------------------------------------------------------------------------------

4. Record Support Routines

init_record

This routine first checks that device support is available. Device support is then checked to see if write_pd is defined.

Next this routine initializes STV with the value of STL if STL type is CONSTANT link or creates a channel access link if STL type is PV_LINK.

GATE is likewise initialized if GLNK is CONSTANT or PV_LINK.

If device support includes init_record, it is called.

process

See next section.

special

Sets the PFLD field to indicate if write to DLY, STV, GATE or HTS field caused processing of the record.

get_value

Fills in the values of struct valueDes so that they refer to VAL.

get_precision

Retrieves PREC.

get_graphic_double

Sets the upper display and lower display limits for a field. If the field is VAL, DLY, ODLY, WIDE or OWID the limits are set to HOPR and LOPR, else if the field has upper and lower limits defined they will be used, else the upper and lower maximum values for the field type will be used.

get_control_double

Sets the upper control and the lower control limits for a field. If the field is VAL, DLY, ODLY, WIDE or OWID the limits are set to HOPR and LOPR, else if the field has upper and lower limits defined they will be used, else the upper and lower maximum values for the field type will be used.

5. Record Processing

Routine process implements the following algorithm:

  1. Check to see that the appropriate device support module exists. If it doesn't, an error message is issued and processing is terminated with the PACT field still set to TRUE. This ensures that processes will no longer be called for this record. Thus error storms will not occur.
  2. The values for STV and GATE are then fetched.
  3. Call write_pd routine.
  4. PFLD is reset to zero.
  5. If device support set PACT to TRUE, then return.
  6. Set UDF to FALSE.
  7. Check to see if monitors should be invoked.
  8. Scan forward link if necessary, set PACT FALSE, and return.

6. Device Support

Fields Of Interest To Device Support

Each record must have an associated set of device support routines. The primary responsibility of the device support routines is to issue commands to the output device. The device support routines are primarily interested in the following fields:

----------------------------------------------------------------------------------------
Name  Summary              Description                                                    
----------------------------------------------------------------------------------------
OUT   Output Link          This field is used by the device support routines to locate    
                           its output.                                                    
WIDE  Pulse Width          Device support must use WIDE for pulse width                   
DLY   Pulse Delay          Device support must use DLY for the delay after trigger        
                           edge until beginning of pulse.                                 
LLOW  Low Logic Level      Device support must use to determine logic low level.          
UNIT  Time Units           All values that refer to time measure will be in this time     
                           unit.                                                          
VAL   Value                This field will contain a 1 if a trigger occured since the     
                           last time the record was processed if the device supports      
                           it.                                                            
PFLD  Processing Field     This field is used by some devices to indicate if the record   
                           was scanned to adjust certain fields such as delay or          
                           trigger source.  If the device has a destructive read, then    
                           changes to these types of fields will only could writes to     
                           the device instead of a read and a write.                      
TTYP  Trigger Type         This field is used by the device support routines to force     
                           triggering on leading or falling edge of signal if the         
                           specified device supports it.                                  
HTS   Hardware Trigger     This field wil be used to set the hardware trigger source if   
      Source               the device supports it.                                        
STV   Soft Trigger Soure   This field will be used for software to trigger an output      
                           delayed pulse if the device supports it.                       
CEDG  Clock Signal Edge    This field is used by the device support routines to force     
                           clock timing on leading or falling edge of signal.             
CTYP  Clock Type           If CTYP is external, device support is responsible for         
                           using ECR for the clock rate and if CTYP is internal, ECS      
                           is the clock source.                                           
ECS   External Clock                                                                      
      Source                                                                              
ECR   External Clock Rate                                                                 
----------------------------------------------------------------------------------------

Device Support Routines

Device support consists of the following routines:

report

  report()
This routine is optional. If provided, it prints a report of all device modules.

init

  init()
This routine is called once during IOC initialization.

init_record

  init_record(precord)
This routine is optional. If provided, it is called by the record support init_record routine.

get_ioint_info

  get_ioint_info(int cmd,struct dbCommon *precord,IOSCANPVT *ppvt)
This routine is called by the ioEventScan system each time the record is added or deleted from an I/O event scan list. cmd has the value (0,1) if the record is being (added to, deleted from) an I/O event list. It must be provided for any device type that can use the ioEvent scanner.

write_pd

  write_pd(precord)
This routine issues commands to the output device.

 
Table of Contents Next Chapter