Hi VDC,
For future TestStand posts, you may receive more answers and a more expedited manner if you post on the TestStand forum instead of the Machine Vision forum.
Does the error occur during execution, or at edit time? You indicate that the error occurs at the pre-step, which only happens at run-time, but then you mention this only happens when you try and edit it. Could you clarify the situation?
My guess is that this error is pretty indicative of the situation; it sounds like you've created an object at some point (in one of your code modules, likely the edit step) that is accessible only within the scope of the edit step. Then, when reaching the pre-step, it tries to access the same object - which is not in scope. Hence, the error you're receiving.
Best practice would be to create an object during the edit step and set it equal to a static property that you include as part of your custom step, then access this property (not the object in the edit step) from your pre- and post-steps.
I hope this helps, VDC!
Derrick S.
Product Manager
NI DIAdemNational Instruments