Jump to content

Programmatically changing values of shared variables


Hacti

Recommended Posts

Hi,

My question is : Can I change the value of a shared variable programmatically (with property nodes, without hardcoding the variables) some other way then using the datasocket.

I ask this because our configuration changes from one project to another and we are trying to transfer from 7.1 to 8.2 as easily as posible, without having to rewrite our whole program.

Thanks.

Link to comment

QUOTE(Hacti @ Aug 31 2007, 12:35 PM)

My question is : Can I change the value of a shared variable programmatically (with property nodes, without hardcoding the variables) some other way then using the datasocket.

Hi,

I think you need the DSC toolkit for that. It can connect to a supplied shared variable and it gives you a datasocket connection reference (IIRC). You will need an URL starting with psp:\\

Joris

Link to comment

QUOTE(Hacti @ Aug 31 2007, 06:35 AM)

... a shared variable programmatically ...we are trying to transfer from 7.1 to 8.2 as easily as posible, without having to rewrite our whole program.

Thanks.

This does sound like a DSC app you are trying to upgrade.

To quote from Indiana Jones and the Temple of Doom "Hold on lady, we goin for a ride."

If so, "do not pass go, go directly to" datasockets. Only the most simple DSC constructs will mutate correctly. The URL's of the datasockets can be manipulated the way the old tag names could.

And if you are using alarming features, you may have to resort to reading values more than once to get the actual value.

If this is not a DSC app, disregard all of the above.

Ben

Link to comment

QUOTE(Ben @ Aug 31 2007, 02:36 PM)

This does sound like a DSC app you are trying to upgrade.

To quote from Indiana Jones and the Temple of Doom "Hold on lady, we goin for a ride."

If so, "do not pass go, go directly to" datasockets. Only the most simple DSC constructs will mutate correctly. The URL's of the datasockets can be manipulated the way the old tag names could.

And if you are using alarming features, you may have to resort to reading values more than once to get the actual value.

If this is not a DSC app, disregard all of the above.

Ben

thanks, thought that might be the case.

Hacti

Link to comment

QUOTE(Hacti @ Aug 31 2007, 05:35 AM)

My question is : Can I change the value of a shared variable programmatically (with property nodes, without hardcoding the variables) some other way then using the datasocket.

If you have a finite set of shared variables, you could create a separate subVI for each variable that sets its value and then use VI Server to select which subVI to call.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.