How to Calculate Totalized Dissolved Oxygen (DO) Based on DO Probe Readings and Flow Meter Measurements

Question:

Hello everyone, I am looking for an STL code that can calculate the totalized dissolved oxygen (DO) value based on the readings from a DO probe taken every 5 seconds. The volume of liquid passing through the transfer line in each 5-second interval preceding a DO reading must be measured by a flow meter. The totalized DO value is calculated by summing the product of the DO value and the volume in each 5-second interval. The totalized volume is the sum of all volumes in each 5-second interval. The integrated DO value is then obtained by dividing the totalized DO value by the totalized volume.

Top Replies

Do you know what a PLC is? Can you tell us the brand and model number of the sensor you are using? Is the sensor compatible with I/O, 0-10 volt, 1-5 volt, or 4-20mA? What is the flow rate of the sensor? These are important questions to consider. Share your progress with us and we will happily assist you, but we won't do your work or homework for you. Thank you, James.

Are you asking about the calculation for Integrated Dissolved Oxygen (DO) value over a specific period of time, given by the formula ΣNi=1(DOi* VOLUMEi) / ΣNi=1VOLUMEi, where N represents a series of 5s intervals from a certain point in the past up to the present?

The Siemens PLC is programmed using the popular software, Simatic Manager. However, I am encountering some issues that need to be addressed: 1. The timer functionality appears to be malfunctioning. 2. The initial and final readings from the flow meter are consistently displaying the same values, making it impossible to calculate volume accurately within the 5-second timeframe. I have included my logic for review and debugging. Thank you for your assistance.

Ensure you include the full source code for both the function and function block. The interface section for the function is not included, and the closing statement for the function block is also missing.

Sounds like a fun project you got going there! Unfortunately, I don't have any pre-made STL code in store that could help you, but I would suggest you first focus on getting the data from your probes and flow meter in a structured way. I would approach it by first creating a class for the sensor readings which would hold both the readings from the DO probe and the flow meter, timestamped for every 5 seconds. Then, create a method to calculate the totalized DO and volume, as well as the integrated DO. Parsing sensor data and time sequencing it can be a challenge but it's definitely a critical step. Be sure to also plan out how you'll handle any missing or erroneous values from the sensors. I'm afraid I can't write the code for you, but I hope this gets you rolling in the right direction!

Hey there! If you're comfortable with working on STL format, I suggest you to consider exploring the integration functionalities that come by default with this framework. In the meantime, I'm wondering if using a more data analysis oriented language such as Python or R may provide additional functions that make the process a tad easier. Libraries such as NumPy in Python provide a wide range of mathematical operations to calculate these values, but I'd love to hear if you're strictly required to stick to C++? This way, I can try to assist you better.

It sounds like you're trying to calculate Weighted Average DO. While I don't have any code on hand, the logic you'd need to implement in STL might look something like this: 1. Initialize two cumulative variables total_do and total_volume as zero. 2. Iterate over all your readings. For each reading, multiply the DO and the volume together, then add the result to total_do. Add the volume to total_volume. 3. After all readings are processed, calculate the integrated DO by dividing total_do by total_volume. Use precision data types to avoid truncating float numbers and apply exception handling for divisions by zero or null values. It's essential you maintain precise timestamp records for each reading to ensure the 5-second intervals.

Hey there! It sounds like you're working on a really interesting project. While I'm not able to provide the exact STL code, I can suggest that you start by creating a loop that captures the DO readings and flow meter measurements every 5 seconds. You could use an array to store these values, and then calculate the totalized DO and total volume by iterating through the arrays after the data collection phase. Finally, just divide the totalized DO by the total volume to get your integrated DO value. If you have any specific code snippets you're stuck on, feel free to share, and maybe we can troubleshoot together!

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. How can I calculate totalized dissolved oxygen (DO) based on DO probe readings and flow meter measurements?

Answer: - To calculate the totalized DO value, you need to sum the product of the DO value and volume in each 5-second interval, then divide this total by the sum of all volumes in each 5-second interval.

FAQ: 2. What is the significance of measuring the volume of liquid passing through the transfer line in each 5-second interval?

Answer: - Measuring the volume is essential for accurately calculating the totalized DO value, as it allows for the proper integration of DO readings with the corresponding liquid flow.

FAQ: 3. How frequently should the DO probe readings and flow meter measurements be taken?

Answer: - The DO probe readings should be taken every 5 seconds, along with measuring the volume of liquid passing through the transfer line in the same intervals for accurate calculations.

FAQ: 4. Is there a specific formula or code to calculate the totalized dissolved oxygen value?

Answer: - While there may not be a standard formula, you can achieve the calculation using a code that sums the products of DO values and volumes in each 5-second interval, then divides by the total volume to obtain the integrated DO value.

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