From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Run-Time error details

Hello

 

I'm writing a dll in C# 2010 and i want to fill the "Details" box in the Run-Time error popup in case of an error

I fill the ErrorMessage string in Teststand but in the popup box "Run-Time Error" it says "No details available"

How can i sent the ErrorMessage string to the "Details:" box in the "Run-Time Error" popup

 

This is an example of my C# code

 

public void LABPRN_ExecuteJob(ref bool ErrorOccured, ref int ErrorCode, ref string ErrorMessage)

        {

           

try

            {

               

        if (_sTmpFileHandle != null)

                {

                    _sTmpFileHandle.Close();

                    _sTmpFileHandle.Dispose();

                }

               

        //Rename file from .tmp to .job

               File.Move(sTmpPathName, _sJobPathName);

                _sTmpPathName = System.String.Empty;

                _sJobPathName = System.String.Empty;

            }

           

      catch (Exception ex)

            {

                ErrorOccured =true;

                ErrorCode = -1;

                ErrorMessage = ex.Message;

            }

        }

 

thanks in advance

 

Tonnie

 

0 Kudos
Message 1 of 4
(3,744 Views)

Tonnie,

 

how do you call this method? To be precise: How do you pass data by TestStand?

 

And:
Are you sure that "ex.Message" is NOT an empty string?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,708 Views)

Hello Norbert

 

I have attached the step setting to this message.

ex.Message is not an empty string. I have attached a screenshot where you can see the string

 

Tonnie

Download All
0 Kudos
Message 3 of 4
(3,705 Views)

Tonnie,

 

you are passing the wrong parameter for ErrorMessage. You have to pass "Step.Result.Error.Msg".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(3,699 Views)