Recently We are developping a software platform using TestStand. There are some issues when developing the init module, here is the detail:
We creat a step which called a Initializing function in CVI created dll. In the dll, we need to init ten more instrments like power, switch, matrix switch , dmm, siganl generator, etc. First, we read the configuration infomation which resides in the .ini file, then use the info to init the instrument(via viOpen()). After that. we get an array of instrument handlers. we return that array back to teststand from the dll, and use it in the subsequent step, like in the clean up step, we call the viClose() to close the instrument.
Howerer, the NI salesman told me it is not best practice to transmit complex data types like array in the teststand, Instead, only the standard data type like Number and string is recommonded. It really confuse me.
So, here is my question:
- what on earth is the best practice in the situation above, should I pass the array from dll to teststand, and use that array as the handlers to manipulate the specific instrument?
- The salesman suggests me following solutions: instead of Initializing all the instruments in one dll, I should initialize instrument seperately, for examle: I dont have to init the power at the begining of the sequence file, the power should be initialized when it is used. He also said that I should conduct the standard operation in one dll function(first viOpen, then viWrite some SCPI, then viClose). Once I need to operate the power again after calling that dll function, I have to conduct the viOpen again. I really feel this solution is unnecessary yet not generic.
So, is there some best prcatice for situation above?
Thanks!