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: 

Event name resolving

Solved!
Go to solution

Hi,

A device variables are organised in cluster and the device uses event. If application uses multiply devices then Event structure has multiply dynamic event with the same name, like "<Int>:User Event".

Is any way to change Event name?

Example is attached.

 

Thanks, Andrey.

 

0 Kudos
Message 1 of 11
(3,136 Views)

Don't use the same Constant labelled In for both Create User Events.  Use a constant with a different label for the second Create User Event.

Message 2 of 11
(3,129 Views)
Solution
Accepted by topic author Vasilich2004

@RavensFan wrote:

Don't use the same Constant labelled In for both Create User Events.  Use a constant with a different label for the second Create User Event.


OR

 

You can use a type cast and the top input of same can use a different name. The name of the event comes from the wire wired to the create so the type cast will allow using the same data type (example: a type defined cluster) but the type cast will result in events of unique names.

 

But that is only if the simple approach is not an option.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 11
(3,122 Views)

Agree. Name comes from variable name which attached to Create event.

What to do in case of multiply the same devices? Please, see attachment.

0 Kudos
Message 4 of 11
(3,120 Views)

You've created a different problem than you first posted because now you are using the cluster to get event Ref rather than the original event Ref.  Is there a reason why you changed it?  So now user event is coming from the Event Ref element which gets its name from the cluster.

 

So do what Ben said and use a typecast on the pink wire to change the name of the Event Ref element in each of the clusters.

 

If you used the original arrangement, the 2nd constant should have been called Int2 instead of keeping the same name "Int" as before.

Message 5 of 11
(3,117 Views)

@Ben wrote:

@RavensFan wrote:

Don't use the same Constant labelled In for both Create User Events.  Use a constant with a different label for the second Create User Event.


OR

 

You can use a type cast and the top input of same can use a different name. The name of the event comes from the wire wired to the create so the type cast will allow using the same data type (example: a type defined cluster) but the type cast will result in events of unique names.

 

But that is only if the simple approach is not an option.

 

Ben


Ben,

That is interesting trick and Typecast do changes name. It can be used directly before "Register For Events" in top vi but I still don't see way to use in Connect.vi (see picture in my previous post).

 

Also will it work when cluster after typecast will be input to

- another vi?

- Start Asynchronous Call Node?

 

P.s. could you, please, look on another problem with Start Asynchronous Call Node and cluster https://forums.ni.com/t5/LabVIEW/Cluster-with-VI-reference/m-p/3878133/highlight/false#M1099247

0 Kudos
Message 6 of 11
(3,103 Views)

@RavensFan wrote:


 

sorry for confusion. just tried to simplify example.

0 Kudos
Message 7 of 11
(3,098 Views)

What is "Connect.vi"?  None of your pictures have a VI by that name.

 

Now you are talking about other VI's.

 

It seems like you are trying to use User Events in an architecture that is far more complicated than you seem to be ready to use.

 

Do you really need multiple user events?  Just create one user event.  Add a string value to the cluster where you can put in an identifier as to which device is generating the event.  Then use that value inside your single User Event Case.

0 Kudos
Message 8 of 11
(3,096 Views)

LabVIEWQuestionV2.png has text "Connect.vi is called first time" and "Connect.vi is called second time". Connect.vi is in circle. I just tried to show multiply Vi on one picture.

0 Kudos
Message 9 of 11
(3,089 Views)

@RavensFan wrote:

Don't use the same Constant labelled In for both Create User Events.  Use a constant with a different label for the second Create User Event.


That is incorrect. In example, name doesn't come from constant "Int" which connected to "Create User Event". Name comes from integer control "Int" of Device cluster.

0 Kudos
Message 10 of 11
(3,087 Views)