LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application shutting down with shared variables

I have 2 LabVIEW applications running in two pc's and there is a communication with shared variables.

i.e. one PC acting as server and another as client.

When server PC application is stopped, then client PC application is shutting down after some time.

this is because may be client is trying to read server shared variables and then, if data is not coming from server then client is shutting down.

 

I want client PC to run continuously as individual. when server PC application is stopped. And, when server is started again then client should be ready to listen server.

Please help on this issue.

 

0 Kudos
Message 1 of 11
(4,609 Views)

Then change your error handling.  It sounds like your client just stops on an error.  Change that to handle the communication error in some way and keep trying.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(4,597 Views)

For us to provide "helpful" suggestions (instead of general comments or guesses), we need to see the code running on the two machines.  Please attach actual VIs, preferably in enough detail (meaning, if a LabVIEW Project, that you compress the folder holding the Project and attach the resulting .ZIP file) for us to test your code and/or write little simulation routines to show you "something that should work".

 

Bob Schor

0 Kudos
Message 3 of 11
(4,557 Views)

Hi

here is attached example vi's. how i am doing in my project...

Run server and client. when server shutsdown then check client will shutdown or not.

As i know, client is shutting down after some time when server is stopped.

0 Kudos
Message 4 of 11
(4,538 Views)

Network Shared Variables are almost always more complex/trouble than they are worth.  You've chosen to use the "low-level" functions, which are even more difficult.

 

I've rewritten your VIs and Project.  I named the Network Variables PC1 and PC2 (to distinguish them from each other), and got rid of all the calls to the Shared Variable functions, using the Shared Variables directly (much simpler).  And, best of all, it works in both Development and Executable code.

 

Here is the new Server Front Panel and Block Diagram.  The Project is attached.

Server FP.pngServer BD.png

Bob Schor

0 Kudos
Message 5 of 11
(4,532 Views)

Hi,

I have shared sample project. But, in my real project that has more shared variables.And, that project is already in finishing stage.So, i don't want to change that way of implementation based on your suggestion.So, can you please solve this issue with low level functions only?

0 Kudos
Message 6 of 11
(4,522 Views)

What Bob did won't solve your problem.  He was showing you how he'd implement the SVs.

 

If you're comfortable with the API, I'd honesty stick with that.  It provides more ability to scale the application if you ever needed to do so.  That's much more complicated with the nodes Bob used.

 

The solution people are suggesting relates to the client (the VI you're concerned with) rather than the server (which Bob modified).  Your VI is erroring out and quitting.  Do you have an error out displayed on your Front Panel?  If so, it should be trivial to add some error handling that checks for that specific error, clears it out, and sends the last value(or whatever you deem appropriate) while retrying for a connection to the server.

0 Kudos
Message 7 of 11
(4,516 Views)

Hi,

I am not getting any error message in client after server shutdown.

The problem is that client is crashing with out any error message after some time when server shutdown.

And, we can't say the exact time when it is crashing. some times it will run 1hr and then crash.

 

So, please try to resolve this issue.

0 Kudos
Message 8 of 11
(4,509 Views)

I think that the code I sent did exactly that.  When you stop either Client or Server, the other also stops.  [Or at least that's how I remember it working when I tried it -- I'm not sure why this scheme doesn't work for you.]

 

BS

0 Kudos
Message 9 of 11
(4,505 Views)

Hi,

It doesn't work out. But, If you can tell me how to check PC1 exe is running or not from PC2(using system exec function or some other functions), then may be i can add some functionalty to solve this issue.

 

0 Kudos
Message 10 of 11
(4,485 Views)