Red Lion Graphite - Tank Level to Volume Program

Bullzi

Lifetime Supporting Member
Join Date
Jun 2012
Location
Colorado
Posts
1,530
Hi Everyone,
Got a new project where I am going to read the level of a tank via Modbus and I need to use the tank strapping chart to convert it to a volume. There is no PLC on the project just the HMI so I need to do everything with Crimson 3.1.

Here are some of the things I have done in the past with PLC's:
  • Put the Tank data into an Excel Spreadsheet and convert the tank data to a Quadratic equation. Use that equation in the program.
  • With AB CLX PLC I have also used the FGEN Function Block to calculate the volume.
The FGEN seemed to be the most accurate when compared to the strapping Chart but the Quadratic Equation was the easiest to implement.

Just looking for other ideas since the C like programming of Crimson might open up something new that I haven't tried.
Thanks in Advance for the help.
 
You could probably take the data from the strapping chart into Excel or Notepad++ and convert that to a Crimson program that populates an array tag with the values quite easily and with little effort. The resulting program might be lengthy but the computer doesn't care, only has to run it once (on startup) and you are the only person who has to see it.

I think your Crimson tag arrays can be up to 1000 elements, but limited to one dimension.

EDIT: Had some time listening to a podcast (Viva and Barnes) so I worked up an example in Crimson 3.0 so I could emulate it.
The LibreOffice Calc workbook has a column which concatenates the values to create Crimson statements that can be copied and pasted right into a program and then translated. I tested an array size of 2000 and it worked. I have a vague memory of some limitation that was less than that, but for memory tags, maybe it doesn't apply.
 
Last edited:
Thank you so much Paul!! I really appreciate the effort you put into this. It will save me a bunch of time.
 
Quick question:
If I want this program to run every x seconds how would I set up the program to do that? In the past I have always called a program with a even or tag never did it based on time.
 
Quick question:
If I want this program to run every x seconds how would I set up the program to do that? In the past I have always called a program with a even or tag never did it based on time.

There are a variety of ways. If you use the Global Actions On Tick field, the action will occur "approximately once per second". My experience with that is it is exactly once per second. I think the Red Lion docs state "approximately" due to the fact that the Display Page Update rate setting might impact that.

I try to shy away from using the Global On Tick for anything more than the most minimal actions.

I would recommend you tie the function to the raw data changing in value. No need to recalculate the result until the input changes.

In the example chelton gave us, that would be the "input" tag. On that tag Trigger tab, you can set the Trigger Mode to Change in Value and set the value field to the amount by which it must change in order to trigger the function call, and even adjust a delay before the call in milliseconds, then for the action you can insert an assignment instruction (since his program is a function that needs one input argument).

This would be the more efficient way to do it unless that raw data is changing very rapidly in which case, the Global On Tick would be more CPU friendly.

Also note that each display page has its own Actions fields including On Tick, but those only apply while that page is visible.

EDIT: adding example of data change trigger. The example added a graphical indicator for chelton's math and cleaned up some other minor things.
 
Last edited:

Similar Topics

I'm trying to use a Red Lion Cub counter (Cub5B00) as a counter and give the cub's counts to a Graphite G12 PLC/HMI to display. After about an...
Replies
1
Views
108
Does anyone know a quick answer to the difference of a red lion G10C1000 vs G10C0000. In crimson it shows an aux ethernet port. on the web site i...
Replies
1
Views
1,452
Hello all. I am struggling with an analog output from a Red Lion Graphite HMI with a GMOUT4 module. I can watch what the data should be (currently...
Replies
2
Views
1,370
I have a graphite HMI and 3 PAX panel meters. I have tried using RLC and Modbus Master drivers, 2 different cables, with and without Comm...
Replies
1
Views
1,875
Hey folks, I have a Graphite display that had water dripping inside. The display powers on to the initial graphite start up screen and then...
Replies
1
Views
1,527
Back
Top Bottom