NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying Step Types in Type Palette

I've attached an example of a TestStand 3.1 sequence that creates a step type called "PSU1" and saves it in a type palette file called Instrument.ini. This works fine and creates the step type OK. However, I'd like to have the ability to modify some of the properties of the step type after it is created. If I try to re-run this sequence with some of the step type's properties modified I get the message: "An error occurred calling 'InsertType' in 'TypeUsageList' of 'NI TestStand API 3.1'. The item name 'PSU1' is invalid because it is already in use."

I realise that this occurs because the type name is now in memory. Is there a way of being able to remove the step type from memory, then re-add it again? I've tried using the TypeUserList.RemoveType method but have been unsuccessful in obtaining an index to the type within the PropertyObject I am using.

Alternatively, removing the Instrument.ini file would work for me, as I would like to create one of these when I launch TestStand based on the instrument's intalled on my PC. I haven't found a way of removing this apart from launching the TypePalette editor and manually deleting the step type, or removing Instrument.Ini from the PC.

Thanks,

David
0 Kudos
Message 1 of 3
(3,034 Views)
Hello David,

It is possible to programmatically delete your Instrument.ini file from TestStand. This can be done by inserting a C/C++ Action step at the beginning of your sequence to call the Windows kernel32.dll. The kernel32.dll has a DeleteFile function which you can call to delete your Instrument.ini file. I am attaching a sample sequence file written in TestStand 3.1 which demonstrates how to call this function. I hope that this information is helpful for you.

Regards,
Kevin L.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,003 Views)
Thanks Kevin. That's great.

Regards,

David Jackson
0 Kudos
Message 3 of 3
(2,986 Views)