Sign in to follow this  
Followers 0
Bryon.Czaja

PLC Basics

6 posts in this topic

Greetings everyone,

Is there a best practice or approach in building strings using ladder logic? I am building strings using parallel rungs with the CONCAT instruction, and some predefined tags, plus some dynamic data that is converted to string.  Is it best to use a single rung? Hopefully this makes sense, as I am new to ladder logic, and the whole PLC scene, and an unsure how the program is executed. 

By the way I am using rslogix 5000.

Thanks!

Share this post


Link to post
Share on other sites

Personally, I think that the best practice is to write the code in whatever way makes it the clearest to the next person to look at it. I generally prefer rungs be small enough to fit on one screen without scrolling if possible.

If you can be clever and write it in one rung but it's difficult to decipher....be less clever and break it up so it's easier to decipher. I'm a fan of avoiding 2AM phone calls. I've been called because "the PLC is the problem" and they stumbled on a piece of code they couldn't understand so it had to be the problem even though it was completely unrelated. I try to write code defensively whenever possible.

3 people like this

Share this post


Link to post
Share on other sites
39 minutes ago, Joe E. said:

Personally, I think that the best practice is to write the code in whatever way makes it the clearest to the next person to look at it.

I'm a fan of avoiding 2AM phone calls. 

I try to write code defensively whenever possible.

I couldn't have given you a better answer than what @Joe E. said.

1 person likes this

Share this post


Link to post
Share on other sites
Quote

I've been called because "the PLC is the problem" and they stumbled on a piece of code they couldn't understand so it had to be the problem even though it was completely unrelated.

That's PLC Law #18 and #18.1!

https://forums.mrplc.com/index.php?/topic/9522-plc-law/

Share this post


Link to post
Share on other sites

Thanks all for the responses! 

Edited by Bryon.Czaja

Share this post


Link to post
Share on other sites
10 hours ago, Joe E. said:

If you can be clever and write it in one rung but it's difficult to decipher....be less clever and break it up so it's easier to decipher.

Agree 100%!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0