Basic programming help

DarthRaver

Member
Join Date
Feb 2014
Location
Boddington
Posts
7
Im going to start off this thread with the old cliche im new to this (which i am) so please excuse my feeble knowledge and thanks in advance.

So i've got a simple carriage control which drives right then reaches the right limit and then returns left until left limit is reached.
I should stress that the ladder begins with a start contact through to an Rs funtion block which is resetting right limit, continuing then resetting at the left limit at the second function block.

My problem is that once the carriage has travelled right and reached its limit it then proceeds to move left towards the left limit BUT if you are to press start it will stop the carriage. i can see the problem as it is trying to run right and left and the same time? but how can i correct this?

Thanks & sorry for how much of a novice i am!
 
sadly, its not on the machine i am currently on. But i don't think i've explained it brilliantly either! its doing everything it should be apart from when pressing start whilst it is moving left it will halt the carriage. I can see this is because it is trying to operate right and left and the same time, im not sure but i think i need something to keep it false during its left transit. Maybe a timer?
GX Developer
Thanks Mark!
 
DarthRaver,

try this.
forget the machine and what its doing.
write down on paper what you want the machine to do.
expand on it by then adding sensors and outputs.

then look at the code to see how close you are.

sounds like the code is using the start pb to also stop the machine in case something goes wrong.

regards,
james
 
But i don't think i've explained it brilliantly either! Its doing everything it should be-- apart from when pressing start whilst it is moving left it will halt the carriage.
Did you mean to say that "pressing the Start pushbutton again should halt the carriage"? It should not matter whether the carraiage is moving left or right - a STOP function should always STOP the system, regardless of what the system is doing, moving left or playing Yankee Doodle, or doing anything else.

the ladder begins with a start contact through to an Rs funtion block which is resetting right limit,
"Resetting right limit" cannot be correct, because the real true Left Limit Switch and Right Limit Switch should not be ever be set or reset. Otherwise you cannot ever know what the true position of the carriage IS. Now you may have an internal latch "relay" that is set and reset, in which case you can change set or reset that latch at any time that is needed.
 
Last edited:
Thanks for the helpfull reply guys,

start . RS_Left . Drive_Right
--[]----------SET Q1 ---------------( )--
Right_limit-RESET1



Right_Limit . RS_Left . Drive_Left
---[]-------------SET Q1----------------()---
Left_Limit-RESET1


I hope this gives a better understanding. So when you start to drive right when it reaches Right_Limit and Returns left, you can stop the whole function dead in its tracks because it is trying to simutaneously trying drive right and left? Thank you Cwal61 for the interlock idea but could somebody please tell me how i could incoperate a timer function so that the start button is redundant during its left transit, or any suggestions?
Thanks in advance i WILL become a plc guru soon..
 
Ok.
Your problem is not too hard to solve. I just don't understand your 'terms'

Rs function block??? for one.

See if I understand; You press a start button and the carriage travels right until hitting the right limit switch. Then travels left until the left limit switch - then stops.

But pressing start while travelling left stops the carriage.

And you are programming in just ladder - not function block???
 
I apologise for my terms. Yes RS function block , yes that's also right but I want to be able to prevent the "Start" from stopping this by using a timer, not a kind of interlock?
 
This seems like an ideal oportunity to learn something new.

The problems that you are experiencing are why people use a state sequence rather that Set/Reset type logic. In a state sequence, only one state is active at any one time and it is also good practice to ensure that each state exists for at least one PLC cycle to allow other bits of program to inerract with it.

It generally helps to start with a pencil and paper (see attached). Each circle represents a state and each line represents a transition. You can see from the sequence that it doesn't matter if you press start when the system is already started because the start button has no influence on the transitions between state 1 and 2. The state sequence could be improved by remembering the direction of travel when stopped so the you could continue in the same direction when restarted.

My preffered method of implementing s state sequence is by use of integers and compares.

Nick

StateSeq.jpg
 
Programming a simple state sequence

The attached pictures show the basic ladder.

"Input word" and "Output word" are integer registers. State0, State1 and State2 are boolean markers/flags. The transfer from output word to input word at the end of the sequence ensures that each state exists for at least one PLC scan.

Nick

Ladder1.jpg Ladder2.jpg
 
I think your logic should look more like this:
 
| Start_Sw. Left_Limit_Sw. Right_Limit_Sw. Drive_Right |
|---| |-----------| |----------------|/|------------(S)-----|
| |
| Right_Limit_Sw. Drive_Right |
|------------------------------------| |------------(R)-----|
| |
| Start_Sw. Right_Limit_Sw. Left_Limit_Sw. Drive_Left |
|---| |-----------| |----------------|/|------------(S)-----|
| |
| Left_Limit_Sw. Drive_Left |
|------------------------------------| |------------(R)-----|
| |

 
Last edited:

Similar Topics

Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,848
Hi, I am using visilogic to control a system that i have designed. I have designed a automated color sorting mechanism using a color sensor. I...
Replies
2
Views
1,421
Hi, I am new to PLCs and would like to learn basics and possibly use them in my projects. I would like to use a PLC to generate pulses for a...
Replies
3
Views
11,330
Hello, I am new to plc programming. I am trying to program a flow meter (E&H promag 50) in somachine basic to achieve the following: 1...
Replies
5
Views
2,392
Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,368
Back
Top Bottom