Page 1 of 1

Database Export in a path dynamic - value in a Tag

Posted: Fri Sep 06, 2013 12:57 am
by andrea
Hello,

I ask you if with internal function Database Export (image attached) is possible to set a patch, for example an external USB memory stick but with the last directory variable keeping the name from the value in a tag.

Thank you

Andrea

Re: Database Export in a path dynamic - value in a Tag

Posted: Fri Sep 06, 2013 2:10 am
by andrea
For export the recipe I found and tried this code and seems ok

Globals.Recipe1.ExportRecipe("Recipe1.csv",@"K:\Test06092013\" + Globals.Tags.Gestione_Ticket_Number.Value.ToString() ,true);

What about similar code for AuditTrail, AlarmServer and so on?

Thank you

Re: Database Export in a path dynamic - value in a Tag

Posted: Fri Sep 06, 2013 10:46 am
by mark.monroe
You will need to query those databases and save the data to a file yourself if you want to change the export path. There is a forum post with a script example on how to query a database in iX Dev. The Script_Database_Export.zip example in the other forum post will show you how to do that. Both AuditTrail and AlarmServer data is stored in a database and you can query those database the same way you query the datalogger database. You can use the Database viewer in iX Developer to find out what the database tables are named.