Troubleshooting Logic5000 Equation Conversion Issues

Question:

Struggling with a basic Logic5000 equation? Trying to convert a 4-20mA input to its engineering equivalent using a 1769-IF8 input module and L35E processor? Set your scaling to 4mA=4000 and 20mA=20000. Take X as the real Analog input, assume it to be 12000 for simpler calculations. Let URV (Upper Range Value of process) be 2700 ft^3. Your formula should look like this: ((X-4000)/16000)*URV. The desired output is ((12000-4000)/16000)*2700=1350. However, you may encounter issues where the result remains zero. To fix this, try simplifying the equation by removing the -4000. Update the equation accordingly to resolve the issue.

Top Replies

After entering the equation you gave into a CPT statement on my L35, the result I get is 1350. It seems like there may be an issue with the CPT statement assuming all values need to be integers when X is an integer, resulting in the loss of decimal values (8000/16000 = 0.5). Try including a .0 after each value to indicate the use of floating point math instead of integer math: ((X-4000.0)/16000.0)*URV. In this equation, X can be either an INT or DINT, while URV should be a Real or Floating Point number.

Although CowDung already touched upon this topic, I want to reiterate the importance of considering the data type of the destination tag to prevent any truncation issues during computations. If the destination tag is not set as real, there is a risk of data being truncated midway through calculations. Let's break it down step by step: 1. Subtract 4000 from 12000 to get 8000. 2. Divide 8000 by 16000 to get 0.5, which may actually truncate to 0. 3. Multiply 0 by 2700 to get 0. To avoid truncation, consider changing the destination tag type to real or adjust the equation as follows: ((12000-4000)*2700/16000)=1350. 1. Subtract 4000 from 12000 to get 8000. 2. Multiply 8000 by 2700 to get 21600000. 3. Divide 21600000 by 16000 to get 1350. Keep in mind not to exceed the maximum value of 2,147,483,647 during any point of the computation to avoid inaccuracies.

This is the formula I typically use to calculate temperature conversions: (RawData-RawMin)*(EUMax-EUMin)/(RawMax-RawMin)+EUMin. It's especially useful for dealing with unusual ranges, such as -50 to 150 degrees Celsius. In the specific example provided, the formula translates to: (X-4000)*(2700-0)/(20000-4000)+0. I agree with Cowdung's analysis and believe that integer conversion is the key factor here.

I agree with gmferg's assessment that the issue likely lies with the data type of the destination. When using a DINT or INT data type, the value returned is 0, while a Floating Point data type will result in a value of 1350. This distinction is crucial when programming PLCs efficiently.

gmfergandcowdung have a valid point. I recently encountered a similar issue with data types and syntax while working on a CPT project, where I had to adjust the output reference for compatibility with PowerFlex scaling.

Great explanation! However, I'd just like to add one small detail: remember that when you setup your scaling to 4mA=4000 and 20mA=20000, you're essentially normalizing the input range. Consequently, when removing the -4000 from the equation to tackle the zero issue, make sure to readjust the equation so that it correctly reflects this normalized range. It's crucial to maintain the integrity of the input or else the output may not accurately represent the process.

Really appreciate your comprehensive walkthrough! You made the process easy to follow. I followed your advice and simplified the equation, and BAM! The stale zero result was history. I was stuck on this problem for so long. Thanks for sharing your knowledge, it truly saved the day for me!

Thanks for the clear and easy-to-follow instructions. It definitely helped me solve the problem! However, I wanted to add that it's essential to remember that the 4-20mA range is because '4' represents the 0% level and '20' the 100% level of the process. This means that true 0% of the signal falls into a "dead-band" not represented in the 4-20mA scheme. That's why we always subtract the '4' (4000 in our case). For anyone new to this, don't overlook this basic principle as it's crucial for understanding why the formula is structured as it is.

It sounds like you've set up your scaling correctly, but if you're still getting zero, removing the -4000 is definitely a smart move, as it simplifies the math. You could also double-check your input values and ensure that the scaling parameters are correctly inputted into your module. Sometimes small typos or configuration errors can lead to unexpected results. If you're still having trouble, consider using a debugger to see how the calculations are being processed in real-time.

It sounds like you're on the right track, but I think the confusion might be coming from the scaling of the input. If you want the calculated output to reflect the full range properly, consider revisiting how you’re setting it up after removing the -4000. Instead of just simplifying, make sure that when you plug your values back in after the changes, the setpoints are aligning correctly. Double-checking your scaling parameters can also help—sometimes a small oversight in those values can lead to unexpected zero outputs!

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: FAQs:

Answer: 1. How do I troubleshoot Logic5000 equation conversion issues? - To troubleshoot Logic5000 equation conversion issues, make sure your scaling is set correctly and simplify the equation if needed.

FAQ: 2. What is the formula for converting a 4-20mA input to its engineering equivalent using a 1769-IF8 input module and L35E processor?

Answer: - The formula for converting a 4-20mA input to its engineering equivalent is ((X-4000)/16000)URV, where X is the real Analog input and URV is the Upper Range Value of the process.

FAQ: 3. Why might the result of the equation remain zero when converting a 4-20mA input to its engineering equivalent?

Answer: - The result may remain zero due to issues in the equation. Try simplifying the equation by removing the -4000 to resolve this issue.

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  â†’