NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Read fileglobal to sequentialmodel from other sequence file (How to use different databases for each sequence files)

Hi, this question goes for TestStand 4.0.1

First I'd like to point out that I'm a beginner with TestStand and I'm taking care of a test system which was originally designed by someone else than me. So I might not have answers for all the counterquestions. 🙂

There were couple of similar threads which I went through, with no help... So here's my input

We're stating to test 2 different products on a same test tower (products XXX and YYY) and they use different sequence files. Now we need to log these test result to different SQL databases, which are defined as Microsoft Datalinks (XXX.udl, YYY.udl). Our TestStand is also using a custom SequentialModel.seq file. Previously (at the moment) our test towers are configured to use one and same database connection for each test sequence.

Problem here is how to define the MS datalink for each test sequence independently. Currently TestStand is using the "ConnectionString=XXX.udl" defined in the TestStandDatabaseOptions.ini file. I've tried to override it with a new "Open Database" step and define YYY.udl there, but it uses XXX.uld anyway. I've also tried to edit "Sequence file callbacks" to create "DatabaseOptions" sequence and define YYY.udl there....but still it uses XXX.udl.

When I modified ConnectionString= "empty" I got error from SequentialModel.seq because ConnectionString is not defined and apparently it's already trying to access the database. Error comes from an ActiveX/Com step named "New UUT for Database Logging" (Commented as: Notify DB Logging engine that a new UUT is starting.) I don't know if that's a custom step or some default. Is the XXX.udl 'locked' already here?

From my understanding, I'd have to define my YYY.udl in the "DatabaseOptions" sequence in the Sequentialmodel. DatabaseOptions is empty atm. If this is the solution, how can I read a variable to Sequentialmodel from my YYY.seq Fileglobals? I can't see other solutions than storing the YYY.udl as a fileglobal variable and reading it from Sequentialmodel.seq.

Other solution which came into my mind: Could I store ConnectionString in the TestStandDatabaseOptions.ini as a variable?

 

Thanks,

Mikko


0 Kudos
Message 1 of 4
(3,251 Views)

Hi Mako,

 

Does your custom process model entry point(s) contain a call to the 'Get Database Options' sequence, which contains the callback for overriding/customizing your database information? If not, overriding the callback won't do anything. It's main step group step 5 in the default model's Test UUTs entry point.

 

I'd suggest comparing the default sequential process model with your custom model and see what differences there are related to databases. That might help you figure out where the changes need to be implemented.

 

Hope this helps.

 

-Jack

0 Kudos
Message 2 of 4
(3,238 Views)

Hello Jack and thanks for the answer!

 

Yes there's a "Get Database Options" and "ConnectionString" is read there, before executing optional "DatabaseOptions". ConnectionString gets its value from TestStandDatabaseOptions.ini.

I guess I have finally reached the subject of this message and now I'd have to declare new variable which is read from the Fileglobals of my main sequence file (?)

 

eg. Parameters.DatabaseOptions.ConnectionString = 'currently open main sequencefile'.Fileglobals.Databasedirectory (=C:\TestStand\YYY.udl)

How can I accomplish this?

Message 3 of 4
(3,223 Views)

Hi Makko,

 

If you add the DatabaseOptions callback to each of your sequence files, then you can set the Parameters.DatabaseOptions.ConnectionString to your udl file directly. You can also access the by setting it to the value FileGlobals.Databasedirectory (or whatever variable you are using) while within the DatabaseOptions sequence.

 

Note that when you add the DatabaseOptions callback to your sequence, your custom process model will NOT call the DatabaseOptions sequence, so if there's anything in it that was added by your developers, you'll need to review/add it to your test sequence files DatabaseOptions sequence.

 

-Jack

0 Kudos
Message 4 of 4
(3,205 Views)