Michael Lloyd

Logging History (CLX)

1 post in this topic

I'll preface this by saying that our SCADA system is fairly large. Just the stuff that I worked on over the last 6 or 7 years probably has 5,000 - 10,000 tags (mostly real, dint, and bool) per PLC and there are 55-ish PLC's. There are also 30-40-ish flow computers that have 20-30 tags each in the system. Compared to the rest of the system my part is/was fairly small. We use ClearSCADA for the HMI. Kepware for the driver. Comm is supplied by everything from VSAT to Cell Modem to 3rd party wireless, to T1. Scan times vary from 15s to 30s, longer if there is a network hangup somewhere. The system is going to grow. 

There is a need to log history once per second on a very few points and our HMI / Comm method isn't up to it. The idea to log 1 days worth of data in the PLC and move it to a "Previous Day" record at 00:00:00 has been tossed around but I haven't had time to implement anything. I started with some ideas this morning, came up with a possible solution, and tried to implement it in an AOI for simplicity. The AOI has become a stumbling block. Maybe my implementation is flawed but I think it's probably fine. 

Here's the idea:

Create a tag

We want to log things like rate of change and pressure. Lets say I want to log the pressure on PT100.PV. My History tag would be something like PT100h REAL[24,60,60] and PT100pdh REAL[24,60,60] for current and previous day logged history

MOV data to the tag

Use pointers to move data to the array based on the PLC clock H, M, and S. It probably makes sense to put the routine in a Scheduled Task. If I remember correctly the PLC clock is always at UTC unless you "fake it out". I can either leave it alone (preferred... that way daylight savings time is not an issue) or add the appropriate UTC offset to the Hours value. I haven't tried pointers in a 3D array but I don't see why it wont work. 

MOV data to previous day tag at the 00:00:00

MOV PT100h to PT100pdh at 00:00:00 and move 0.0 to the PT100h tag. I'd probably be lazy and create a Zero[24,60,60] tag with all zeros in it unless someone has a better, less memory intensive way to do it.

Foreseeable issues

86,400 floating point values x 8 bytes is a shade over 691k x 2 for previous day = almost 1.4mB. This is a real problem. One way to mitigate it, somewhat, is to do away with the Previous day tag. The HMI will log the history the actual value for each tag will be in the HMI log files

HMI load- Adding 86,400 floating point tags per PLC is going to add to the load in the system. One of the larger stations could have as many as 7 points that would be nice to historize. That's not possible due to memory constraints in the PLC that is installed there.

AOI's won't allow for tag arrays that I can see. I tried to make a tag with the 24,60,60 structure in an AOI and it didn't like it. 

 

I'm not sure if I actually have a question at this point. I'm basically thinking out loud to see what kind of feedback I'll get. The need to log is only important for "fault" analysis. 99.99% of the time the data will not be looked at. At this point I think that I've talked myself out of trying to implement this. I think the load that it would impose on the system would be too high.

On the other hand, changing the array to a Boolean data type might come in handy for capturing a Boolean "glitch" and not be quite so memory intensive. I could also set it up to capture an hours worth of data and let the HMI historian do the logging. That's still 3,600 points though. 29k-ish bytes.

Continuing with that thought, 5 minutes would only be 300 points and the HMI historian should be able to capture that. Maybe that's the way to solve the data issue? Capture X seconds (or minutes) and let the HMI historian log it?

The HMI scan time is actually the issue so using the PLC for a buffer that offsets the scan delay may be the ultimate solution.

Thoughts?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now