Troubleshooting FSC Problems with Counting Below Threshold in Array

Question:

I am attempting to utilize the FSC for tallying the instances of numbers in my array that are below a specific threshold. However, I am puzzled as to why I am unable to make it work successfully. I have set the .IN to trigger the counter and included an unlatch for self-reset, but the count refuses to increase. Any suggestions or insights on how to troubleshoot this issue?

Top Replies

Is the first number included in the count? If it is, does the instruction reset after clearing .IN? You can improve your chances of getting help by sharing your actual logic, such as a screenshot of the rungs, so the community can see how you are attempting to achieve your goal. This will make it easier for others to provide targeted assistance for your PLC programming query.

In order to comply with legal requirements, certain elements need to be blurred out in the current development progress. Another section will be added later to retest against the "test 9" criteria for a match.

I need to create a code that sets off an alarm when the number of values below a certain threshold exceeds x. However, I am struggling to make the counter increment correctly.

In order for a CTU (or CTD) to function properly, it must detect a transition from false to true on its input signal. If the input signal remains true before the scan reaches the rung where it turns false, the FSC will set it back to true before the CTU can register it as false. This results in the counter not being able to trigger more than once every two scans unless you manipulate the internal oneshot of the counter. To resolve this issue, consider replacing the CTU with an ADD instruction that increments an integer by 1. This simple solution will allow for smoother operation and avoid the scanning limitations caused by continuous true input signals.

I'm thrilled that it worked so well, thank you! I suspected it had to do with the scan time, but I was concerned about the accuracy of the add-on.

Just a thought, have you checked whether your unlatch is triggering too quickly, thus resetting the counter before it has a chance to register the count? I've run into similar issues on the FSC before and had to adjust the timing of unlatches to get an accurate count. Another aspect to inspect could be your threshold value and how it compares to the numbers in your array. If they are not lower, the counter won't increase. Could you share a bit more detail about your setup so we can offer more specific advice?

It sounds like your logic might be stuck in its original state due to an issue with the unlatch. Try checking for the correct implementation of the unlatch sequence first. Also, ensure that the .CU and .CD instructions for the FSC are properly referenced. Incorrectly referenced instructions can often cause issues with the count not incrementing properly. Additionally, you might want to double-check your reset conditions to make sure they are not interfering with the counting mechanism. Keep trying and don't hesitate to ask if you need more assistance.

It sounds like you're implementing the steps correctly. A thought: are you making sure the 'preset' value in your FSC is set higher than the number of instances you expect? If it's lower, the counter could be getting reset before it reaches your expected value. Remember, the FSC stops counting once it reaches the preset. So set the preset value to a number that is larger than the highest possible count you anticipate. I hope this helps!

It sounds like you're really close! One thing to check is whether your condition for the .IN signal is being met consistently—sometimes, if the signal isn't stable or if there’s a timing issue, it might be preventing the count from incrementing. Also, double-check your unlatch logic; if it's resetting too quickly or not aligned correctly with the counting cycle, that could be the culprit. You might want to add some debug outputs to see the state of your signals as they trigger, which could give you more insight into where things are going awry.

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. Why is my FSC not counting the instances of numbers below a certain threshold in my array?

Answer: There might be various reasons for this issue. Make sure that the .IN is correctly triggering the counter and that the unlatch for self-reset is functioning as intended. Check for any errors in your logic or programming that could be causing the count not to increase.

FAQ: 2. How can I troubleshoot my FSC problem with counting below threshold in an array?

Answer: Start by double-checking your FSC configuration, including the trigger condition (.IN) and the reset mechanism. Verify that your array is being properly processed and that the threshold comparison is accurate. You may also want to test with simplified inputs to isolate the issue.

FAQ: 3. Are there any common pitfalls or mistakes to look out for when using FSC for tallying below-threshold numbers in an array?

Answer: One common mistake is overlooking the proper initialization of the FSC and ensuring that the count is being incremented correctly based on the threshold condition. Additionally, be cautious of any unintended resets or conflicting logic that could affect the counting process.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’