Join us today!
Custom Flash Timer
Create a custom flash timer which would allow users to control the inputs below:
- On time
- Off time
- Pause time
- Total time
- Number of Flashing Before Pausing
A sample function block and the output can be seen below:
fbCustomFlash( bStart:= bStart, tOnDuration:= T#2s, tOffDuration:= T#1s, tPauseDuration:= T#4s, tTotalDuration:= T#20s, nBlinkCountBeforePause:= 3, bOut=> bPWM);
Sample output for the values below:
- On time = 1s
- Off time = 500ms
- Pause time = 3s
- Total time = 35s
- Number of Flashing Before Pausing = 4
Happy coding!
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
Like this :
@alex Thanks for sharing! Could you plot your output signal using these values :
- On time = 1s
- Off time = 500ms
- Pause time = 3s
- Total time = 35s
- Number of Flashing Before Pausing = 4
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
@alex The output should look like this:
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
Here is my Custom Flash Timer
https://github.com/evanhixenbaugh/TwinCAT-Projects/blob/main/CustomFlash.tnzip
The video is a bit messy but it functions correctly I believe
Let me know of any errors or criticism.
-Evan H.
@ehixenbaugh Nice! Maybe instead of having one FB, you could extend the function block from this example.
Could you also take a screenshot and share your output signal? It was a bit difficult to understand from the video that if the output becomes off when the total time has been reached.
The output signal for the values in the challenge:
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
Here is are my images. I had an error in my first post (I forgot to turn off the Function Block when the input signal is not active by having b_InputSignal be a condition for the IF statement in the FB), that is why in my video there is a continuous loop of pulsed signals.
In my PWM, the output signal turns off immediately when the total duration timer is has reached PT. That is why there is no signal cutoff and I have this reflected in the live snapshot of my function block.
-
Array Comparison
2 years ago
-
Measuring the scan cycle of PLC
2 years ago
-
Momentary Push Button and LED - Programming Challenge
2 years ago
-
Traffic Simulation
2 years ago
-
Adjustable Flowing LEDs - PLC Programming Challenge
2 years ago
- 17 Forums
- 267 Topics
- 924 Posts
- 1 Online
- 737 Members