![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Mar 2021
Location: Kansas
Posts: 3
|
Structured Text Pump Control
Hello,
I am new to plcs and using structured text IEC 61131-3. I want to turn off and on a pump based on level setpoints from an analog signal. I have the text. if tankLevel > HighSP then hspump1out := 0.0; elsif tanklevel < LowSP then hspump1out := 1.0; end_if; But how do I get the program to repeat? Once the level lowers to kick on the pump the program ends and does not turn off at the top setpoint. Thanks |
![]() |
![]() |
#2 |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2006
Location: UK
Posts: 6,227
|
Post a screen shot of your code running with the level greater than the setpoint. Also post how your floating point hspump1out controls the pump off/on
__________________
S7-300 to 1500 conversions done - email to s7conversions@hotmail.com |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Mar 2021
Location: Kansas
Posts: 3
|
I didn't understand floating point HS1Pumpout. It is a single digital output bit.
|
![]() |
![]() |
#4 |
Member
|
Never seen that normally it should be true or false as outputs for pumps etc. will be digital (Boolean) not floats.
The code would normally be called cyclically in a task so runs every scan. |
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: Nov 2016
Location: Fields of corn
Posts: 1,815
|
Silly question, but what platform is this? This reminds me of the OMRON (20 odd years ago) that needed an instruction to tell them to cycle the program at the end of the program. Perhaps your platform has similar?
|
![]() |
![]() |
#6 |
Lifetime Supporting Member
|
Is it ELSIF or ELSEIF in this implementation? help.codesys.com seems to use ELSIF, but there are a few occurrences of ELSEIF there.
|
![]() |
![]() |
#7 |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2006
Location: UK
Posts: 6,227
|
Here is an example showing the value of the variables when the plc is running. Your screen shot does not show any, it is a repeat of your original post in a different format.
__________________
S7-300 to 1500 conversions done - email to s7conversions@hotmail.com |
![]() |
![]() |
#8 |
Member
![]() ![]() Join Date: Jan 2017
Location: Finland
Posts: 83
|
Pump is turned ON if the value is higher than HighSp and OFF if value is lower than LowSp. My question is: what if the value is BETWEEN the low- and high limit?
Edit: You will need something like this (don't know exactly since i don't know your application) IF Level < LowSp AND level <HighSp THEN Pump:=TRUE; ELSE Pump:= FALSE; END_IF Last edited by Mara; April 7th, 2021 at 07:51 AM. |
![]() |
![]() |
#9 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#10 |
Lifetime Supporting Member
|
The program (POU in IEC speak) should be in a “task” that repeats.
__________________
nOrM ====================== nOrM=Norman Dziedzic Jr. I've never been to China but my phone has. |
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: Jun 2018
Location: Denamrk
Posts: 4
|
Alternating pump control.jpg
Perhaps this can help you on the way |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
3 pump Pressure control. | croc | LIVE PLC Questions And Answers | 7 | August 24th, 2013 09:38 AM |
fp0 structured text | iungerich1 | LIVE PLC Questions And Answers | 1 | November 26th, 2012 09:03 PM |
Strings in Logix5000 Structured Text | whumphrey | LIVE PLC Questions And Answers | 3 | November 24th, 2012 05:50 AM |
Mitsubishi Q Series Structured Text | cobra_phil | LIVE PLC Questions And Answers | 0 | April 24th, 2012 10:01 AM |
Again and again. How to start? | Alex Pel | LIVE PLC Questions And Answers | 33 | December 31st, 2004 12:10 PM |