06-02-2009 09:42 AM
Hi,
I have an application where I am trying to read/write a cRIO 9074 parallely from two different PCs, PC1 and PC2.
Of these, one of the PCs, PC1 acts as a publisher of shared variables. The cRIO and PC2 will be subscribers to the shared variables published on PC1.
The PC2 has only an exe of a VI running on it. This VI reads/writes to a shared variable.
But when I run the exe, I am unable to read the shared variable. I have tried to programmatically deploy the shared variables library in the exe on the PC2.
Have I done the correct thing?
How do I read write the shared variables in this case?
Has any one faced a similar situation?
Any help would be appreciated......
Thanks in advance....
Regards
06-02-2009 01:22 PM
I would recommend you go through the following article:
Using Shared Variables in Executables
Post back if you have any questions after reading through.
06-03-2009 05:54 AM
Hi,
I have gone thru the document mentioned and some more. Based on it I created a code for programmatically deploying the shared variables (pls refer attachement).
When I run the exe of this VI in the project hosting the shared variables library (PC#1), the VI runs fine. But when I use the same executable to run on the remote PC, PC#2, it doesnt work!
Where have I made mistakes?
Regards....
06-03-2009 09:53 AM
The library containing the shared variables in use by an application must be deployed on any and every machine that is using them for communication. So, remove the IP address input from your Deploy Library invoke node and just deploy the library on PC2 as well. I think that should resolve the issue.
Just to be sure, add all libraries that contain network shared variables to the Always Include (previously Support Files) list. Also, make sure to set the Destination of the library(s) to be Support Directory in the Source File Settings category. Use the Path input of the Deploy Library invoke node to point to the library(s) containing your shared variables. If the library(s) were included in the executable's Support Directory, as directed above, the library(s) will copied to the executable's data folder. Point the Path input to these library(s).
06-05-2009 03:42 AM
I discovered the following:
1: The firewall of the PC was on
2: The path pointing to the Shared variables library was incorrect
I solved all these issues, even then my original problem persists!
I am still unable to programmatically deploy the Shared variables library on the remote computer(PC#2)!
As of now I am using the evaluation version to create my exe. Could this be a probelm for deploying the shared variables? (Altough I did try to create an exe on a licensed version, problem is still the same)
06-05-2009 07:06 AM
07-27-2009 12:45 AM
Hi,
First of all, sorry for posting so late. I had got caught up in other issues of my project. Since I had some time to experiment, this is what I have done:
In my current project, I have created and deployed all the shared variables in the cRIO instead on PC#1.
Then I created an installer for the exe to be used on PC#2.
For the exe on PC#2, I created the exe using all the VIs that I run on PC#1.
I then ran the exe on PC#2. This worked! I have now been able to read/write to the shared variables parallely from two different PCs!
However, I have not programmatically deployed any library to PC#2 or in the VIs in PC#1, yet the read/write works and herein lies my problem!!
Am I correct in my approach here? I dont want the project to malfunction in future coz I missed something again.
I need advice on my approach here....
Thanks in advance...
Regards.
07-27-2009 07:26 AM
08-12-2009 02:22 AM
Hi,
Coming back after a long time!
The deployed shared variables are working fine, but now I am facing a new situation.
Currently we have establised a network among the PLCs and PCs by assigning static IP addresses to the devices and using a switch in between.
Now the end user is thinking of having the system on their plant/corporate network. This means we need to have IP addresses assigned automatically to each of the PCs and the PLC(DHCP?).
The cRIO 9074 can have dynamically assigned IP addresses, but if I were to switch from static IP address to dynamic IP address, in my current situation, what will happen to the shared variables already deployed?
What precuations do I need to take? Any surprises?
I havent tried doing this yet (scared!!). Just wanted to know if any one has done this before.
Thanks in advance,
Regards.
11-11-2009 04:33 AM
Hi,
I recently finished the commisioning of the system I started to work upon. Hence the delay to come back to this thread.
During the commissioning of the system, I was concentrating on finalizing the system functionality and was using only the PC#1. Now when all the system functions were finalized, we duplicated the changes to PC#2 and started the operation.
What we observed when the PC#2 was started, was that if we were to open the same HMI page as in PC#1, the operation of the HMI was very sluggish. When we selected a different page for both PC#1 and PC#2, the HMI operation was good, all operations seemed to happen in real time!!
To give a background of the HMI, we have a subpanel to which the desired HMI page/screen is loaded. This loads a VI related to the HMI page.
Here, I am guessing that when I load the same page in both the PCs, the read/write operations to the shared variable(it is the same in both PC, and is deployed in a library on the cRIO) are some how hindered due both PCs trying to access the same network resource from different locations.
Is this guess correct? Any work arounds or solutions? Do I need to post any more information?
Thanks in advance,
Regards