Click here to Skip to main content
16,019,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a software for some comperssor , and i want to turn it on after 5 seconds from getting demand for runnig , and trun it off after 5 seconds from getting demand for stop.
the delay of run works rightly , but the delay of stop does not work

What I have tried:

IF COMPRESSOR_IN = TRUE THEN
	TON_1(TRUE, t#5s);
	COMPRESSOR_OUT := TON_1.Q;	
ELSIF COMPRESSOR_IN = FALSE THEN
	TON_2(FALSE, t#5s);
	COMPRESSOR_OUT := TON_2.Q;
	TON_1(FALSE, t#5s);
END_IF;
Posted
Updated 16-Jul-18 19:56pm
Comments
Manish K. Agarwal 17-Jul-18 2:01am    
what is TON_1 and TON_2?
BaselAla 17-Jul-18 2:05am    
they are a ready block for making delay . thier inputs : bool and time . their outputs are bool and time too .
11917640 Member 17-Jul-18 2:58am    
Delay of stop does not work - this means, something is wrong in TON_2 function. You need to provide more information.
[no name] 17-Jul-18 15:07pm    
How many different values can "COMPRESSOR_IN" have? (Why "elseif" if it's a bool?)

Why is TON_2 never "turned on"?
BaselAla 19-Jul-18 8:54am    
yes , COMPRESSOR_IN is a bool .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900