PWM (Pulse Width Modulation)
This function block allows users to generate an artificial pulse width modulation signal, useful for controlling the timing of digital signals based on either time intervals or sample counts.
📥 Inputs
This function block does not have any input sockets.
📤 Outputs
Boolean
This output indicates the current state of the PWM signal, toggling between True
and False
.
🕹️ Controls
Interval
A labeled input field where you can set the total interval duration for the PWM signal. This defines how long one complete cycle (up and down) will take.
Up Duration
A labeled input field to specify the duration for which the signal will remain at a high state (True) within the total interval.
Time Mode
A toggle switch that allows you to choose between time-based signaling (on) or sample-based signaling (off).
🎨 Features
Versatile Duration Options
Users can choose to define PWM behavior based on either time intervals or sample counts, providing flexibility for various applications.
Real-time State Updates
The output state is updated continuously based on the specified intervals and the toggled state settings.
📝 Usage Instructions
Set Interval: Enter the desired total interval by using the
Interval
control.Set Up Duration: Specify how long you want the signal to be high during that interval using the
Up Duration
control.Toggle Mode: Switch between time mode and sample mode using the
Time Mode
switch depending on your application needs.Evaluate: Upon running the block, the output will indicate the current state of the PWM signal.
📊 Evaluation
When executed, this function block outputs a boolean signal that fluctuates based on the parameters set for total duration and up duration, simulating a PWM signal.
💡 Tips and Tricks
🛠️ Troubleshooting
Last updated