Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to debug Error thrown by custom steps

Hi All,

Greetings to All.
I have created a Custom Step type which has two Pre-steps,1 Edit step and a Post step. I have used C# to develop the code modules.

When i include the Custom step as a part of Sequence file and try to edit it,the pre-step throws error and i'm unable to dubug into the code.Is there  anyways or some settings i need to do ,so that i can debug into my C# code.

The Code runs perfectly  well if i include all the Code modules used to create pre-step,edit step and post-step ass action step in the sequence file.



Thanks in advance.

Regards
VDC

0 Kudos
Message 1 of 2
(3,127 Views)
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 DIAdem
National Instruments
0 Kudos
Message 2 of 2
(3,099 Views)