09-19-2015 03:08 PM
Hi all,
I'm working on a project where i'll be logging information to an Access database (.mdb). I am trying to determine the proper procedure for opening and closing the files. I apologize for my lack of knowledge on the subject, databases are a new thing to me!
In the past I have always wrote to text files, when I needed to write, I would open the file, write and then close immediately. Would this also be the correct approach with a database file? Or should I open my connection to the database on test start and keep it open during the entirety of the test?
I need to log to the database during the test, and these tests are extremely long, possibly 3-4 months long. I want to make sure that the database can be accessed by Access if possible during the test.
Thanks!
09-19-2015 03:36 PM
09-20-2015 09:48 AM
Thanks for the quick reply!
I assume to use the process model I will need to create a custom schema in the Database Options dialog? Also, any issues doing this with the parallel process model?
I am locked into Access by the customer, wont be able to change that unfortunately.
09-20-2015 06:12 PM
09-20-2015 06:59 PM
Well... Thanks for the berating...
I have taken both TS courses, it was some time ago and I have not used any database functionality. Some concepts tend to fade when not used.
Apparently expecting help from a support forum is a lot to ask for...
09-20-2015 08:39 PM
09-21-2015 10:19 AM
Are you using the Access database for the results from the test or is it going to be used for other data?
My thoughts are: if you use it for the results, no need to modify anything. Just turn it on and away you go. Unless they have specific requirements for the tables. In that case you would need to create your own plugin or schema. That can be a bit tricky.
If you are using it for other data I would use a code module to do the database communication. I find the TestStand steps are a bit tough to use. I do think that you can call directly into .net assemblies or activex steps to talk to access through it's API. That would be harder though.
Regards,
09-22-2015 08:16 PM
Hi Jiggawax,
It will be used for test results and some other data as well. They do have specific requirements for the table, I have tried going in and developing my own schema and I agree that it is quite tricky.
When you mentione code modules, do you have any recomendations other than the TS steps or calling the ActiveX steps?
Also, going back to the original question, if I do use code modules, should I leave the connection open? Or should it be opened and closed as needed?
Thanks!
09-22-2015 08:48 PM
If it is results then I recommend using changing the schema. You would have a lot to learn to come up to speed on that as Dennis suggested.
Here is a tutorial for modifying the schema:
http://www.ni.com/tutorial/6484/en/
For the other data I would just do it in a LabVIEW step. Probably open and close within LabVIEW if it wasn't too processor intensive. You can pass the handle in and out but that's just a pain unless you need to write a lot of data quickly. OR instead you can just make the other data a result and handle it in your schema. That way you only have one thing doing the database talking. Plus the nice thing about the schema is that it will run in the Plugin which runs asynchronously to your execution. This allows you to collect data faster.
Hope this helps,
09-28-2015 10:33 AM
Couple additional things to consider with hard requirement to use MS Access:
Cheers