From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Occasional Nugget 05/14/2007

In this thread response by Craig regarding some subtleties with dynamic event registration, TonP made an unofficial request for a VI Analyzer test that would help detect event registration refnum wires that have been forked, which could cause unexpected behavior if multiple event structures are registered for the events handled by that wire.  Since I absolutely love showcasing the abilities of the VI Analyzer, I figured I would fulfill his request.  Attached below is a VI Analyzer test that will detect any Event Registration Refnum wire on the diagram that has been forked (read the aforementioned thread to learn why this may be a bad idea).  If you have VI Analyzer 1.1 or later, and LabVIEW 8.2 or later, you can use this test by following these instructions:
 
1.  Create a subfolder called "VI Analyzer Tests" in your [My Documents]\LabVIEW Data folder.
2.  Place the attached LLB in that folder.
3.  When you run the VI Analyzer, you will have a new category of tests called "<User-Specified>", and the "Forked Event Reg Ref Wires" tests should be there.
 
Enjoy,
-D

P.S. - Check out past nuggets here.
Message 1 of 8
(8,263 Views)
Darren, I would suggest that this would also flag wires whose sources are not the register for events node.

That way, you could also handle the global variable case mentioned by Craig.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(8,231 Views)
The test should flag any wire that has an Event Registration Refnum data type, regardless of the source terminal of the wire.  Let me know if you test it and find this is not the case...it seemed to work fine for me regardless of the source terminal type of the wire.
 
-D
0 Kudos
Message 3 of 8
(8,215 Views)
I meant that it should flag these even if they are not split, so you can detect potential "race conditions".
 
It should presumably account for cases where the source(s) is\are or outside inside a case structure, etc.

___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(8,194 Views)
You could also flag wires whose ultimate sink is not the event structure.

___________________
Try to take over the world!
0 Kudos
Message 5 of 8
(8,091 Views)


@Darren wrote:
TonP made an unofficial request for a VI Analyzer test t



Sorry about that, but I knew you would listen Smiley Wink

Thanks,

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 8
(8,079 Views)

Hello Daren,

i have a naive one:

where do we find this vi analyser 1.1? looked all around in my cds and progs...could not find it. do we have to purchase it separately from LV8.2? i use the academic licence, with full professional version.

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 7 of 8
(7,863 Views)

The VI Analyzer can be purchased as an add-on toolkit for LabVIEW.  It is also included in the Developer Suite.

-D

0 Kudos
Message 8 of 8
(7,860 Views)