Table of Contents Previous Chapter Chapter 28: pulseTrain

Chapter 28: pulseTrain

1. Introduction

The normal use for the pulseTrain record type is to generate an output pulse train.

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   
PER    DOUBLE     Yes  0        Yes     Yes     Yes        No   
DCY    DOUBLE     Yes  0        Yes     Yes     Yes        No   
OPER   DOUBLE     No   0        Yes     No                 Yes  
ODCY   DOUBLE     No   0        Yes     No                 Yes  
GTYP   RECCHOICE  Yes  0        Yes     Yes     No         No   
HGV    SHORT      Yes  0        Yes     Yes     No         No   
SGL    INLINK     Yes  0        No      No      N/A        No   
SGV    RECCHOICE  Yes  0        Yes     Yes     No         No   
OSGV   SHORT      No   0        Yes     No                 No   
VAL    SHORT      No   0        Yes     Yes     Yes        Yes  
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   
HOPR   FLOAT      Yes  0        Yes     Yes     No         No   
LOPR   FLOAT      Yes  0        Yes     Yes     No         No   
PREC   SHORT      Yes  0        Yes     Yes     No         No   
LLOW   RECCHOICE  Yes  0        Yes     Yes     No         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  Units of time        Units of time (Seconds, milliseconds, microseconds,           
                           nanoseconds, picoseconds).                                    
PER   Period, in UNITs     Pulse train period.                                           
DCY   Duty Cycle, percent  Percent of time that signal is high.                          
OPER  Old Period, in       Value when last monitors for period were triggered.           
      UNITS                                                                              
ODCY  Old Duty Cycle,      Value when last monitors for duty cycle were triggered.       
      percent                                                                            
GTYP  Gate Type            This can be hardware or software.  If GTYP is hardware,       
                           then HGV determines gating control.  If GTYP is software,     
                           the SGV determines gating control.                            
HGV   Hardware Gate        This field is device dependant.                               
      Value                                                                              
SGL   Soft Gate Location   If SGL is a database link and GTYP is software, then SGV      
      (Input Link)         will be set to the value read from SGL.                       
SGV   Soft Gate Value      This can be inactive (no gating) or active.                   
OSGV  Old Soft Gate Value  This is the previous value of SGV.                            
VAL   Value                This field is not used.                                       
CTYP  Clock Type           This can be internal or external.                             
CEDG  Clock Signal Edge    This can be Rising Edge or Falling Edge.  This field forces   
                           counting 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                                                                        
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.                                                    
LLOW  Low Logic Level      Logic Low=0                                                   
                           Logic Low=1                                                   
---------------------------------------------------------------------------------------

4. Record Support Routines

init_record

This routine first checks that device support is available. If SGL is a constant then HGV is initialized with its value or a channel access link is created if SGL type is PV_LINK.

Device support is then checked to see if write_pt is defined.

If device support includes init_record, it is called.

process

See next section.

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, PER, or OPER 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 or PER 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. If SGL is DB_LINK and GTYP is Software, get SGV from SGL. If SGV has changed, save the duty cycle DCY value, call the write_pt routine with duty cycle =0, reset the duty cycle to the saved value, and set alarms if return status not zero. Then set the old soft gate value OSGV to SGV.
  3. Call write_pt routine. If device support set PACT to TRUE, then return.
  4. Set UDF to FALSE.
  5. Check to see if monitors should be invoked.
  6. 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                                                   
---------------------------------------------------------------------------------------
UNIT  Units of time        This field will be used to identify the time units used for   
                           time fields.                                                  
OUT   Output Link          This field is used by the device support routines to locate   
                           its output.                                                   
PER   Period, in UNITs     Device support must use PER for pulse period.                 
DCY   Duty Cycle, percent  Device support must use DCY for the percent of time the       
                           signal is high.                                               
LLOW  Low Logic Level      Device support must use to determine logic low level.         
CEDG  Clock Signal Edge    This field is used by the device support routines to force    
                           counting on leading or falling edge of signal.                
GTYP  Gate Type            Device support is responsible for using IGV to determine      
                           gating control if GTYP is internal, or SGV if GTYP is         
                           external.                                                     
IGV                                                                                      
SGV   Soft Gate Value                                                                    
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, in Hz                                                                        
---------------------------------------------------------------------------------------

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_pt

  write_pt(precord)
This routine issues commands to the output device. It returns the following values:

 
Table of Contents Next Chapter