NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Flexible DLL error code message

HI,
 
I'm using a flexible DLL Action step (C/C++ DLL). 
 
The Returned value go to a local error variable.
The result Action is set to 'If value < 0 Set Error occurred to true'
Set ErrorCode is checked.
 
Now, I get a run time error with the error code displayed.  I would also like to display an error message.  How can I do that.
I can write the messages myself based on the error code in case the dll does not return a code message (which I don't know how to check).
 
Thanks
Rafi
0 Kudos
Message 1 of 4
(3,293 Views)

Hi Rafi,

If you pass the SequenceContext or step Step.Result.Error.Msg to your DLL - Function you can set a string
to Error.Msg
If an Error occures in the ErrorMessage-Popup the ErrorString will be displayed.

I hope this was you are looking for

Greetings
from the Lake of Constance, Germany

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 4
(3,288 Views)
Hi Juergen and thanks for your answer,
 
Yes, this is what I am looking for. However, this is a case where the dll is given to me, so how can I pass the Step.Result.Error.Msg ?
 
I tried to use Step.Result.Error.Msg in the post expression-- to write a message based on the error code, but it didn't work.
 
Any idea?
 
Thanks
Rafi
0 Kudos
Message 3 of 4
(3,273 Views)

Hi Rafi

Try this

Greetings

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 4
(3,243 Views)