Batch SIMULATOR

Rengas

Member
Join Date
Mar 2013
Location
Birmingham
Posts
88
HI everyone,

I have been away for a while and now I'm back again but my memory has faded a lot. The last time I was here Lancie1 was here but I see he is no longer here because he's run out of allowable posts. I hope he is back here in another name.

I have solved the problem I am posting before but I have completely forgotten how I did it so I need your help in cracking my brain open. I have spent the last 3 days thinking of how I did it but still unable to figure out.

Please look at the batch attached. My program runs up to the prox sensor then after the box is filled I need the prox sensor to deactivate so I can turn the motor on to move the box. My problem is, How do I get to turn off an input device when it's on because there is a box present.

I appreciate your help.
Cheers
 
I can't actually look at what you have because we can't do internet and PLC work on the same computer here, but I'll give you the general direction I would go with something like this. What you are looking for is an OR statement. The conveyor runs unless the box detect prox is made OR the box is done filling. With a sim you can pick how to decide when the box is done filling however you choose. Maybe flip a switch, or use a timer. Most OR statements are accomplished with branches off the main rung of logic. In this example you would need to keep the conveyor running for a predetermined amount of time so that the box will clear the box detect prox after filling is complete. Sounds like a another timer to me.... Or maybe another prox....

_____| This |________________( )
^---| OR This|-----^


As a side note to the advise from QvixoteRoux, I think latching bits are like lawyers. Only use them when you have no other choice. Otherwise, avoid them like the plague. I freely acknowledge that it is a personal bias, and not everyone agrees with me.


Hope this helps,
Will.
 
Last edited:
I can't actually look at what you have because we can't do internet and PLC work on the same computer here, but I'll give you the general direction I would go with something like this. What you are looking for is an OR statement. The conveyor runs unless the box detect prox is made OR the box is done filling. With a sim you can pick how to decide when the box is done filling however you choose. Maybe flip a switch, or use a timer. Most OR statements are accomplished with branches off the main rung of logic. In this example you would need to keep the conveyor running for a predetermined amount of time so that the box will clear the box detect prox after filling is complete. Sounds like a another timer to me.... Or maybe another prox....

_____| This |________________( )
^---| OR This|-----^


As a side note to the advise from QvixoteRoux, I think latching bits are like lawyers. Only use them when you have no other choice. Otherwise, avoid them like the plague. I freely acknowledge that it is a personal bias, and not everyone agrees with me.


Hope this helps,
Will.

Thanks very much for your suggestions. you have given me an idea what to do. My brain was overheating from thinking.
Appreciate your help. Thanks again.
 
Hi Rengas, what you are after is NEARLY shown in Lanece 01 example in the download section.
But a couple of suggestions, if you turned up at a job and found a program written as your zip, would you think that person had done a great job at enabling others to follow the process. I would suggest not, so please write comments of how the code is written, which also gives you some idea of how it all works when you see it again years later.
Now one thing that does surprise me with Lances example ( but it is not complete l think), that l think is missed by lots of people is, when you go from a full box in auto (have the scan time down at minimum so you can pick the time to change), when the box is full turn it to manual and l reckon you will be filling the floor up.
So when you have the exercise worked out, try that and then think how to get around it. Lance used timers for the early part of the exercise which l believe is wrong as the above fault will prove, as well as they are not required and that is what the proxi sw is for anyway.
I spent some time rethinking my code to stop the above problem, all examples l have seen on this problem FAIL when switching between auto and manual at that precise part of the process (this is the sort of thing you need to confirm won't happen with Bubba at the controls, with any code you my write). Now Lance 01 who is a 10,000 post legend and a student helper extraordinary may see this post (he hit 10,000 posts and pulled the pin, HI LANCE) and come back for 10,0001 to fix. I will gudie you when you get it up to that stage, or before. But you need to comment every rung so we can see what sort of logic you are using to get your result. Even if it is just to turn on/latch a internal bit( like a lot on the forum l am against latching a bit for power off/restart reasons).
This is all great practise for a professional approach to code writing, but hay l'm not sprucking my ability, which is pretty basic, but have the wisdom of reading years of posts by the gurus on this forum.
But l must admit all the gurus left it to lance 01 when it came to code writing, especially the amazing guidance he gave to students and not so students.
RIP Lance01
Regards
KD
 
Just had a very quick look at your code (l know l should have before the other post), WERE is the the STOP button, this should be the first thing in the first rung. On top of that there is NO STOP button at all. EDIT- looked at QR's response and as you can see he has a STOP button. MY preference is to have the STOP button at the start of the rung, you cant miss it or forget to put it in. STOP (most important thing in the whole program) then what makes it GO.
Also unless it is the version of Logixsim l am running (V1.61) this does not work as a HMI. My previous post is in the later part of the exercise, but the bit about comments is very prudent and should be adopted at all times (so silly buggers like me can understand your logic, or in some cases not logic).
Have you used/programed the Logixsim data tables in your code, as this is what is required to enable the software to work as a HMI simulator.
Regards
KD
 
Last edited:
Hi Rengas, what you are after is NEARLY shown in Lanece 01 example in the download section.
But a couple of suggestions, if you turned up at a job and found a program written as your zip, would you think that person had done a great job at enabling others to follow the process. I would suggest not, so please write comments of how the code is written, which also gives you some idea of how it all works when you see it again years later.
Now one thing that does surprise me with Lances example ( but it is not complete l think), that l think is missed by lots of people is, when you go from a full box in auto (have the scan time down at minimum so you can pick the time to change), when the box is full turn it to manual and l reckon you will be filling the floor up.
So when you have the exercise worked out, try that and then think how to get around it. Lance used timers for the early part of the exercise which l believe is wrong as the above fault will prove, as well as they are not required and that is what the proxi sw is for anyway.
I spent some time rethinking my code to stop the above problem, all examples l have seen on this problem FAIL when switching between auto and manual at that precise part of the process (this is the sort of thing you need to confirm won't happen with Bubba at the controls, with any code you my write). Now Lance 01 who is a 10,000 post legend and a student helper extraordinary may see this post (he hit 10,000 posts and pulled the pin, HI LANCE) and come back for 10,0001 to fix. I will gudie you when you get it up to that stage, or before. But you need to comment every rung so we can see what sort of logic you are using to get your result. Even if it is just to turn on/latch a internal bit( like a lot on the forum l am against latching a bit for power off/restart reasons).
This is all great practise for a professional approach to code writing, but hay l'm not sprucking my ability, which is pretty basic, but have the wisdom of reading years of posts by the gurus on this forum.
But l must admit all the gurus left it to lance 01 when it came to code writing, especially the amazing guidance he gave to students and not so students.
RIP Lance01
Regards
KD

Hi Duckman,

Thanks for your advice and guidance. Your point well taken about the Zip. I thought it may be too big to allow me to post hence compressing. Also I will slow the scan cycle as you said and see what happens. I thought of using timer as well but didn't know where to start. I have been in touch with Lancie 1. He is around and I don't want to bother him with my stuff as he's found himself some work in robotics.

I'll try out what you suggested.

Thanks again
 
Just had a very quick look at your code (l know l should have before the other post), WERE is the the STOP button, this should be the first thing in the first rung. On top of that there is NO STOP button at all. EDIT- looked at QR's response and as you can see he has a STOP button. MY preference is to have the STOP button at the start of the rung, you cant miss it or forget to put it in. STOP (most important thing in the whole program) then what makes it GO.
Also unless it is the version of Logixsim l am running (V1.61) this does not work as a HMI. My previous post is in the later part of the exercise, but the bit about comments is very prudent and should be adopted at all times (so silly buggers like me can understand your logic, or in some cases not logic).
Have you used/programed the Logixsim data tables in your code, as this is what is required to enable the software to work as a HMI simulator.
Regards
KD

Point well taken agian about the stop button. I am extremely rusty as I have been away from programming PLC for at least 2 years doing other modules unrelated to PLC on my college course. Now that I have completed, I am back trying to restart as I may be needing this skill in the area of maintenance I may be working.

I did program the stop but further down the programming the program stopped working so I took it out. I thought it would be best to put it at the end of the program.

Thanks again
 
hey Duckman, I like being called QR :)


Rengas, believe me, use stop always at first and make sure stop will brake any memmorized bit or latch, thanks for rememberng logixpro, recently I had to teach bit shift to a new programmer and the bottle simulation will be nice to test his skills

I think I will have some spare time this week, so I will stay in touh in this post
 
hey Duckman, I like being called QR :)


Rengas, believe me, use stop always at first and make sure stop will brake any memmorized bit or latch, thanks for rememberng logixpro, recently I had to teach bit shift to a new programmer and the bottle simulation will be nice to test his skills

I think I will have some spare time this week, so I will stay in touh in this post

Please forgive me for being away. I usually switch between my job and coming on here when the time becomes available.
 

Similar Topics

Hi, I’m new to the forum and very new to PLCs. I’m working on a project in LogicxPro and have an issue. Any help would be appreciated. What I...
Replies
1
Views
1,834
Good Morning Programmers, I have been working on self-training using LogixPro, and I have written a program for a Batch Simulator. Its not...
Replies
16
Views
3,931
Hi Guys, So far, I have simulated this batch exercise 3 and Im having trouble with the 'continuous operation' (repeat cycle). I have tried but...
Replies
0
Views
1,741
Hey!, what's up Please, can someone help me, i have a problem with Batch Simulator (LogixPro), When I press Stop while Pump 3 is working and then...
Replies
3
Views
2,400
Any help would be greatly appreciated! I have reached my final project in my PLC class with a teacher that doesnt know what hes doing so i have...
Replies
20
Views
6,964
Back
Top Bottom