Host Engineering Forum
General Category => DirectSOFT => Topic started by: Dobis on August 11, 2008, 10:14:35 AM
-
Hello, all. I fairly new to ladder logic, and need some help.
I am writing a program for a rear "rise up" wiper motor (automotive). Which means that when it is parked it moves off the glass. When it is in "wipe" mode, it moves onto the glass and a computer switches direction of the motor when X1 is to ground (smaller angle than park so that it does not go off of the glass at each wipe). I need to be able to switch direction of the motor when X1 is to ground, but also include a 25ms delay before switching direction. Then I need to repeat the switching each time X1 goes to ground.
Thank you in advance for any help. I am about to throw this thing out the window.
-
I assume this is the same question as is being answered at plcs.net. You should either stay on that forum, refer to it from here or at least provide all the information (steps, schematic) as last requested there.
-
Yes, this is the same one. I was hoping there may be a person on here that does not go to the other forum that may be able to help me. I apologize if I have wasted anyones time or resources. I am just in dire need for help.
-
Dobis,
As Bernie mentioned all the details need to be laid out on the table before starting. Correct me if I have any thing wrong.
1. You have a motor that needs reversing.
2. There is only one input. When the PLC sees this input you want to wait .02 seconds before alternating the state of the output.
3. There is only one output.
Presuming I have everything correct I think this will work. Copy and paste this text below into notepad. Then open a new project in Direct Soft File, import, program, find the notepad file and click on open.
Copy below this line
------------
PLC 06
// Rung 1
// Address 0
#BEGIN COMMENT
"This program is essentally a flip flop with a delay trigger"
""
"The timer adds 20 ms. to the time after the wiper plate is grounded."
""
"I have used V400 as the preset to the timer so that changes can be made to the preset "
"on the fly without rewriting the logic. So the value ""2"" needs to be used in V400 for this to "
"work"
#END
STR X1
TMRF T0 V400
// Rung 2
// Address 3
#BEGIN COMMENT
"The order of these next three rungs needs to be kept intact. If the rungs are placed in "
"different order the results will change."
""
"This rung is the flip bit set "
#END
STRPD T0
ANDN C1
SET C1
// Rung 3
// Address 6
#BEGIN COMMENT
"The order of these next two rungs needs to be kept intact. If the rungs are placed in "
"different order the results will change."
""
"This rung is the flip bit reset"
#END
STRPD T0
AND Y0
RST C1
// Rung 4
// Address 9
#BEGIN COMMENT
"This is the output rung. "
""
"It is considered poor practice to ""set"" and ""reset"" outputs directly"
""
"Note: if the reverse ""stutters"" or flickers when reversing. It is because the contact X1 is "
"flickering. If this happens another timer will need to be installed in the program."
#END
STR C1
OUT Y0
// Rung 5
// Address 11
END
// Rung 6
// Address 12
NOP
#BEGIN ELEMENT_DOC
"X1","","","grounded plate"
"Y0","","","reverse"
"C1","flip bit","",""
"T0","",""," X1 delay"
"CT0","_ct0","","flipflop counter"
"TA0","_TA0","","X1 delay"
"V400","preset is v400","",""
"CTA0","_cta0","","flipflopaccum"
#END
--------
Copy above this line