Uncertainty Regarding Structured Text Execution Sequence in Rehabilitation Project

Question:

Hello, good morning. I am currently working on a rehabilitation project and need to repurpose some parts of existing code that are essential for the calculation involving three instruments and certain coefficients. Structured Text is not my primary language of choice due to client preferences for LD and FBD. Despite this, I am facing some uncertainties regarding the methodology used in the code. One concern is the placement of the Energy_Kinematic_Global calculation and its usage in the script. Additionally, the combination of the Hn IF/THEN statement with the calculation raises some doubts. Is it common practice to implement a limiter using the same tag in this context? During testing (without Q, P1, P2 values), I observed a discrepancy in the Hn value displayed on InTouch. Even though it shows 25.000, there are occasional fluctuations to 2.208. Can someone clarify the purpose of the Q**2 operation in this context? Thank you for your assistance. Here are the relevant code snippets: K1 is set to 10.197; C1 is set to -0.82; Q is linked to TUR_FT13; P1 is calculated as TUR_PT15 divided by 100; P2 is calculated as TUR_PT16 divided by 100. The Hn value is determined by ((P1 - P2) * K1) + C1 + Energy_Kinematic_Global, and Energy_Kinematic_Global is calculated as (Q**2)/274. There are conditional statements to limit Hn between 25.0 and 68.0.

Top Replies

Have you ever wondered about the Q**2 operation? It is simply the square of Q, which is equivalent to Q multiplied by itself.

In the provided code snippet, there are a couple of points worth noting. Firstly, the order of calculations for **Energy_Kinematic_Global** and Hn seems peculiar, as Hn is calculated based on the Energy value. This setup means that Hn relies on the previous scan cycle's Energy value calculation, potentially introducing a slight delay. While this may not have a significant impact in the long run, it could be intentional or a typo. Additionally, the ** symbol in the code represents exponentiation, equivalent to Q^2, indicating that it squares the value of Q.

When using limiters like Q**2 being squared, it is important to note that they are typically not applied to the same tag as the HMI. The HMI communicates with the PLC and processes asynchronous polls during logic scans, which may result in the HMI registering the value before the limiter is activated, causing a momentary fluctuation in the value. The reason for calculating kinetic global after Hn could be intentional or accidental, resulting in Hn lagging behind Kinetic by one scan. This sequence of events may vary depending on the system configuration.

The Hn value is not just sent to the HMI; it is also used in a lookup table to adjust the "main" setpoint for a brief moment, triggering a system response. While this adjustment may be minor, I will work on improving it. It is puzzling why Energy_Kinematic_Global is being utilized in this manner. Initially, I assumed it was intentional, but upon further reflection, it seems unnecessary to delay the scan unnecessarily. This process seems to be moving at a slow pace. Thank you for your input.

Drbitboy questioned the dynamic nature of the TUR_?Tnn inputs. Can you clarify further regarding this aspect?

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. What is the significance of the Energy_Kinematic_Global calculation in the structured text code for the rehabilitation project?

Answer: - The Energy_Kinematic_Global calculation plays a crucial role in determining the Hn value in the script by contributing to the overall calculation formula.

FAQ: 2. How does the IF/THEN statement interact with the calculation of Hn in the structured text code?

Answer: - The IF/THEN statement is used in combination with the calculation of Hn to implement a limiter that restricts the Hn value within a specified range.

FAQ: 3. Why is there a discrepancy in the Hn value displayed on InTouch during testing, showing occasional fluctuations to 2.208 despite being set at 25.000?

Answer: - The discrepancy in the Hn value could be attributed to the Q2 operation in the context, which might be influencing the final calculated result.

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