Mikrobi Posted August 26, 2004 Report Share Posted August 26, 2004 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: Is it possible to do that? regards Mikrobi Quote Link to comment
bariman8 Posted August 26, 2004 Report Share Posted August 26, 2004 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 Quote Link to comment
Mikrobi Posted August 26, 2004 Author Report Share Posted August 26, 2004 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 Quote Link to comment
didierj Posted August 26, 2004 Report Share Posted August 26, 2004 Mikrobi, You can use a type-cast to rename your wire: Didier Quote Link to comment
jpdrolet Posted August 26, 2004 Report Share Posted August 26, 2004 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. Quote Link to comment
bariman8 Posted August 26, 2004 Report Share Posted August 26, 2004 Didn't know you wanted to change it at run mode... sorry for the misunderstanding. Derek Lewis Quote Link to comment
Mikrobi Posted August 26, 2004 Author Report Share Posted August 26, 2004 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 Quote Link to comment
bariman8 Posted August 26, 2004 Report Share Posted August 26, 2004 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 Quote Link to comment
jpdrolet Posted August 26, 2004 Report Share Posted August 26, 2004 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: Quote Link to comment
Mikrobi Posted August 26, 2004 Author Report Share Posted August 26, 2004 You can use a type-cast to rename your wire: Didier :thumbup: thats work 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 Quote Link to comment
jpdrolet Posted August 26, 2004 Report Share Posted August 26, 2004 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). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.