Jump to content

Recommended Posts

Hey everyone,

 

  I am using a JZ10-11-R16 and I am coding a division (/) where the input can be in millions and the answer is in decimal. The "help" as a lack of information when it comes to Looping. How does it work exactly? I put the label and I jump to this label until my condition is respected?

 

By the way, if you guys know any way to have a Totalizer and a Flow indicator using a HSC and a K Factor, please let me know!

Link to comment
Share on other sites

  • MVP 2023

It's rare that you would need to program a loop on a PLC - the whole concept of the PLC operation is one big loop. Just put a contact in that indicates the condition you are looking for and it will activate when that condition is met.

 

If you already know and understand this, then I apologize, but it's important to know the fundamental operation of the PLC, which is as follows:

 

1) Read the INPUTS.

2) Execute the ladder code.

3) Write the OUTPUTS.

4) Repeat until Heat Death of the Universe.  :D

Link to comment
Share on other sites

  • MVP 2014

 

I put the label and I jump to this label until my condition is respected?

 

Yes, that is the essence of it.  As Flex727 has indicated, it is essential to understand the fundamental concept of the PLC scan.  Using a loop to some extent violates the concept of simple, repetitive scanning.  With the loop you are asking the PLC to repeat a section of ladder code over and over within a single scan.  This is good to get your loop executed quickly, but it will delay the PLC scan while the loop is executing.   If your loop gets too long, you will trigger the PLC watchdog timer.  This timer detects if the PLC scan is taking too long, and will stop the PLC if triggered.

 

Having said all this, the loop can work well for you if you can "tame the beast".

  • Upvote 1
Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.