LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NXG: Sample code to write to shared variable

Solved!
Go to solution

I have searched builtin help and online but can't find an examle how to write a shared variable (SVE) in LabView NXG 5.0. I would really appreciate if someone can provide a pointer how to do it. I know how to do it in LabView but not NXG. 

0 Kudos
Message 1 of 8
(2,691 Views)

You've seen this help topic, then?  You should probably be using tags, anyway.  At least according to the help file.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 8
(2,650 Views)

Yes, I have re-read that so many times but I couldn't figure out how to use it. I was hoping to see an example. 

0 Kudos
Message 3 of 8
(2,632 Views)

It's pretty straightforward.  But then again, I have used NXG long enough to anticipate what they are trying to do, so maybe that's why it seems straightforward to me.  What is it that you are having trouble with?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(2,627 Views)

I am not able to write to shared variable. I am translating what I have been doing using LabVIEW (the old one). 

 

For example, in the LabView you create a project library to hold the shared variable. I don't know how to do this in NXG. 

 

This is what I have tried so far, not working. Note I am using PSP Variable - I am not sure if I should use PSP Variable Engine. I am totally lost here.

 

ElioTx_0-1593400281383.png

 

0 Kudos
Message 5 of 8
(2,580 Views)

I am using the link below as my reference for using Shared Variable Engine

http://www.ni.com/tutorial/3742/en/

 

0 Kudos
Message 6 of 8
(2,577 Views)
Solution
Accepted by topic author ElioTx

You might try adding ni.var.psp: in front of the URL. I did a quick test with the snippet below and it works as expected.

 

NXG_SVE.png

 

I did have to create the shared variable and process manually using Distributed System Manager. I don't think NXG offers a way to create and deploy shared variables directly.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 7 of 8
(2,572 Views)

Thanks @MichaelBlazer! It worked.

 

Note: For some reason it was not working initially. After I deleted the variable in NI Distributed Manager and then re-created the same variable name, it worked.

Message 8 of 8
(2,531 Views)