do_pwm_transfer

Purpose:

Provide PWM on a Digital Out Bit.

Enter:

do_pwm_transfer <priority> <process_rate> [+c]

Where:

priority

Specify the system level task priority.

process_rate

Specify the rate at which update the PWM output.

+c

Optional. Specify this flag to indicate a critical task.

Example:

1. ctrl_specs output specification:  
# Output type   DO PWM      PWM Period or a label  PWM enable label  
#               label        containing period  
DO      air_htr_bit         35[sec]              air_htr_enab
 
2. do_specs output specification  
#chan  invert  up to 4 functional descriptions  
0     0       $-$  
#lbl  true_desc false_desc  true_event  false_event  hst  arm_dsply  
air_htr_bit  ON       OFF            $-$           $-$       OFF     OFF  
For this example, the DO bit ‘air_htr_bit’ will be used to provide a   
PWM output that will have a base period of 35 seconds.  The duty cycle  
of the PWM will be the value of the _CM control variable for the  
associated control loop and the value of the LOGICAL_VARIABLE  
‘air_htr_enab’ will be used to enable/disable the PWM output.
$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$-$$-$$-$
If the PWM is specified via do_specs, then the format of the specification is:  
#chan  invert  
0     0        PWM     period     DC_label  [enable_label]  
#label   true_desc  false_desc  true_event  false_event  hst  arm_dsply  
water_htr   ON         OFF          $-$           $-$        OFF      OFF  
where:  
PWM          = Is a new function code that indicates this bit will be used as a PWM Output bit. NOTE: If the PWM is provided  
by the Control task, the PWM function code should not be specified for the DO bit.  
period = A label whose value will be used as the base period of the PWM output. If the label does not exist it will be created. A numeric  
value may be specified. For this case, the value must also contain the time units, e.g. 30[sec].  
DC_label     = is the label of a REAL_VARIABLE that will contain desired Duty Cycle for the PWM output. If the label does not exist it will be created. A numeric value may be specified. For this case, the value must also contain units, eg. 30[%].  
enable_label = The label of a LOGICAL_VARAIBLE that is used to disable/enable the PWM output. If the label does not exist it will
be created. This is an optional argument and if not present the PWM will always be active.  
water_htr    = the label of DO bit that will provide the PWM  
The remaining fields are the standard DO specs fields.  
For example:  
#chan  invert  
0     0        PWM     htr_period     DC_water_htr  wtr_htr_enab  
#label   true_desc  false_desc  true_event  false_event  hst  arm_dsply  
water_htr   ON         OFF          $-$           $-$        OFF      OFF  
For this example, the DO bit ‘water_htr’ will be used to provide a PWM output that will have a base period as defined in the REAL_VARIABLE  
‘htr_period’.  The duty cycle for the PWM is defined in the REAL_VARIABLE ‘DC_water_htr’ and the value of LOGICAL_VARIABLE ‘wtr_htr_enab’ will be used to enable/disable the PWM output.

Notes:

This task is normally started in the go script. It is configured by either ctrl_specs or do_specs. If the control task is providing the control of the PWM duty cycle then the associated loop should have a ‘DO’ output type specified and the DO bit must be specified via ‘do_specs’.
The syntax of the DO output type for the control specs is: DO air_htr_bit period [enable_label]
where:
air_htr_bit = is the label of the DO bit that will provide the PWM output. This label must already exist and be contained in the do_specs file.

period = A label whose value will be used as the base period of the PWM output. If the label does not exist it will be created A numeric value may be specified. For this case, the value must also contain the time units, eg. 30[sec].

enable_label = The label of a LOGICAL_VARAIBLE that is used to disable/enable the PWM output. If the label does not exist it will be created. This is an optional argument and if not present the PWM will always be active.

See Also:

ctrl_specs, do_specs