From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DSC module and local variables

Solved!
Go to solution

Hi Folks,

I am a student embarked on a project to simualte a gas network using hte DSC module. I have generated a VI after much head scratching and hair pulling, which contains multiple local variables. I have just discovered that these do not work across the network. I am also now very pushed for time. Is there a quick fix for this, so as to save the integrity of the VI? I've included a copy of the VI.

any help is hugely appreciated at this stage, from a frstrated NewBee

0 Kudos
Message 1 of 12
(4,981 Views)

Just go around and replace them one by one.  You can try right click > replace and pick shared variable once you maneuver through the menu.  (Create your shared variable library first so you can pick the appropriate shared variable.)  But it is probably easier to drag and drop the shared variables from your project library onto the block diagram, delete the local variable, then connect the shared variable.

0 Kudos
Message 2 of 12
(4,977 Views)

Hi Ravens Fan,

I tried with no success. I had the project already commenced with Shared variables created. I did get a message at the time warning about the shared variables and published data.

Following your suggestion I opened the library and the original VI (Gas1) upon which the project is based. I dragged across the shared variables one at a time, and replaced the local variables.

I had the construction of a HMI VI commenced, and deployed all. The HMI did not work.

When I tried to run the Gas1 VI subsequently, I got the error message, see file attached, for each shared variable I had changed out.

Any ideas?

Thanks in advance

Download All
0 Kudos
Message 3 of 12
(4,961 Views)

One tip with your VI.  It looks like you have a lot of generically named controls (e.g. Numeric, Numeric 1,  Gauge 8, ...).  I'd recommend giving them meaningful names.  Likewise your shared variables have a lot of generic names.  (e.g. Boolean 53, Boolean 54, ...)

 

It seems to me you have been able to successfully convert all your local variables to shared variables.  You have a different problem now as evidenced by the error message about a server failure.  I did a search for that error message on the forums and it popped up two message threads.  http://forums.ni.com/t5/forums/searchpage/tab/message?location=Board%3A170&q=1950679037#message-list

 

Take a look at those and see if either help.

 

Also look at the KB articles that can be found on the NI.com website.  http://search.ni.com/nisearch/app/main/p/bot/no/ap/global/lang/en/pg/1/q/1950679037/

0 Kudos
Message 4 of 12
(4,956 Views)

Hi once again Ravens Fan,

I checked out the info you provided and have to say,above my head I'm afraid.

So I started from scratch with the VI and followed your suggestion on replacing the local variables with shared

variables. I deployed everything and found that the server VI partially ran, and now the error has changed to 1950679035, which deals with shared variables possibly not having deployed. But it did partially run which it didn't do initially. I subsequently built a HMI VI off the project, but this  made no attempt to run.

I seem to be moving from one problem to another with no light at the end of the tunnel.

I have to say our lecturer is not on my Christmas list, he never prepared us for this level of interactio with Labview.

0 Kudos
Message 5 of 12
(4,950 Views)

There is no need to convert any of your local variables to shared variables. You only have to bind the control to which one of the locals refer  to a shared variable. Now each of your locals is connected to one shared variable via its referenced control.  In your example, create a shared variable and call it Boolean 18_SV or something like that. Open the properties of the control Boolean 18 and bind it to the shared variable engine and browse to Boolean 18_SV to get the path to the shared variable. Before you do that, do what Ravens Fan advises about the control names.

0 Kudos
Message 6 of 12
(4,939 Views)

Hi JohnCS,

I followed your instructions. I started from the base VI again, renamed all the required controls to be published, individually created the shared variables and bound them to the relevant control.

Unfortunately, I have gotten an Error list, "control's type does not coerce with the variable it is bound to"

See files attached

Download All
0 Kudos
Message 7 of 12
(4,923 Views)

You're only halfway there.  The binding is not complete.

 

To finish, bind each front panel control or indicator to the path of the shared variable you want to connect to. For example, Inlet  Valve Scrubber 1 needs to bind to Inlet Valve Scrubber1_SV. In the properties dialog for Inlet Valve Scrubber 1, use the Browse… button in the Data Binding tab to find and select the path to the variable.  It should look something like this:

 

My Computer\GasPro Shared Variables-2.lvlib\Inlet Valve Scrubber1_SV

 

A Shared Variable in required for the Indicators as well as the controls, for example the first error I see in my error list  refers to the Compressor 2 Press Chart.  Make a shared variable for it and bind it to the control. Having a separate libraries for control and indicators  will help keep things straight. 

 

Use the error list to locate each control or indicator that needs binding by clicking show error.  Hopefully the list will shrink as you take care of the problems.

0 Kudos
Message 8 of 12
(4,919 Views)

Hi JohnCS,

I already had done this. Each time I created a shared variable,I bound it to the relevant control on the front panel of the original VI.

See attached example.

0 Kudos
Message 9 of 12
(4,903 Views)

I can't see the linkages in the lvlib you posted earlier.  The linkages are lost when the lvlib is moved outside of the project. Can you post the complete Project file?  Use the Build Specifications to create a zip file and post that.

0 Kudos
Message 10 of 12
(4,898 Views)