12-01-2014 09:16 AM
LV2013 on Win7, LVRT2013 on PXI-8196
Blog for (mostly LabVIEW) programmers: Tips And Tricks
Solved! Go to Solution.
12-01-2014 11:29 AM
CoastalMaineBird wrote:
What I don’t understand is why the re-try succeeds. I break the other end by ABORTing the program that is running (on the PXI).So, how is it that a stopped program can allow a new connection?--------------------So, is this a bug in the PXI’s OpSys? Or just a natural consequence of the fact that it cannot do everything at once? Or is there something I’m missing?I don’t mind highlighting the light on connection breakage; it’s the extra CONNECT/DISCONNECT events that I want to avoid.And if I have to wait a while, how long do I have to wait? Is the 150 mSec a property of this particular model (PXI-8196), or LVRT2013, or what?
I suspect the correct solution here is not to ABORT the program on the RT side, but rather to provide a way for it to exit cleanly. It's not the program that's accepting a new connection, it's the operating system. My guess is that it takes a while for the operating system to clean up everything when you stop the program. Have you considered running Wireshark to capture the TCP data and watch the sequence that occurs when you abort the RT program? Try it, and post the log - I think it will help explain what's happening.
12-01-2014 12:04 PM
I suspect the correct solution here is not to ABORT the program on the RT side, but rather to provide a way for it to exit cleanly.
Well, yes, but I need to guard against contingencies.
Have you considered running Wireshark to capture the TCP data and watch the sequence that occurs when you abort the RT program?
OK, I haven't used Wireshark and am not used to chasing things to that level of detail, but attached is the log you mentioned.
There's a ton of data there, but only an ounce of information, and I don't know how to dig it out.
I suspect that it's just that the OpSys on the PXI doesn't get notified that the program has quit until 130+ mSec later, but the host is able to notice the connection death and retry it before then.
The only solution I see is to wait for something longer than any reasonable (heh!) system would take (I have to handle multiple models of controllers ) before attempting to reconnect.
Not difficult to do, but I need to know what I'm dealing with.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-01-2014 01:18 PM
You're right, there's too much information in that log - I can't quickly see what's going on and don't have time to dig into it. If possible I'd suggest that you not start the log until just before you abort the RT application, and perhaps that's what you've already done - although looking at the log I can see a transfer of what looks like the ni-rt.ini file as well as an XML configuration file, so I'm guessing that you started the log earlier.
12-01-2014 01:25 PM
You're right, there's too much information in that log
What I said was there's too much data and not enough information. 😉
Yeah don't mess with it.
I forgot to detail what I had done:
--- I reverted the code to show the problem again.
--- I started the host
--- I started the WireShark log
--- I started the PXI program.
--- I aborted the PXI program.
--- I stopped the log.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom." --- Clifford Stoll
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-01-2014 04:11 PM - edited 12-01-2014 04:28 PM
Not sure, but could the issues in this LAVA thread with regards to the NaN/Path/Ref have to do with it? My guess is no just glancing at things here (nothing looks to be in parallel), but I wanted to bring it up just in case.
Edit: read things a little closer and now I see what you're saying. This, then, isn't the issue. But, I will leave the link anyways.
12-01-2014 04:28 PM
Thanks for the link, GregFreeman, but I don't think that is involved. I don't have a race condition, in the classic sense. I have no parallel thread to look at the RefNum.
Although it is worth knowing that the Not-A-Refnum operator actually validates the thing (taking time), it's not just testing for 0, like I thought.
Thanks.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-01-2014 04:34 PM
@CoastalMaineBird wrote:
Thanks for the link, GregFreeman, but I don't think that is involved. I don't have a race condition, in the classic sense. I have no parallel thread to look at the RefNum.
Although it is worth knowing that the Not-A-Refnum operator actually validates the thing (taking time), it's not just testing for 0, like I thought.
Thanks.
Yes, and the fact that between the time you check the refnum and the time your case structure executes, the refnum could have gone invalid.
12-01-2014 06:50 PM
Not a refnum just tells you if you have a valid refnum, it doesn't tell you you have a valid connection. From memory doing a TCP read is a pretty good indicator and will give you an error on bad connections.
12-01-2014 07:07 PM
Not a refnum just tells you if you have a valid refnum, it doesn't tell you you have a valid connection.
Sure, I understand that. What I didn't know was that the test for Not-a-RefNum is NOT a simple test for zero, but a search thru some table somewhere.
It doesn't pertain to my orginal problem but it's interesting to know, nonetheless.
Blog for (mostly LabVIEW) programmers: Tips And Tricks