NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Best Practices for using .Net code Modules

Hello,

In a sequence I have to use a .net code module that I also use outside TestStand  (in a Windows Form application). For this reason I'm currently using the code module without using the TestStand Interoperability API meaning that I do not  pass Sequence Context to my dll, I just use its function as I do in .net application. It works, I'm just wondering if it is a bad practice. 

Furthermore, I choosed to use fileglobals to sto store the object reference to my dll since it is used in many subseqeunces of the sequence, even in this case I'm wondering if it is a bad practice.

Thanks in advance,

Francesca 

0 Kudos
Message 1 of 2
(1,916 Views)

If you don't need the sequencecontext inside of a code module there is no point in passing it in.  I do this same thing all the time.  It makes your code modules more flexible (as you noted).

 

As for the FileGlobals question: I would use parameters and pass by reference.  This makes your sequences a lot more modular and could potentially exist in a separate sequence file, kind of like a "library" of sequences if you will, that can be shared by many tests.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 2
(1,839 Views)