LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network Streams operate in parallel in development environment, but not after building Windows executable.

Hello,

I am running LV 2021SP1. We have older PXI RT boxes that are running the Pharlap OS.

 

The issue I am having is that my VIs that connect Network Streams in my development project behave differently than when I compile my Host VIs to Windows executables. 

I have three "Host" VIs and three RT VIs. Each has it's own Network stream definition. One pair of Host/RT VIs is for controlling a PXI DMM card. Another to control a PXIe MUX card. The last  pair will control a NI Scope PXIe-5105 card. The Network streams are created on each RT VI. The URLs are set properly: //<hostname>:<VI name w/o .exe>\<endpoint name> per the LabVIEW help description.

The endpoints are unique for each Host/RT VI pair.

 

1) In my development environment, when I deploy all the RT VIs to the same PXI box, each Host VI connects and communicates properly with it's associated VI. All three pairs of VIs can run simultaneously. No issues.

2) If I build a startup .rtexe for the PXI box and "run as startup" for the all three RT VIs as group, then I get the same result. All Host VIs in my development environment connect again simultaneously and communicate properly.

3) However, I build a separate Windows .exe for each of the Host VIs, then they cannot be run simultaneously. They seem to be competing for a connection to the PXI box. Only one compiled Host VI can connect to it's compile version within the .rtexe ( RT compiled) at a time. While one is connected to a it's network stream, the other two will receive Network Stream connection failures. If I disconnect the one that is connected, then I successfully run one of the other compile Host VIs.

 

I don't understand why there is a different behavior between Host VIs in my development environment within LabVIEW and after compilation of these Host VIs running on Windows. I checked my Host VIs build executable specs to see if there was an option or an include file that was required. I did not find anything obvious.

 

Certainly, I can combine these functions into a single file, but I'd like to be able to keep them separate, if I choose. I'd appreciate anyone's thoughts on this subject. Whether I need to change the URL for my endpoints in some way, or if there are specific steps or options in my Host VI compilations, or something else I can  try.

Cheers!

0 Kudos
Message 1 of 3
(228 Views)

Hello, @wimm10. 

 

      I suspect (but haven't tested it, and am not as knowledgeable about the details of the LabVIEW Run Time system as some of my Forum colleagues) that the problem is having two independent LabVIEW "built" LabVIEW Executables "sharing" (somehow) resources provided by the Compiler and Run Type. 

 

     A while ago, I wanted to run a dozen or so behavior testing stations equipped with a video camera and a sensor that sent short messages a few times a second over a test period of 2-3 hours.  No Real-Time platform was involved.  Most of the communication between the "Host" machine and the separate "Station" routines was via Network Streams, and as long as we didn't saturate the band with of our network connection, we didn't have any issues.

 

     As I was writing the previous paragraph, a thought occurred to me.  How big are your Front Panels of the two routines you want to run in parallel?  Let me call them "Thing 1" and "Thing 2".  Could they both fit on a single monitor screen, either side-by-side, upper-and-lower, or top-and-bottom (you only see, and can interact, with one at a time, with a control to choose what shows)?

 

     If so, you can use the technique we used in the Behavioral Project.  Make your two "independent" routines independent sub-VIs, sharing pre-allocated clones of sub-VIs that they "share", and run them in two side-by-side, two top-and-bottom, or a single "full-screen" sub-Panel (the latter means you can only interact with one-at-a-time).

 

Bob Schor

0 Kudos
Message 2 of 3
(158 Views)

Bob,

Thanks for your quick reply. The two individual front panels are small enough to fit within my window. I plan to add more VIs to support other equipment where one of them will have a large front panel.  However, I'm not quite sure that I am seeing the same issue that you experienced.

Using your concept, I wrapped all my VIs as subVIs in a single top level Host VI. The SubVIs were set to open their front panels when called and then close their panels when done. Each subVI was placed into a separate while loop and case statement with a button to open each one individually. This worked, allowing me to run the subVIs in parallel, both in my development environment and also when compiled to a Windows executable. I did not need to make any changes to the URL addresses for the Network Streams.

This tells me that there is some shared resource that can be called back by multiple VIs within the development environment, but this resource cannot be accessed by separate compiled executables. I'm not sure if this is a bug or a feature, but this is about as far as I can debug this issue. 

Please give me some time and I will respond with some example code. I'm quite busy right now, but I'd like to share an example that shows Network stream usage and also highlights this issue.

0 Kudos
Message 3 of 3
(60 Views)