PWM

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Generate a PWM signal.

Inputs

Input

Data Type

Range

Unit

Default

Description

XIN

REAL

 

 

 

Input analog value.

XinMin

REAL

 

 

 

Minimum input value.

XinMax 

REAL

 

 

 

Maximum input value.

MinPulse

TIME

 

 

 

Minimum pulseClosed When the step gets activated, the action is activated for a single execution, and possibly once again when the step is deactivated. time on output.

PeriodClosed Motor systems having a reciprocating or oscillating motor that operates synchronously with the periodicity of the source which supplies the electrical energy. The period of execution of a pipe is the time spent between two successive computations of set values for the same pipe. The period of execution of a pipe is specified by the PERIOD parameter of the input pipe block.

TIME

 

 

 

Period of the output signal.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

 

 

Blinking PWM signal.

Remarks

  • The input value is truncated to [XinMin .. XinMax] interval.
    • XinMax must be greater than XinMin.
  • The signal is TRUE during:
(Xin - XinMin) * Period / (XinMax - XinMin)

FBD Language Example

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

PWM1 is a declared instance of PWM functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. block.

PWM1 (rIn, rInMin, rInMax, tMinPulse, tPeriod);
Signal := PWM1.Q;