11-27-2007 09:06 AM
11-27-2007 12:47 PM
I actually copied the hp34401A custom step type example that comes with Test Stand and changed the parameters to use my functions and it works OK. I guess there is some setting somewhere I need to dig out.
Next I wanted to make the step type with .NET modules. But, I get an error when I try to edit it in the Sequence editor. It says it is not a .NET object. I created a pre-step in which I create in instance of that object and assign it to a Station global but apparently this isn't the way to do it. Any idea on how to do would be appreciated.
11-29-2007 12:44 PM
11-29-2007 01:41 PM
Josh,
I think the issue is with the Edit step. Before the custom step type ever runs in a sequence the desire is to be able to edit parameters via some custom mechanism. i.e. one of the main reasons for creating a custom step type is to override and customize the parameter enter\select functionality. When a user adds a step, usually the next thing he or she does is immediately right click and select to edit it and enter parameters. When one of these custom steps is added and you try to 'edit' it, here is where the problems start. If, as you say, the .NET object will not get instantiated until the sequence is actually run, you will never be able to access it and call its functions at edit time. I guess that's why all the examples I've seen use calls to C\C++ style dlls so no objects are involved.
Clearly the problem stems from my misunderstanding of when a .NET object can and\or will be created in custom steps in Test Stand. It just seemed logical to me that one should be able to force creation of an object in a pre-step but I now know that isn't true. However, there has to be some step or event (possibly when the Test Stand environment loads for example) in which I can create any .NET objects I want to use in custom steps. Maybe I'll look into that. If it turns out to be too much trouble to do so, I will stick to doing things via direct C\C++ dll function calls. Most of our .NET modules are just wrappers of multiple C\C++ dlls anyways. If you have any more info or I'm mistaken in my thinking please let me know. Thanks again.
11-29-2007 05:05 PM - edited 11-29-2007 05:05 PM
John,
I think I understand what you need to do now.
The problem here is that the 'pre-step' only happens before the step is executed, not before it is edited. So when we try to edit it, we get these errors.
What you can use instead is a custom sub-step called "OnNewStep". This custom substep will be called whenever an instance of the custom substep is created. In your "OnNewStep" substep, you can check for the existance and validity of your object, and if it does not yet exist, create it.
You can find a little bit more information about OnNewStep here:
http://digital.ni.com/public.nsf/allkb/D94132BADCCAAD7D862572AE00741915?OpenDocument
11-29-2007 10:34 PM
11-30-2007 11:25 AM
Allen,
I'm simply trying to use .NET objects in my custom step types. But, because you can't use an object until you ceate an instance of it, my delema is when and how to create them so they will be active prior to editing a step
11-30-2007 01:40 PM
11-30-2007 03:24 PM
11-30-2007 03:28 PM