Troubleshooting Float Data Tag Errors in RedLion Crimson 3.0

Question:

In Crimson 3.0, I am working with a complex database where I am trying to display the sum of multiple integer values in a Float Number Tag. These integers are sent from a modular controller, ensuring they are always integer values with no issues for Crimson to interpret. By adding and multiplying these integers, I am able to display the desired Float Value. However, my challenge arises when I need to add a single value from a Modbus device address. This device, labeled Device(7).302009.Real, may or may not be connected, causing issues with my total calculation display. To address this issue, I have a flag tag indicating the device's status. I attempted to use an if statement to determine whether to add the single value from the device based on its active status. However, this approach did not yield the desired results as the value appeared as "---" when the device was inactive and the if statement failed to function correctly. In order to resolve this issue and prevent errors, I am seeking a more effective method to handle the calculation process. Is there a way to ensure that the FCor_Value tag reads as 0 instead of "---" when encountering an error? Your assistance in this matter is greatly appreciated.

Top Replies

When running a program, Crimson makes an effort to process all referenced tags, even if some may not be necessary for the program's functionality. However, if it encounters a value it cannot access, it may encounter complications. One solution is to check the "Run Anyway" checkbox in the Properties screen of your program.

If you're looking for a solution, consider using a gateway block to connect your Modbus device to a Tag instead of directly linking them. During a test without a Modbus device connected, the system recognized the absence of the value as zero. You can find more information on Adding Gateway Blocks in the manual under Using Communications.

I was able to make it function by inserting a program that checks if (FCor_Meter_Select==1), assigning NewTag:=FCor_value if true or else assigning NewTag:=0. This was done while ensuring the "run anyway" checkbox was selected. Subsequently, I utilized the Tag obtained from this program in all other related tags. Thank you for your guidance.

It sounds like you're really close to getting your setup working! One approach you might try is to use the "Tag Received" event in Crimson to check the status of your Modbus device. When the flag indicates the device is inactive, you could set the FCor_Value tag to 0 directly instead of relying on an if statement. By doing this, you can bypass the "---" issue completely. Additionally, ensure that the datatype for the tag is set correctly to avoid misinterpretations. Good luck, and feel free to share your progress!

It sounds like you're on the right track with using a flag tag for the device status! To avoid the "---" issue when the device is offline, you might want to implement a fallback mechanism in your calculation logic. Instead of directly adding the value from Device(7).302009.Real, you could first check that the device is connected and, if not, set the value to 0. This way, when the device is inactive, your calculation will still work, as you're substituting an active value for zero. You could also look into using the `ISERROR` function if it's available in Crimson, which can help catch those error states more gracefully. This should help keep your calculations consistent!

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.

You must be a registered user to add a comment. If you've already registered,
sign in. Otherwise, register and sign in.

Frequently Asked Questions (FAQ)

FAQ: 1. How can I handle errors when summing integer values with a Float Number Tag in RedLion Crimson 3.0?

Answer: Answer: One approach to handle errors is setting up proper error handling mechanisms in the script or logic controlling the calculation process. You can implement conditional statements to check for errors or missing values before performing calculations.

FAQ: 2. How can I ensure that a Float Number Tag in RedLion Crimson 3.0 reads as 0 instead of "---" when encountering an error?

Answer: Answer: You can implement conditional logic in your script to check for missing or erroneous values, and set the Float Number Tag to display 0 in such cases. Utilizing flag tags to indicate device status and incorporating them into your calculation logic can help manage error scenarios effectively.

FAQ: 3. How can I incorporate a Modbus device address into calculations without causing issues in RedLion Crimson 3.0?

Answer: Answer: When dealing with a Modbus device address that may or may not be connected, it's essential to implement robust error handling mechanisms. Utilize flags or status indicators to determine the device's connectivity status before attempting to include its value in calculations. This can help prevent calculation discrepancies and ensure accurate data representation.

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  →