LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to Host my Shared Variables on a cRIO, but use DSC for Logging/Alarming/SCADA

Solved!
Go to solution

Hi everyone,

 

What I'm trying to do is this:

-Host shared variables on my RT targets (cRIO-9022) for reliability

-Use the DSC module to log to database, track Alarms, develop distributed HMI

 

The problem I'm running into is that the DSC engine (it seems) needs the shared variables it is monitoring to be hosted on that computer. The DSC engine can not run on a real-time target.

 

My end goal is to create a plant-wide network of cRIO's that are all linked back to a central server/PC that runs DSC to collect and stores data in a database. The plant HMI would also connect to the central server and get their information from there (not directly connected to the cRIO process). Is this possible/does any one have ideas on how to do this efficiently?

 

Thanks for the help.

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 1 of 18
(5,842 Views)
Solution
Accepted by topic author JimMacD

I have a similiar architecture.  I host my NSV libraries on my cRIO's and then create 'mirrored' bound libraries on the host PC that is running my HMI's and the DSC logging to my Citadel database.  The LV project has a tool for creating bound libraries.  I also wrote a tool myself to create a cloned library that has binding to the original library on the cRIO.  The NI PSP protocol makes this type of bound library very efficient.

Message 2 of 18
(5,813 Views)

Sachsm,

 

Thanks for the input. I tried to create a test project for this type of architecture (bound NSV's) but am running into some errors.

 

I have attached a screenshot of the project and front panel showing the binding status of each variable **see attached picture**

 

Hosted on PC:

-Clone (Variable1) ---- This is bound to Variable1 on cRIo using the "Create Bound Variables" option in the Library

-Variable3

 

Hosted on cRIO

-Variable1

 

As you can see, when I drag variable 1 directly onto the PC front panel, the variable connects (indicator is green). Likewise, when I host Variable3 on the PC and drag it to the front panel, it connects. However, when I drag the Clone (variable bound to Variable1 on cRIO) onto the front panel, it cannot connect. Any thoughts?

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 3 of 18
(5,797 Views)

Could you send me a screenshot of the variable 1 properties showing the binding attributes.

0 Kudos
Message 4 of 18
(5,791 Views)

Screenshot of Multiple Variable Editor showing Variable1 and the Clone on the PC:

 

 

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 5 of 18
(5,789 Views)

Everything looks correct.  I setup a simple test on my cRIO and PC and it works fine.  Are you running the test vi from your project with the vi execution target set to 'my computer'?

0 Kudos
Message 6 of 18
(5,775 Views)

I called NI for some help with this and found out what the issue is. Somehow during deployment of the library, the variable binding is being changed from \\<IP Address of cRIO>\\cRIO Library\Variable1  to \\localhost\\cRIO Library\Variable1.

 

I can make the bound variable connect to the cRIO variable when I stop the PC vi and open the Distributed Systems Manager and change the binding path back to the IP address. The only problem is as soon as I run the PC vi again (and deploy the PC Library) it changes the binding address to localhost.

 

Waiting for their response now...Any thoughts?

 

I'd be interested to know how your custom VI makes mirrired libraries for you. Perhaps that contains some code that eliminated this binding address issue?

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 7 of 18
(5,761 Views)

The problem maybe in the .alias file that resolves logical target names in the URL of a NSV and the actual IP address of the target.

 

for example if my binding is \\cRIO-HPU\HPU_IO\Pressure, then the target name comes from the project as cRIO-HPU but the

.alias file will contain a mapping such as:

 

[My Computer]
My Computer="10.0.10.149"
[cRIO]
cRIO-HPU="192.168.0.2"

 

the alias file is generated by labview to have the same base name as the executable with a .alias extension.

0 Kudos
Message 8 of 18
(5,755 Views)

Its an issue with LV 8.6.1.

 

Found this KB article that points to a patch for LV 8.6

 

http://digital.ni.com/public.nsf/allkb/A12707C3AA00F5598625737C0066D4F6 under the "Issues Using Bound Shared Variables:" section.

 

The patch can be found here: http://joule.ni.com/nidu/cds/view/p/id/1255/lang/en

Now my binding path is correct after deployment.

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 9 of 18
(5,751 Views)

As another part of this type of architecture, do you know of a way to locally log data (to the cRIO) if the network connection to the database goes down, then upload that data to the database when the connection is restablished to fill in the missing data?

 

it would probably involve some sort of network watchdog, but what i'm not sure of is how to push data into the database

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 10 of 18
(5,739 Views)