LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variables published on PC1 are not seen on PC2

Hi,

I am newbie, I might not understand correctly shared variables. We were told by teacher, that published shared variables can be accessed via network. I have created the project on PC1, created shared variables, deployed them and they are visible in the Distributed System Manager as under My System/localhost as under Network Items/"Computer1name". These shared variables are accessible on local Computer 1 and the VI in the project is working fine. 

 

My question is, why I can not see these shared variables on Computer 2 in Distributed System Manager. I see there both computers but in the Network Items there are not visible shared variables at Computer1 (published in Computer1).

 

They should not be there? It is not just simple?

 

I have tested remote panel on Computer2, and that works fine. Now I would like to create VI in Computer 2 and use the shared variables on that vi. Is that works that way? Or not?

 

Thank you for help.

0 Kudos
Message 1 of 9
(3,259 Views)

I don't know.  You haven't attached any project files so we can see how you have those variables set up!

0 Kudos
Message 2 of 9
(3,242 Views)

I will just take a second here to state that I despise Network Published Shared Variables.  They have done nothing but give me headaches (weird race conditions, slow communication, etc).  Direct TCP/IP communications is a lot more reliable.

 

With that said, you might need to be running an application/VI that uses those VIs in order for the variables to publish out into the wild.


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 3 of 9
(3,171 Views)

My experience is the same as that of @crossrulz -- every time I try them (even for something very simple, like a once-a-second "monitor"), I abandon them three days later.

 

That being said, have you read NI's White Paper on Shared Variables?  Notice that the Network Shared Variable needs a Shared Variable Engine that actually manages this.  Any PC that wants to use these variables must do so through the SVE.  Have you set up your system this way?  Do both PC1 and PC2 use the same SVE (and where is it hosted, on PC3)?

 

For more help, compress the folder holding your Project(s) and attach the resulting Zip files.  Or (better), abandon Network Shared Variables and use some form of communication for exchanging messages using TCP/IP.

 

Bob Schor

Message 4 of 9
(3,165 Views)

Thank you very much for repply and advice's.

 

Just for clarification. I will have to do a semester project and I would like use he Labview as part of the project. There will be some control system using MCU (microcontroller) and Labview will log or record some data  and user can remotly change some parameters  in control system (e.g. PID regulator parameters, turn ON/OFF something remotly). Labview will not do any fast processing stuffs.

Due to we have learned some basics of Labview programing and DSC (Datalogging and
Supervisory Control Module), I would like use DSC module as part of the project. (But if it will cause problems, I might not use it.)

So this is the main reason why I wish to use shared variables. For example just using the simple VI (without DSC) and remotely connect to it via "Operate -> Connect to Remote Panel" works fine too. I tested it already. Or I saw that there is an option ass well remotely control it via web. I have not tested it yet.

 

 

Please see attached picture and project. On the DSM.png is shown that Computer 1 shares the shared variables on the network, but thse variables are not een n Computer 2. On Computer 2 I only opened the Distributed System Manager. There is no any project created.

 

EDIT: I am reading the NI's White Paper on Shared Variables. Now I see that it will not working the way I was expected (only create a shared variables and see it on another computer). I must do it the way as it is described in point 3. of NI's White Paper on Shared Variables (Network-Published Shared Variable). I did not do it that way so far.

 

"Using the shared variable, you can share data between loops on a single diagram or between VIs across the network."

 

Yes, that what I wish to do, to share the data between VI via network.  I looks for it will take a time to read that stuff NI's White Paper on Shared Variables. I will be back later how it work, if it will work.

 

I have attached the project too.

Bob_Schor, if yo do not mind, can you please show me in example  of one shared variable e.g. Bool B01 (PC1 Readig, PC2 Writing) and FanRPM (PC1 writing, PC2 Readig). The project is made in PC1.

If it is to much work, let it be, I will sort it out.

 

 

Thanks for help to all.

 

 

 

Download All
0 Kudos
Message 5 of 9
(3,147 Views)

I am trying to do something like (see the attached picture). Read the RPM on client VI and if that will work then Send PWM data from client VI to Server VI (and in to MCU).

0 Kudos
Message 6 of 9
(3,124 Views)

In your HMI VI, I see you are writing to two Boolean shared variables, writing to a double shared variable, and reading from a double shared variable.

 

Is SerialCommunication VI the VI you run on the other PC?  If so, I don't see where you are reading or writing to any shared variables there.

Where is your VI where you do the other end of the communication of reading and writing to the shared variables?

0 Kudos
Message 7 of 9
(3,110 Views)

@romiadam wrote:

Bob_Schor, if yo do not mind, can you please show me in example  of one shared variable e.g. Bool B01 (PC1 Readig, PC2 Writing) and FanRPM (PC1 writing, PC2 Readig). The project is made in PC1.

If it is to much work, let it be, I will sort it out.


The last time I used Network Shared Variables was around 2013 for a LabVIEW RT Project talking to an RT Remote (a PXI box running PharLap, which I think served as the Shared Variable Engine).  As I mentioned, it proved to be sufficiently "flakey" that I abandoned it, and stuck with using four Network Streams (two to exchange Messages, Host to Remote and Remote to Host, and two for streaming data from Remote to Host, a Sampled stream of 16-24 channels of I16 data at 1 kHz (fairly modest) and an "on-demand" stream of "Event" data (such things as button presses and State changes).

 

I haven't looked at that (now-discarded) code in a long time.  While I think I could re-create something, it might be a better exercise for you to try doing this yourself.  I do have a PXI box sitting on my shelf -- haven't checked to see if it has up-to-date drivers installed, but I could do that, I suppose ...

 

Bob Schor

0 Kudos
Message 8 of 9
(3,094 Views)

I've used network shared variables a bunch of times and have never had problems with them.

Well, there are potential problems like if a VI looks to read variables, but the PC that is hosting the SV engine does not have the SV library deployed.  But something like that would be an expected problem.

 

Your VI seems to be doing a mixture of shared variables, but you are reading from some and writing to others in one VI, but never seem to be doing the opposite operation in the other VI.  Along with an I/O server library, (something I've never messed with before) that doesn't seem to have anything going on in it.

0 Kudos
Message 9 of 9
(3,072 Views)