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: 

Within an event struc, is there any identifying information available indicating the event trigger source?

I'm currently trying to debug an issue and thought of this idea when I saw "source" available within the particular user event that I have returning an invalid value.

 

Say you have a bunch of vi's in a project that have access to a particular user event.  

 

If you find that one ore more of these vi's somewhere is returning invalid data passed along while generating the event, is there any way of figuring out which vi the invalid data came from?

 

I don't even know if this is possible, just curious

 

Thanks

-pat

0 Kudos
Message 1 of 4
(1,988 Views)

The only solution I can think of, is to pass along with the data in your User Event, the VI Name of who generated the event.  Then when you get the event you can parse out the VI Name of who generated it.  Some extra overhead but useful for troubleshooting.

Message 2 of 4
(1,968 Views)

I'm noting this for future designs- right now my data type is stuck as a double but from here on in I'm gonna make it a string and have data parsed or something with a pipe.

 

Thx

 

-pat

0 Kudos
Message 3 of 4
(1,966 Views)

@PatLyons wrote:

I'm noting this for future designs- right now my data type is stuck as a double but from here on in I'm gonna make it a string and have data parsed or something with a pipe.

 

Thx

 

-pat


You are welcome to do what you like, but might I suggest a Type Def'd cluster?  That way you can have your data the way you want and just update the Type Def if you need to add more data later.

 

Of course if you do this you'll notice that the Event Ref wire (coming out of the Register) will be a different type because of the data type changing.  This is one of the reasons all my User Events are Variants, and then updating the type def, doesn't cause the Event Ref to change (since the data is still variant).  You can then get even more tricky by using the Attribute of that Variant and store other information in there too (Source, Value, Error, Destination etc).  User events are as powerful as you want but you may need to plan ahead for expandability like this.

Message 4 of 4
(1,961 Views)