Jump to content
Sign in to follow this  
nicolasB

Rename User Event

Recommended Posts

Hello,

I've created a variable manager in a functional global which generates a user event for each changed rsp set variable.

The attached code is an example reduced to the minimum.

It works fine but my question is if any of you see a possibility to get different names for the user events.

Like you can see in the "MyVar1 and 2 Indicator.vi" both user events in the event structure have the same name and this is very inconvinient when the number variables/events increases.

regards,

nicolas

Share this post


Link to post
Share on other sites

QUOTE (nicolasB @ Feb 5 2009, 02:14 PM)

Hello,

I've created a variable manager in a functional global which generates a user event for each changed rsp set variable.

The attached code is an example reduced to the minimum.

It works fine but my question is if any of you see a possibility to get different names for the user events.

Like you can see in the "MyVar1 and 2 Indicator.vi" both user events in the event structure have the same name and this is very inconvinient when the number variables/events increases.

regards,

nicolas

The User Event takes the name of whatever control or constant used to type it on creation AFAIK.

I personally would prefer a NAME input for the creation of user events, but that's currently not how it's implemented. The current situation basically prevents creating user events in a loop because they than all have the same name.

Shane.

Share this post


Link to post
Share on other sites

Probably the easiest solution is to typecast the user event reference into a user event reference with the name you want.

post-1450-1233842436.jpg?width=400

Saludos,

Aitor

Share this post


Link to post
Share on other sites

QUOTE (mesmith @ Feb 5 2009, 03:16 PM)

OK, the typecast looks interesting but I think it would require care to make sure you don't get a run-time failure from an improper cast

That is no problem, this is all done in compile time (the name of the event is part of the 'wire').

Ton

Share this post


Link to post
Share on other sites

QUOTE (Ton @ Feb 5 2009, 07:50 AM)

That is no problem, this is all done in compile time (the name of the event is part of the 'wire').

Ton

I was thinking more if your event datatype changed and you did not update the control/constant wired to the "Type" input you could get some really interesting run-time results!

Mark

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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