LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging Shared Variables with Desktop PCs

I am attempting to write a client-server program in LabVIEW 8.0 that send commands and parameters from the server on the Host PC to the client on an RT target that will initialize and carry out DAQmx tasks. This process has been exquisitely painful, and perhaps I shall post about it later.

First, though, I want to take one last swing at debugging it using some desktop PCs running Windows XP, so I can watch exactly what is going on. Is it not possible for one desktop PC to connect to shared variables published on another desktop PC? If so, how does one establish the connection? I presume that one cannot specify a desktop PC as a target unless it is running LabVIEW RT.
0 Kudos
Message 1 of 22
(5,837 Views)
kehander,

My name is Mike from National Instruments. In regard to your question, you should be able to publish your shared variables to the network from one computer and read them another desktop. I would first make sure that both computers are on the same network and that they can communicate (try pinging one computer from the other). At that point, you should be able to create your shared variables and access them on both machines (see link).

Additionally, in order to target a desktop PC, the PC must not only be running LabVIEW RT, it must be a dedicated Real-Time operating system.

Using the LabVIEW Shared Variable

Using LabVIEW RT on a Desktop (ETS) PC

I hope this is useful for you! Thanks,
Mike
0 Kudos
Message 2 of 22
(5,819 Views)
So there is in fact no way for two desktop computers running Windows to share data through the shared variable engine?

I had some vague notion that things might be otherwise (what with the psp:// form of specifying shared variables), but I guess that was just wishful thinking.

I think I found the source of the problem I was trying to debug anyway.
0 Kudos
Message 3 of 22
(5,816 Views)
I am glad to hear that you were able to locate the problem. In regard to the Shared Variable Engine, this will facilitate the communication of data among shared variables across the network. This would still require that the two communicating PCs will have LabVIEW installed that are both running VIs that access a LabVIEW Shared Variable. If this is what you were attempting to do and would like additional assistance, I would be glad to help! Have a great day,

Mike
0 Kudos
Message 4 of 22
(5,802 Views)


@duffman Says: wrote:
This would still require that the two communicating PCs will have LabVIEW installed that are both running VIs that access a LabVIEW Shared Variable.




But it can't just be any two PCs, right? While they both need to have LabVIEW installed, one of them absolutely has to be an RT target running LabVIEW RT and not Windows, right?
0 Kudos
Message 5 of 22
(5,800 Views)

No! The power of shared variables lies in their ability to share data among all LabVIEW programs, regardless of whether or not one runs LabVIEW Real-Time. As long as two PCs are running LabVIEW and they have a connection to a network, they can access variables on both machines. You can give this a try with two networked computers and a simple VI on each computer that reads and writes from the same shared variable. I would again point you to the Using the LabVIEW Shared Variable white paper in the Network Published Shared Variable section. Please check it out if you want to take full advantage of the functionality that the shared variable can provide.

0 Kudos
Message 6 of 22
(5,784 Views)
I see... The image in that particular section of that document (wherein both clients are RT targets) was confusing me.

I tried the Shared Variable Client - Server example just now and couldn't seem to get it work, even after disabling the Windows XP firewall on both machines for good measure. I'm thiking that I'm supposed to alter the Command and Waveform shared variables on the Client side, selecting Bind To Source and specifying psp:\\somehost\sever\command as the path. Is this the proper way to do this? (If I select Browse, Network Items, and select the other computer, it displays the "populating node" message but never seems to finish.)
0 Kudos
Message 7 of 22
(5,777 Views)
kehander,
 
You should be able to browse the remote machine for the variables on that machine. On the server machine hosting the shared variables, you must first right-click the library and click Deploy. This will make sure that (specified) users on your network will have access to the shared variables in the library. You can verify that this is the case by opening the Variable Manager (Tools >> Shared Variable >> Variable Manager). This should list the variables hosted by the server. If you verify that these are listed, then you should then be able to browse for them when binding a client variable to that path. Please post back to this thread if you still experience trouble! Thanks.

Mike
National Instruments
Applications Engineer
0 Kudos
Message 8 of 22
(5,713 Views)
Finally, I got it to behave!

The important step was going to Tools->Shared Variable->Register Copmuter... and adding the IP address of the computer whose variables I was trying to connect to. (Previously only the computer's name appeared in the Network Items list. Some quirk of the network here seems to make IP addresses work better than names.)

After that everything seemed to work properly, though I think it was also necessary to clean out extraneous libraries from the Items list of the Variable Manager first.

So many pitfalls! But it's finished now!
0 Kudos
Message 9 of 22
(5,612 Views)

Hello all,

I am also testing the client-server example with shared variables, both client and server on my local PC (localhost).

I have a W2000pro PC, Labview 8.5 with the RT-module installed.

The client.vi and server.vi combination runs ok.

The client.vi and the server.exe combination runs ok.

The client.exe and the server.exe combination FAILS. The server.exe keeps running ok but the client.exe "hangs" without any error messages.

Is this a bug or am I doing something illegal? (what is happening?)

Kind regards,

Frank

0 Kudos
Message 10 of 22
(4,603 Views)