NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a sequencefile with API in the same "Execution"

Hi all,

I'm developing a steptype which parses an Excel speadsheet to build dynamicaly a sequencefile

After Sequencefile generation, I'd  like to execute this sequencefile.

For that, i'm using API functions "NewExecution" and "WaitForEndEx". And it's working.

But with this approach, runtime variables are not shared between sequence caller and called sequencefile.

 

I'd prefer to use the same "Execution" context instead of creating a new one.

In this case, I could used runtime variables in the generated sequencefile.

But I don't know how I can do...

 

Thanks in advance for your help

 

0 Kudos
Message 1 of 7
(3,166 Views)

I think there are two important questions to consider here:

  1. Do you really want to execute this sequence in the same execution? You would be able to share runtime variables this way, but you would also share model & model plug-ins (reports, databases, etc..)
  2. Do you just need to pass some variables to a new execution?

Either should be possible. For 1, you could just specify the generated sequence file by expression in a sequence call step from your generator sequence. For 2, you could use ThisContext.NewExecution instead of Engine.NewExecution and give it some sequenceArgs. I attached a modified version of this shipping example that does this - check out the "Execute New Sequence" step close to the end.

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
Message 2 of 7
(3,133 Views)

Thanks for your answer.

Finally, I choose the solution 1.

I make a new StepType (from NI SequenceCall Type). In pre step, I call the .NET code which parse Excel file and build SequenceFile.

Then the step calls the generated sequence file.

But another issue, the step tries loading generated sequence file before calling pre step which generates this file.

So I need to do with other solution.

Do you have an idea?

Thanks again for your help

 

 

0 Kudos
Message 3 of 7
(3,112 Views)

I'm continuing working on this issue.

And at the same time, I've discovered sequence file translator feature.

I think it could be the best solution.

I tried to build example with VS2017 and I get error :  "error MSB6006: Arrêt de "CL.exe" avec le code -1073741515.". Any idea about this error?

I saw 3 kinds of possible dev plateform (CVI, VS C++ and LV). Would it be possible to make a translator in .NET?

 

Many questions but I just enter in the TS world and I have to develop advanced features in the same time.

Thanks in advance for your help.

 

 

0 Kudos
Message 4 of 7
(3,098 Views)

Good news. I managed to develop a translator for my custom file format (excel).

I export .NET functions in a COM object, I developed a native DLL which use this COM object.

Now, TS editor can open my excel file like a sequence editor and I can use Sequence Call steptype (passing this excel file)

 

I'm a newbie but I start liking TS programming 😉

 

Message 5 of 7
(3,090 Views)

Nice! To make sure i understand correctly, when you say translator - you mean a sequence file translator, right?

-Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 6 of 7
(3,084 Views)

Yes that 's it.

I didn't know this feature before today.

0 Kudos
Message 7 of 7
(3,081 Views)