LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting Citadel database without stopping engine

Hi everybody, I'm using LabVIEW 7.1 and DSC module to develop a SCADA application. I planned to periodically archive Citadel database on a remote PC (SERVICE) and delete it in the original PC (MAIN) to free space on the HD. I tried in these ways:
 
1. deleting all files in the logging dir with LabVIEW "delete.vi"
2. detaching/deleting database with the DSC "detach database.vi" or "delete database.vi"
3. archiving traces with destructive option enabled in "archive traces.vi"
4. changing current scf file to freely detach and delete the old database.
 
In any case I had to stop the tag-engine to make it work and this means to stop my application and then manually restart it (a message appears saying something like "To stop the tag-engine the following VIs need to be aborted...").
I'd like to know if there is any way to delete the database without stopping the tag-engine or to "freeze" the execution of my application while stopping the tag-engine and "unfreeze" it back when the engine is running again, I mean without closing my application and having to restart it manually.
I tried to realize this in each VI enclosing in a case structure all operations (read/write tag, alarm or event queries and so on) that requires access to the engine or the database and linking a global variable (CONNECTED) to the selector. When I want to stop the engine I turn CONNECTED to false, no tag-engine operation is executed and I can freely stop it. This works fine for one VI or two at a time, but fails when I run the complete application (one main VI loading the engine and all other VIs, one used as navigation bar, one as alarm-ack bar and many panels showing different sections of the plant to monitor).
Can anyone help me to solve this problem?
Thank you in advance!
0 Kudos
Message 1 of 7
(4,074 Views)
No one else experienced a similar need? No one can suggest a solution? Really? Pleeeeeease... Smiley Sad
0 Kudos
Message 2 of 7
(4,063 Views)


@True_Myst wrote:
No one else experienced a similar need? No one can suggest a solution? ...

True_Myst,

There are a few differences between LVDSCv7.1 which you use and LVDSCv6.1 which I've got, but I'm familiar with the "To stop the tag-engine the following VIs need to be aborted..." message.  So one suggestion until a better one appears:

In your SCADA VIs, you could use VI Server to run a seperate, independent VI which would:

1. Stop (and maybe exit) your SCADA application/VIs in a properly controlled manner;
2. Stop/exit the Tag Engine;
3. Archive the desired traces programmatically with the 'destructive' option enabled;
4. Restart your SCADA app/VIs (and the Tag Engine as well if your app doesn't do that);
5. Close itself and go away.

All programmatic and no manual intervention required. If you're unfamiliar with VI Server, the examples that ship with LabVIEW are a good place to start.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 3 of 7
(4,043 Views)
 
Hi there,
have you looked at this Tutorial --> Overview of Citadel Database Archiving Methods ?
There is an explanation as to why you are not able to play around with your DB while it is in use.
The suggestion given there is to use NI Tools to create a local archive and then copy this over to the remote machine.
Hope this helps,

AlessioD
0 Kudos
Message 4 of 7
(4,037 Views)

Hi AlessioD! Thanks for your kind answer.

My problem is deleting the original database, not copying it elsewhere. I tried creating a local copy with destructive option (as also suggested in that article), but even if I had no VIs running and no LabVIEW/DSC clients on my PC or on the network I got this error: "HIST_DeleteTraces.vi, Citadel:  (Hex 0x8ABC1004) Some data cannot be deleted because it is shared with other clients" and all the data were still there. This was due to the fact that the tag-engine was running. The only way to make it work was stopping the tag-engine.

Furthermore I noticed another strange thing in these days: the context help for Alarm & Event Archive.vi says "Use this vi to perform a destructive or non-destructive archival operation for alarms and events on a Citadel database", but (as it's clearer in the on-line help) no destructive option is available for that vi! This seems to be a bug in LabVIEW 7.1 (in 6.1 it was not like that, if I understand right).

So, even if the destructive option would work for the traces, I still would have the problem of deleting alarms&events. 

Another possible strategy is setting the "historical data lifespan" to a fixed time period and before the end of that period copying the database to the remote PC. But this is less efficient, since it doesn't take care of the actual database size on the HD. And I would still have the problem of deleting old alarms&events!

My need is to free space on the HD automatically, possibly without closing my application and loosing data from the plant, but this seems to be impossible, so at present I'm working on Donald's suggestion (many thanks to you too!), trying to minimize the "off-line" time for my application performing the back-up/HD-clean operations.

I think this is a big limitation in using the DSC module in SCADA application, because in any case I would have some data-loss when I need to delete the database after backing it up.

0 Kudos
Message 5 of 7
(4,035 Views)
P.S.: in the article that AlessioD suggested is said that "NI archive tools can only back up data on the same computer, where the source database resides", maybe this is true for DSC 6.1, but not for 7.1! I'm directly copying the database on a remote PC on the network. Hope this can be usefull for others.Smiley Wink
0 Kudos
Message 6 of 7
(4,026 Views)

I am curious and would like to see what happens on my machine.

Can you post an example that replicates the issue here so that I can see what you are actually doing?

AlessioD

0 Kudos
Message 7 of 7
(4,005 Views)