Red Lion CR3000 Crimson 3.1 SP/Data Change Reporting.

karldixon

Member
Join Date
Feb 2017
Location
gy
Posts
1
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do.

It would be nice if whenever a data tag was changed, I could use the change in value trigger to create a report of all the changed values that day/week (People are changing SP's and not recording that they have).

I do something similar with a switch case for logging events like below :-

cstring curdate;
cstring curtime;
int hFile;
int SendFTPServer;

hFile := OpenFile(DateString, 2);

if (hFile == 0) {
CreateFile(DateString);
hFile := OpenFile(DateString, 2);
}

curdate := CurrentDateString();
curtime := CurrentTimeString();

switch(Recordinfo)
{
case 0:
WriteFileLine(hFile ,curdate+" "+curtime+" Cycle 1 ~Product Filling STARTED");
break;

case 1:
WriteFileLine(hFile ,curdate+" "+curtime+" Cycle 1 ~Product Filling FINISHED");
break;
}
CloseFile(hFile);
SendFTPServer = FtpPutFile(0, DateString,"/CausticWash/"+ DateString, 0);



I can then get the changed value of the datatag using the AsText() function.

What I also want to be able to capture, which is where my trouble lies is what the value of the datatag was before it was changed.

Obviously the change in value trigger only fires after the value has changed.

Can any of you Red Lion wizards think of another way to do this so that I can capture the value before it was changed and the value after it has been changed.


I hope this makes sense.

Karl
 
I think your best option is to do that in the PLC in other words what ever tag is changing for example:
My_Tag <> My_Tag_Last Move My_Tag_Last, My_Tag_Last_Store, move My_Tag My_Tag_Last.
In other words before you update the change in the tag value copy the last data into another Tag, then update the last tag so in effect, you create a oneshot of the data change but before you update the last value of My_Tag you copy that into another tag, then update it, you could probably do this in the HMI in a script
So do not know RD script but something like this:
If My_Tag <> My_Tag_Prev then //If there is a change in the tag value compared to the last stored change
Do what you want....... //Put your code here do do what you need to
My_Tag_Last_Store = My_Tag_Prev //Up date the last stored previous tag val
My_Tag_Prev = My_Tag //update the previous data so the above only runs the once until the tag changes again.
 
I haven't used it, but if you look under Security under the Navigation pane, there is a Logging option for Mapped Tags, and it says it will Log Changes by User. And each Tag has a Security tab, where you can set it to Log Changes. No idea if it holds the value before the change, but worth a look.
 
If your change log is reliable, you should have the previous value already logged, right? It's the value it was changed to last time.

In the PLC, you would buffer the previous value. Something like this:
(not valid syntax in any language I'm aware of...)
Code:
if curValue <> prevValue
 then 

   <do the logging here, with date/time, curValue, prevValue>
   prevValue = curValue
endIf
 
I don't have an HMI on my desk to play with, so I couldn't check what my suggestion did. But I found a video by JoeWazoo, and Logging changes from the Security system shows who made the changes and what the values were before and after. It also logs the time and date. I think that gives you more than the 'roll your own' version was doing.

https://www.youtube.com/watch?v=LbxwGI32XUY
 

Similar Topics

Hello All, I need the ability to remotely reboot a Red Lion CR3000 HMI. Due to some graphics issues when the database is updated the HMI must be...
Replies
4
Views
221
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,122
Hi All, I am looking to install a Red Lion CR3000 HMI and connect it to a Mitsubishi FX3u 64M PLC via Serial. I cannot find confirmation on...
Replies
8
Views
2,847
Hi everyone, I have a Red Lion CR3000 HMI that I am trying to set up to send a email when there are certain alarms. So far I have had no luck...
Replies
8
Views
4,448
Hey guys, I am currently trying to set up a CR3000 to be viewed from from any where in the world. I am able to view the HMI locally (across my...
Replies
3
Views
2,158
Back
Top Bottom