NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

teststand open database step type modification using DotNet

Dear all,

 

I am currently looking at ways to change the default means by which TestStand manages database connections and operations to a SQL database. By default, TestStand uses Oledb to connect to any database. However, I would like to use .Net class sqlconnection to open/close and manage connections because of its performance advantage over Oledb. 

 

I have been looking at the provided source code for the database step types (written in CVI) and also researching on how to appropriately call managed code/methods (.Net C#) into unmanaged code (CVI). I would like to (ideally) be able to open a connection via Class Sqlconnection(from .Net), somehow maintain the instance of the class created, and close the connection when the appropriate operations are complete. Marshalling the required object is not possible between managed and unmanaged codes (CVI is not object oriented?) so i would like to find an alternative means of maybe creating a handle for the class and keeping it alive in memory until i manually free it. 

 

Should i be looking also at the DotNet wrappers that come with test stand? any suggestion on a better way of doing this? 

 

I may be totally heading in the wrong direction so any guidance would be most appreciated.

 

Thank you 

0 Kudos
Message 1 of 5
(3,597 Views)

Hello muttonhead,

In order to best answer you question it would be useful to know why you want to do this and what is the end application/goal.

For instance if you just wanted to use the .NET classes to talk to a database during a test sequence, then you could just call those classes from a .NET step in your sequence.  If it was something you would use frequently then you could even make reusable sequences that create/close connections and do the read/write steps.  Those would be much simpler implementations.  If you are using database report logging and wanted to convert that process to .NET then your solution may be the correct process.  If you could just give us a little insight into the motivations behind this idea then I think we can give you a better answer as to whether or not this is a good solution.

John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,578 Views)

Dear John,

 

Thank you very much for your prompt and helpful reply.

 

Our company is a custom automation solutions provider and we are tailoring a medical test application for a client in the medical field. We are integrating biometrics identification and authentication into our solution in order to be 21 CFR Part 11 compliant. Part of the compliance means that there cannot be any clear text username/password used in any part of our solution.

 

So what we hope to do is to change the default process model of test stand to restrict what it can and cannot do. We would like to prevent the test stand sequence writers (our client will write their own test sequences) to have any means of bypassing biometric authentication (i.e via username/password). This means we would either need to completely remove test stand's current open/close connection step types (and rewrite our own in .Net), or, modify the current implementation of test stand database step types (as per my previous post description).

 

.Net sqlconnection class provides the necessary option of using windows identification to open a sql connection. It also (by my understanding) executes 2.5 times faster compared to Oledb connections.  

 

We are an Alliance member and our Alliance coordinator is Jeremy Taylor. I am posting on this developer forum to gain input from anyone who might have experience in this area and for whoever who will be doing similar projects to ours in the future. 

 

Thank you for your time.

0 Kudos
Message 3 of 5
(3,568 Views)

Dear all,

 

can anyone tell me which dll has the database steptypes? as in after i compile the source code, which dll should i be replacing?

 

Thank you 

0 Kudos
Message 4 of 5
(3,517 Views)
That's pretty simple to find out. Just go to the Types editor (Ctrl-T), select NI-DatabaseTypes.ini and double click any of the database types. Go to the SubSteps tab of the properties page. It lists TSDBComponents.dll and it's an ActiveX/Com step type which says to me that is was not CVI used to create the dll.
0 Kudos
Message 5 of 5
(3,510 Views)