02-12-2018 08:37 AM
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
Solved! Go to Solution.
02-13-2018 05:58 AM - edited 02-13-2018 06:01 AM
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?
02-13-2018 06:28 AM
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
02-13-2018 09:22 AM
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.
02-13-2018 09:54 AM
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
02-14-2018 12:10 AM
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?
02-14-2018 02:24 AM
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
02-14-2018 04:25 AM
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?
03-13-2018 10:29 AM
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:
03-13-2018 11:04 AM - edited 03-13-2018 11:13 AM
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