LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading shared variables

hi ,

im having problems reading a shared variable value from a vi ,

i created a project library , periodic i/o server deployed it. created the shared variables i needed . bound them , created my new vi  draged the shared variable i wanted to read , just a time value , set it to a indicator , then ran the two vi s the triangle has apeared on both the main vi and the hmi vi ,and is green , no conflicts arose , but the hmi vi isnt displaying the data ,

both vi s are on the same computer , have i missed somthing ,?

Message 1 of 13
(4,764 Views)
Did you ever write a value to that shared variable from anywhere?
0 Kudos
Message 2 of 13
(4,750 Views)

where would i write from ?

i tried putting a local variable on the block diagramh of the hmi changing it to write  and selecting the variable that i wanted,  but i couldnt wire it to the time indicator ,

0 Kudos
Message 3 of 13
(4,742 Views)

Perhaps if you posted your code zipped up, we can take a look at it.  I don't know what you are doing in each VI (main vs. HMI).  I don't know what time indicator you are talking about.  Is the shared variable bound to a control or indicator? Is it read, write, or read/write?

 

I would suggest reviewing all the shared variable examples in the example finder.

0 Kudos
Message 4 of 13
(4,737 Views)

ill have another look over the examples ,

the main vi has a elapsed time with a indicator (read)

the indicator is bound to the server i/o ,

and then draged from the server i/o to the new vi , hmi. thats all thats in the hmi at the moment,

0 Kudos
Message 5 of 13
(4,734 Views)

Hi Vadajooz,

 

Good Morning and I hope your well today.

 

I was wondering how you got on with your application and if you still require support?

 

If so, I would be interested to know what version of LabVIEW you are using?

 

I would make two simple VIs, one to write to the variable and one to read from the variable. 

 

1. Create the bound variable.

2. Deploy the library,  make sure it appears in the Distributed System Manager (DSM - LabVIEW 8.6+) or Variable Manager (LabVIEW 8.5 - ).

3. Run the writer VI, for example, just have a switch (true/false) and when you change the switch state does the status update in the DSM or Variable Manager?

4. If so, then run the reader VI, is the status matching the writer and there DSM/Variable Manager. 

 

*DSM/Variable Manager can be found by going to tools>>... in the VI toolbar. 

 

If you are still having problems,

 

A. There is a known issue with bound variables in LabVIEW 8.6 - so I can inform you on this if you are using it.

B. I would confirm that the variable is deployed - to do this right-click the library and select Deploy All. 

C. Make sure you write to the variable before reading from it.

D. Add error cluster indicators and note any errors you see.

E. Please attach your simple (test) project - so we can confirm its correct. 

 

I hope this helps, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 6 of 13
(4,687 Views)

hi ,

thanks for getting back, im useing labview 8.6 with dsc.

i create my variables from my server vi.  deploy them , bind them , they show up in the manager ,and in my project folder. create a new vi , drag them over . they deploy ok , and indicate to be reading the variable ok , triangle is green , but nothing happens , check in properties , check path , all seems ok , but nothing happens ,

maybe i missed somthing ,

i added global variables to my server vi  ,and created hmi`s that way , they work fine.

Message 7 of 13
(4,680 Views)

Hi Vadajooz,

 

Thanks for the update.

 

There is a known issue with the bound variables for 8.6, maybe this will helps?

Link: http://joule.ni.com/nidu/cds/view/p/lang/en/id/1255

"This is an update for only LabVIEW 8.6.1 to fix an issue where the bound variable path is incorrect after variable deployment."

The link includes instructions to add this to your LabVIEW Installation. 

 

Can you send me a screenshot of your Front Panels, Project and DSM - confirming that DSM shows not error messages. Are you doing this all locally, i.e. do you need network variables?

 

Hope this helps, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 8 of 13
(4,670 Views)

hi james,

yeah i can send a screen shot, where will i send it ?

no not working on a network , all on the one computer, just trying to sim it a the min

0 Kudos
Message 9 of 13
(4,667 Views)

Hi,


Save it in paint, as a jpeg or bmp and then attach it to the forum.

 

Thanks,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 10 of 13
(4,664 Views)