LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Broken Typedef on Event Registration Control Creation

Solved!
Go to solution

I've got a simple VI:

 

_carl_0-1708381179310.png

LabVIEW's happy with it, as it is above.  However, as soon as I create a control with the event registration info (with a right-click, create, control on the reg events node), LabVIEW detects that the VI is broken:

_carl_2-1708381274565.png

Here's the error:

_carl_3-1708381361589.png

The type def mentioned here is valid, and it's used elsewhere.  It IS in a PPL though.

 

If I just add a control to the typdef in question, LabVIEW has no issues with it. Likewise if I register an event from a new user event created with the typedef it's OK. And LabVIEW thinks that these types are identical, based on the lack of coercion dot below:

_carl_6-1708382163020.png

 

Does LabVIEW have issues with event registrations coming from PPLs?

Any suggestions on how to debug this would be most-welcome... I'm running out of ideas.

 

(Can't share code, unfortunately.  Feel that this is likely a LabVIEW bug... and have tried all the normal clear compiled cache, wipe mutation history, etc tricks.  The project this is in doesn't currently detect any conflicts or other issues, and all dependencies are found according to the project.)

0 Kudos
Message 1 of 6
(630 Views)
Solution
Accepted by topic author _carl

Hi _carl,

 

I already had the exact same situation, this is likely a consequence of this bug.

As a workaround, I created a second type definition for the User Event itself (in addition to the type definition for the contained type).

 

Regards,

Raphaël.

Message 2 of 6
(621 Views)

Raphaël,

 

Thanks for the quick response!  I actually think this is a different issue though -- it's not that it's not updating -- it's that it can't even be created properly.

 

An update from my initial post:

 

In an effort to pull out the bad typedef, I added code to look at the control type that LabVIEW's trying to work with.  It's dropped the 'myLibrary.lvlibp' part of the type.

 

So if I just add the type to my VI, the full type (using context help) is something like: 

MyLibrary.lvlibp:Typedefs.lvlib:Station State.ctl

 

Whereas the type returned from the event structure here is:

Typedefs.lvlib:Station State.ctl.

 

_carl_0-1708383354456.png

 

My suspicion: this is a LabVIEW bug that drops event registration namespacing info from PPLs...

 

0 Kudos
Message 3 of 6
(600 Views)

I still think this is related to the mentioned bug.

 

In my example, I reproduced the bug by manually renaming the typedef. In your case, the renaming is the addition of prefix "myLibrary.lvlibp:", which is done automatically while compiling the packed library. In both cases, LabVIEW forgets to update the typedef nested inside the User Event data type.

 

Have you tried creating a typedef for the User Event itself?

Message 4 of 6
(588 Views)

Haven't tried the typecast yet (as that would require changes to the PPL), but I did find a workaround (and will experiment with that later).

 

The problem seems to be be with the development environment: it creates the wrong control!

 

If I first create a constant, and then I wire it to a register events node, it'll create the indicator correctly. But the event data gets corrupted if I wire it directly to the event terminal of the PPL VI.

 

_carl_3-1708388402163.png

 

 

 

0 Kudos
Message 5 of 6
(561 Views)

Updating my PPL to pass out this particular event as a typedef solved the problem, marking @raphschru 's first suggestion as the solution.

 

Without updating the output to be a typedef, I could manually create a working control with a right-click in some situations, but not all. Replacing with a typedef seemed to universally solve the issue with all downstream controls.

0 Kudos
Message 6 of 6
(503 Views)