Jump to content

Multiple dynamically registered events not firing in subvi


Recommended Posts

I've atatched a zip with 2 files. One is the relative code stripped from my main loop, the other the panel I'm reading control events from.

http://forums.lavag.org/index.php?act=attach&type=post&id=6289

Essentially I've gotto be able to handle different diagrams, so I came up with a way to create arrays of control refnums, based on the class and a label convention. This part works just fine.

Next I create an event registration with the 8 different groups that I have to work with.

Each of these 8 then become my "unnamed" events.

Just for testing I put in a popup box to tell me which are firing and which are not.

Turns out the first one fires no probs. None of the others will work.

What am I missing here?

thanks

James

Link to comment

Thanks that does seem to work.

So my question then becomes.... why didn't what I was doing work? What's going on within Labview?

In one of the examples for dynamically registering events (dynamically register for evetns.vi) it has a couple of different controls as well as a user defined event all going through one registration then into the event loop. So what's the difference between what i was doing, and what they did? I notice there's was the current vi, while I had my controls on a different one. But why should that make any difference?

cheers

James

Link to comment

In the example "Dynamically Register for Events.vi" when the Register Event Callback node gets expanded different types of events were selected, eg Mouse Move, Mouse Down?, Mouse Up.

When you expanded the node all the event types were the same (Value Change). LabVIEW is probably just only taking the control refs to the first Value Change and ignoring the rest. I agree that this seems a bit counter intuitive and should probably be documented that you can't select the same event twice somewhere if that is the case.

If you want to register different types of events just expand it and select a different event type like in the example.

If you want to add more controls to detect a Value change for, I'd suggest instead of expanding the node to select Value Change again try adding control refs to the 1-d array going into the existing Value Change like this:

http://forums.lavag.org/index.php?act=attach&type=post&id=6300

(with build array in concatenate mode)

Link to comment

Just a reminder, there should probably be an "unregister for events" on the end of your event structure loop. If not, the dynamic event handling will still be in memory until the VI closes (even after the event structure loop is done).

Link to comment

QUOTE(Karissap @ Jul 3 2007, 05:37 PM)

When you expanded the node all the event types were the same (Value Change). LabVIEW is probably just only taking the control refs to the first Value Change and ignoring the rest. I agree that this seems a bit counter intuitive and should probably be documented that you can't select the same event twice somewhere if that is the case.

Please file a bug report against the documentation so this can be noted in a future LV version.

Link to comment

QUOTE(Aristos Queue @ Jul 9 2007, 04:01 PM)

Please file a bug report against the documentation so this can be noted in a future LV version.

Well I saw an error from the 'Register for events' so I don't think that's the problem.

I haven't studied it so I don't know an answer.

Ton

Link to comment

http://forums.lavag.org/index.php?act=attach&type=post&id=6329 I did not notice there was an error fired until you mentioned it. SO I did a little more with the code to figure it out.

Question? Is there a way to be informed of errors, a place to check, when I do not place an idicator for everything, or run in highlight mode?

The error was 1055 invaild reference. So I created a looop to take out all the not-a-refnum-constants from my arrays. Now it works just fine. So then will someone explain the not-a-refnum-constant a little more in depth for me? I thought it could be used as a place hold that would be ingored. At first I thought that it wouldn't even be put into the arrays as I was building them. That would be the most effiecient way of doing what I was trying originally, is to simply put nothing into the array where I am putting not-a-refnum-constant.

Link to comment

QUOTE(jccorreu @ Jul 9 2007, 05:29 PM)

That's a VI property:

See under VI properties (ctrl-I), execution->Enable Automatic Error Handling

QUOTE(jccorreu @ Jul 9 2007, 05:29 PM)

The error was 1055 invaild reference. So I created a looop to take out all the not-a-refnum-constants from my arrays. Now it works just fine. So then will someone explain the not-a-refnum-constant a little more in depth for me? I thought it could be used as a place hold that would be ingored. At first I thought that it wouldn't even be put into the arrays as I was building them. That would be the most effiecient way of doing what I was trying originally, is to simply put nothing into the array where I am putting not-a-refnum-constant.

Maybe you should have used a control reference constant instead of 'Not-a-refnum'

Ton

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
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.