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
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