LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

network stream startup.rtexe

I have an application that was working 2 years ago.  I put it away and now need to use it again.  I've enclosed a PPT file so you can see how the network is connected, how the project is built, and how the software is called. 

 

2 years ago I was running LabVIEW 2010 with the PXI using RT.  All the computers involved were XP.  Now I'm using LabVIEW 2012.  My development computer (which isn't in the drawings) is Win7 while the user computers are still XP.  I build stand-alone apps for my user computers. 

 

As in the past, I want my PXI to run startup.rtexe when it powers up.  This seems to work for my user communicating via Shared Variables but not for the user using Network Stream.  If I don't have startup.rtexe run at power up, but start it from my development computer manually everything works fine.  The problem seems to occur at the 'Create Network Stream Writer/Reader Endpoint' function.  Despite the fact I have used a Shared Variable to pass the correct IP Address for the machines involved, the endpoints don't seem to be created.  I have checked Distributed System Manager and the URL inputs to the functions to make sure the IP addresses are being used. 

 

What is the reason for this behavior?

0 Kudos
Message 1 of 5
(2,883 Views)

Hi Faustina,

 

I think you forgot to attach the PPT file. 

 

There is no reason that I can think of that you are experiencing this problem. Are you creating the endpoint correctly on the host VI? Could you clarify what is not working about the application? Are you getting any errors?

Scott B.
AE NI
0 Kudos
Message 2 of 5
(2,844 Views)

I am a little confused.  You have a program running in the PXI, waiting for communication from your Host PC.  You say that when you communicate via Shared Variables, the code works.  When you communicate with Network Streams, however, it fails.

 

Are you saying that you've written a single RT-LabVIEW program to be able to use either Shared Variables or Network Stream as a communication mechanism, choosing at Run Time which to use?  Wow!  I wasn't able to get both to work together -- I stuck with Network Streams for machine-machine communication.

 

BS

 

 

0 Kudos
Message 3 of 5
(2,831 Views)

for some reason I have a very hard time posting ANY file to this forum.  Is there anywhere else I can share the PPT file?

 

I am sending data to 2 different computers from the PXI.  (last time it was 3 computers).  One computer gets its data via Network Stream.  The other gets its data via Shared Variables.  I had to do this because of the quantity of data being shared.  One computer didn't need as much as the other.

 

I generate no errors.  

 

The computer that gets its data via Shared Variables works just fine.  I can see data being read and written to the Shared Variables.  It doesn't matter if startup.rtexe ran when the PXI powered up or when I manually start it.

 

The other computer that gets its dat via Network Stream only works when I manually start it.  For some reason, when the PXI powers up, the endpoints are not created/opened properly.  The computer reading data from the stream runs, but displays no data since the endpoint did not get opened correctly.  The PXI VI that writes to the stream gets stuck at the open call, like it's waiting to create the endpoint.  No error is generated, it just 'hangs'.

 

I wish I could share my PPT file because a drawing explains how the code interacts much better.  Is there a mailbox, ftp site, I could put the file?

0 Kudos
Message 4 of 5
(2,776 Views)

Here's what I did (and it works very well ...):

  1. The code is built using LabVIEW Project, with a Host and RT Target.  For purposes of this discussion, the top-level Host program I'll call "Host.vi", the top-level Remote (PXI) will be "Remote.vi".
  2. I have a Build Specification for Remote that builds Remote.rtexe.  After the Build, I set it to "Run as Startup" (so I don't, in fact, call it "Startup.rtexe", but it's the same idea).
  3. The very first sub-VI in Remote is called "Initialize Network Streams".  I use 4 streams in this application -- one is a Message Stream, Host to Remote, one is a Message Stream, Remote to Host, and the other two are data streams, Remote to Host.  One data stream is for "Events", brief happenings (like a DIO transition) that happen at a particular point in time, and the other is for "Samples", typically 16 channels of 16-bit Analog data collected at 1KHz.  The four streams are started in parallel, with 15 second timeouts, one Create Network Stream Reader Endpoint Function and three Create Network Stream Writer Endpoint Function calls.  If there is an error on any of these functions, all of the Streams are destroyed, the error is cleared, and we stay inside the While loop where this takes place.  If they all succeed, then the Streams have been established, we exit the While loop, and allow the rest of Remote to begin and run (passing out the 4 created streams, of course).
  4. We assume that the Host starts after the Remote, so that the Remote is already waiting for the Host (but you'll see it doesn't really matter).  The Host also starts by calling its version of "Initialize Network Streams".  It looks very much like the code for the Remote version.  Changes include:
    1. Reader and Writer are swapped -- Host has one Writer and three Readers, all with 15 second timeouts..
    2. I start these serially, not in parallel (not sure why/if it matters).
    3. I pass into the Create Network Stream functions the IP of the Remote PXI.
    4. All of this is done inside a For Loop having 3 iterations and a Conditional Stop.  If there is no Error, we exercise the Stop, save the newly-created Streams, and continue with Host.  If, on the other hand, we fail to connect in 3 tries (which can take a few minutes), we exit showing the Errror, which causes Host to exit (with Error).

I modelled this code on the LabVIEW Real-Time Waveform Acquisition and Logging sample project.

 

Bob Schor

0 Kudos
Message 5 of 5
(2,759 Views)