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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...