LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variables partagées entre executable et entre machine

Bonjour,

J'utilise deux variables partagées pour communiquer entre deux exécutables sur une même machine (Labview 2011).

Le reproduis ce schéma sur deux machines. Sur chaque machine, j'ai mes deux variables partagées.

La valeur de chacune d'entre elle est visible par le gestionnaire de systèmes distribués (2011).

 

Je souhaiterai utiliser une troisième variable partagée qui serait écrite par l'instance d'un exécutable sur une première machine et qui, sur une seconde machine, serait lu (avec utilisation du timeout). J'ai choisi pour chacune des trois variables la lecture /  écriture et l'option publiée sur le réseau.

Pour ma troisième variable, je souhaiterai qu'elle ne soit diffusée que par une seule machine. J'ai donc choisi l'option 'Activer les alias'  et mis l'alias d'une de mes deux machines \\sbgantlbv2\Variable partagées\Online Offline.

 

Cependant, la valeur de ma troisième variable n'est pas accessible.Ci joint copie d'écran de mon gestionnaire de systèmes distribués.

 

Quelle est la configuartion à utiliser pour une telle variable?

 

Merci

0 Kudos
Message 1 of 10
(3,716 Views)

Hello Mr_J,

 

You posted on an English section of the forum. Please write in English frow now to explain your problem.

 

I would like to clarify :

 

Your third shared variable is "Online Offline" and your problem is that this variable has no value contrary to your two other variables. Is that correct?

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 2 of 10
(3,686 Views)

Yes, this variable "Online Offline" broadcasted on the network has no value. The two others shared variable are used localy and they work fine.

 

I don't really know what options to choose to set this network broadcasted variable.

 

julien

 

0 Kudos
Message 3 of 10
(3,682 Views)

What do you mean by "broadcast by only one machine"?

 

Do you want this following scenario? :

 

One machine can read/write your shared variable. The other machines can only read its value.

 

Is that correct?

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 4 of 10
(3,677 Views)

Yes it's correct

One machine can read/write your shared variable. The other machines can only read its value.

 

Julien

0 Kudos
Message 5 of 10
(3,675 Views)

I don't understand why you use two similar shared variables (one of each machine) if you just want the variable to be written by one machine and read by the other ! For this purpose, the second machine just has to connect through the network to the shared variable stored in a library on the first one (but the variable needs to be shared on the network, just as the other ones).

Regards,

HL

 

0 Kudos
Message 6 of 10
(3,669 Views)

I want the same exe for runing on each machine. For instance, each exe is deploying the same shared variables.

 

I understand from your post that i should deploy this variable only on one machine.

If i want the same exe to do this, then i need to deploy it programmatically and not using the assistant of the application builder.

Or i could just create a librairy for this shared variable and make an exe with it and another exe without it.

 

Do i need to use the 'alias option' in the property tab and set it to the name of the hosting computer or it will work without it?

 

Do i need to change something in the *.aliases files of the exe?

 

Thank you

 

julien

0 Kudos
Message 7 of 10
(3,663 Views)

Julien,

 

In fact, you cannot do what you want with only one variable. The idea is to create two shared variables : One with read/write access and the other one in read only.

 

Let's name them "ReadWriteVariable" and "ReadOnlyVariable".

 

On the machine where you'll have to write into your shared variable, you'll use "ReadWriteVariable".

 

In the properties of "ReadOnlyVariable", you'll have to enable aliases and put the path of the "ReadWriteVariable" variable :

 

ReadOnlyVariable Properties.jpg

 

Then, on all the other machines where you have to only read the variable, you'll obviously use "ReadOnlyVariable" with the following method :

 

ReadValue VI.png

 

The function used is "Read Variable" :

 

Help Read Variable.jpg

 

So you'll have two applications. One for the machine where you write into the "ReadWriteVariable" and an other one for all the machines which will have to only read the value of your variable ("ReadOnlyVariable").

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 8 of 10
(3,658 Views)

I change my code and now shared variables are working the way i want. Here is the configuration i use:

 

Read Write.png

 

Read only.png

 

There is one more point I would like to change. I'm keeping the same exe with two different machines. I would like to deploy the shared variables 'Online ReadWrite' and 'OnlineReadOnly' on one computer only. Can i choose the shared variables i deploy depending on the computer?

 

Thanks,

 

Julien

0 Kudos
Message 9 of 10
(3,644 Views)

i would add that i needed to change the *.aliases files created on my developping computer and to change the values inside for my aliias and my IP. If you don't change it, it's not working.

[My Computer] My Computer="sbgantlbv11"

[Poste de travail] Poste de travail="192.168.26.103"

 

Julien

 

0 Kudos
Message 10 of 10
(3,633 Views)