VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Code from custom device

Solved!
Go to solution

Hello forum

 

I am trying to get the error code of a simple soap client running as a custom device during runtime. I built the custom device according to the "Easy-Custom-Device-Tool" instructions.

 

Unfortunately passing the error code doesn't seem to work. If I wire a constant value with the same value and datatype as the error code to the output, it works (The output can only be double, hence the conversion). But the error code from the VI is always displayed as zero.

 

I see the error code from the custom device after I stop the Veristand project, however it is never output as a numeric value.

 

Any ideas?

Thanks,

Raphael

0 Kudos
Message 1 of 10
(4,827 Views)

Sorry for asking this generic question: Are you sure the error code is not 0?

To my knowledge, VeriStand should throw an error, if you pass one to error out.

 

Edit: You already answered that, but just to be clear: Do you not get an error during run-time?



Remember Cunningham's Law
0 Kudos
Message 2 of 10
(4,811 Views)

Hi Peter

I have been wondering about this myself. I am not sure there is an error during runtime, but I see that the SOAP client stops calling the server. Only later when I unload the system definition the error is displayed in the real time target and in the windows client. I only get the error if the client stopped sending, if the client kept running there is no error. So there seems to be a runtime error, but I'm only notified after unloading the definition.

Thanks,

Raphael

0 Kudos
Message 3 of 10
(4,807 Views)

I think it might be interesting to see some more of your code, as it is not really clear where the portion from your screenshot is visible.

When I take a look at the template it seems that the communication is built around the Status Notifier at the end. So, as long as your Custom Device is still running the error will not be propagated up.



Remember Cunningham's Law
0 Kudos
Message 4 of 10
(4,798 Views)

Hi Peter

 

I have attached the customised part of the Execute.vi as a screenshot. The outputs are nonsense for now and only a dummy implementation to get something. I have tried to write the error code as a part of the channel data since the error is not propagated up.

Thanks,

Raphael

 

13-02-2018 16-30-28.png

0 Kudos
Message 5 of 10
(4,793 Views)

Hi Raphael,

 

still, I can't quite figure out how you're running this code.

If I look at the architecture of the asynch custom device from the Template Tool it's basically a QDSM. The syncronous CD is at least a big case structure. I'm assuming the code you've shown was completely built by you, but where does it run?

Can you please upload your complete RT Driver VI, so I can better see what's going on?



Remember Cunningham's Law
0 Kudos
Message 6 of 10
(4,781 Views)

Hi Peter

 

this is part of the easy custom device tool, the Execute.vi contains all the code that runs during each iteration. Basically the inputs and outputs are given, I just filled the gaps..

I'll see if I can put this into context, but basically this is all the "code" I created apart from an init and shutdown VI.

 

Thanks,

Raphael

0 Kudos
Message 7 of 10
(4,777 Views)

I see what you mean now.

I can't really follow the tutorial, since the custom device template I use (2015 SP1) does not generate the files marked in red in the walkthrough.

 

With nothing cleared up, I had a thought: Maybe the code is different from 0 in the first iteration but since that fails, it is only shown briefly. After that it stays inactive and the error gets propagated only when everything finishes. Might this be the case?



Remember Cunningham's Law
0 Kudos
Message 8 of 10
(4,775 Views)

I tried a different approach now with the Print Debug String VI. This seems to be able to log to both the console and the logfile. Unfortunately I have the same problem, there is no error message even though the POST has a timeout of 10s and the host is clearly not available because I either stopped the SOAP Server, disconnected the cable or have switched off the computer running the soap server. I do see other data logged this way.

 

Bonus question: Even though I set the Attribute to display the Message in color, the text remains white. Help:

 

PrintDebugString.png

0 Kudos
Message 9 of 10
(4,637 Views)
Solution
Accepted by topic author raphael.wittwer

I see the error now. The problem seems to be that even though the default timeout is documented as 10s it really only times out after 50s.

 

I set the timeout to 1000ms now, I stopped the time from unplugging the cable to the log entry for the timeout in the console to be about 5s. Better than 50s any day!

Cheers

0 Kudos
Message 10 of 10
(4,633 Views)