01-30-2013 05:22 AM
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
01-31-2013 03:21 AM
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
01-31-2013 03:54 AM
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
01-31-2013 05:05 AM
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
01-31-2013 05:07 AM
Yes it's correct
One machine can read/write your shared variable. The other machines can only read its value.
Julien
01-31-2013 07:24 AM - edited 01-31-2013 07:35 AM
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
01-31-2013 08:09 AM
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
01-31-2013 08:33 AM
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 :
Then, on all the other machines where you have to only read the variable, you'll obviously use "ReadOnlyVariable" with the following method :
The function used is "Read Variable" :
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
02-04-2013 04:22 AM
I change my code and now shared variables are working the way i want. Here is the configuration i use:
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
02-04-2013 06:59 AM
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