LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic creation of shared variables

oh wow!!!

that was working very very fine!!

I wanted something just like that!


thank you so much!!Smiley Happy
0 Kudos
Message 11 of 22
(2,559 Views)
Hi all,

I have an application where i am using a set of cFP controllers and a pair of Servers. I am using Shared Variables for transferring data between cFP and Server by binding the cFP variable to Server Variable.

I am using these servers for redundancy purpose. I made some logic to intimate cFP whichever is active.But is it possible to programmatically bind the cFP variables to the Active Server. i need to change the binding address whenever a server switching is happened.

Waiting for a reply.

Thanks and Regards,

Blackperl
Coding is a combination of intelligent and creative work - someone
0 Kudos
Message 12 of 22
(2,498 Views)

Hi,

I am trying to programmatically create and add shared variable to an existing library. The problem is on opening the library, which I am ot sure if I'm doing it correctly. I am using an 'Invoke Node Invoke Method: Library: Open', and am taking the 'Library Refnum' to the 'Library Reference In' of the 'Add Shared Variable To Library' module. I am feeding the Invoke Node with the full path including the library name (....lvlib). error comes as Not a Refnum.

 

If this is not the correct way to do the above purpose, then what is it?

 

I actually have tried some other configurations, no luck yet!

 

Comments welcome.

0 Kudos
Message 13 of 22
(2,304 Views)
Oops.  Misread.  Nevermind
Message Edited by elset191 on 08-17-2009 01:16 PM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 14 of 22
(2,290 Views)

Wow.  Talk about bringing back a thread that just turned 3 yo.  It would have probably been better to make a new thread.

 

 

In response to the push of information to BUY a module just to have some of the functionality that NI should have just built into the Shared Variable Engine to begin with: Look into DataSockets as I found them much easier to use over Shared Variables (which IMO is kind of a mess).  LabVIEW 2009 may have fixed some of this so that Shared Variables are more usable, but I haven't evaluated the new Shared Variable VIs.

Message 15 of 22
(2,279 Views)

Nickerbocker wrote:

... Look into DataSockets as I found them much easier to use over Shared Variables (which IMO is kind of a mess)....


From what I can tell there are DataSocket Reads or write hiding inside those shared variable nodes but we just aren't allowed (empowered?) to change them. DataSockets on the other hand require you know a little more about URLs etc but are much more flexible.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 22
(2,269 Views)

@Ben - I see.  I found Shared Variables to work well with two computers that both had a version of LabVIEW installed, but once you go into the world of executables and application distribution the complexity shot up.  DataSockets, on the other hand, follow a simple server/client paradigm.

 

Seemed like if I needed FIFO Shared Variables extra "packaging" seemed like a better solution (such as a Waveform).  However, if I was transporting boolean signals such that I'm really only interested in what is the "latest" value DataSockets worked a lot better for me.  Ultimatly I prefer DataSockets though and try to avoid complex time sensitive data over the network.

0 Kudos
Message 17 of 22
(2,264 Views)

well, not sure about the last two comments,... I am using DataSockets as well anyway, for read and write access to the created Shared Variables (Network Published) from the multiple VIs.

 

For my paroblem above, a little better but not perfectly fixed yet, I had to completely open and close project and create library and save it everytime adding a new SV. It actually may be working (I see libaries and SVs in them on the Project Explorer), reason for not %100 sure: Now after run, I am having one of my multiple subVIs, actually the last one called to run, getting stock on resetting (the little window; resetting subVI:...)

 

I am suspicious to the closing project last time the last SV is added. the project is the same containing all VIs and libraries, does closing the project affect access etc.?

Message Edited by Siamak on 08-17-2009 04:30 PM
0 Kudos
Message 18 of 22
(2,251 Views)

Ah, I seem to be able to fix this recent issue now... closing opened references,...

 

still question remains on whether there is a shorter approach to reference an existing library to add a dynamic number of SVs to it without having to open and close project everytime.

 

Cheers all,

Siamak

 

0 Kudos
Message 19 of 22
(2,244 Views)

Hi,

 

Attached VI is capable of creating SVs and adding them to the defined Library in a project.

I have taken different approaches including simple DataSocket (open, read, close) and also DataSocket Server to write into the SVs and read them from different VIs, tried different URLs, none worked! on the diagnostics with Shared Variable Monitor, can not see written values, however it shows access is being made to the created SVs.

 

Not sure where it goes wrong yet,

 

Comments welcome.

 

Sia

0 Kudos
Message 20 of 22
(2,221 Views)