01-03-2019 11:49 AM
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.
Solved! Go to Solution.
01-03-2019 11:55 AM
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.
01-03-2019 12:14 PM
@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
01-03-2019 12:17 PM
Agree. Name comes from variable name which attached to Create event.
What to do in case of multiply the same devices? Please, see attachment.
01-03-2019 12:24 PM - edited 01-03-2019 12:25 PM
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.
01-03-2019 12:41 PM
@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
01-03-2019 12:45 PM
01-03-2019 12:48 PM - edited 01-03-2019 12:52 PM
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.
01-03-2019 12:55 PM
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.
01-03-2019 01:00 PM
@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.