Jump to content

Label for dynamic events


Recommended Posts

Hello all

I work at application sensitive for other application events. Using function 'Register For Events' dynamic register four events from that same VIs with that same indicator name.

Finally I get four events with that same name, but I would like specify different names for them.

Here is diagram:

NoNameEvents.png

Is it possible to do that?

regards

Mikrobi

Link to comment
Hey Mikrobi,

You can change the name of the events.  The key is to change the name of the refnum that you are passing into the Register for Events primitive.  However, if you're using the same subvi to pass that reference out that makes it a little tougher, but still possible.

Derek Lewis

1545[/snapback]

Yes, it is possible to change the name of refnum, but only at edit mode. I need to set events name at run mode. :(

regards

Mikrobi

Link to comment
Hey Mikrobi,

You can change the name of the events.  The key is to change the name of the refnum that you are passing into the Register for Events primitive.  However, if you're using the same subvi to pass that reference out that makes it a little tougher, but still possible.

Derek Lewis

1545[/snapback]

To change the dataname of a wire, use the function Typecast or Variant to Data. On the type input, wire an appropriately named control or constant.

Link to comment
To change the dataname of a wire, use the function Typecast or Variant to Data. On the type input, wire an appropriately named control or constant.

1550[/snapback]

Yes but it is static method, I need to do it from control. Your method base at control or constant with existing name, but I want to set name from control input.

Yes, at runtime.

regards

Mikrobi

Link to comment

Hi Mikrobi,

I'm not entirely sure if I understand what you're trying to accomplish but I believe it sounds like you want each event to occur based on different controls. If this is the case all you need to do is pass the dynamic event refnum into another register for events function. Then pass the refnum of each control you want to associate with that event. From there the event handler should take care of the rest.

Good luck,

Derek Lewis

Link to comment
Yes but it is static method, I need to do it from control. Your method base at control or constant with existing name, but  I want to set name from control input.

Yes, at runtime.

regards

Mikrobi

1553[/snapback]

If the event name is not known at edit time, how could you create an event case for it, and put code to handle this unknown event :question:

Link to comment

For the specific use of casting control refnums, the function "To More Specific Class" is more appropriate here, providing an error when the typecasting is not appropiate for the control class e.g. typecasting a generic control refum (string) to a specific control refnum (numeric).

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.