03-19-2020 09:33 AM - edited 03-19-2020 09:44 AM
I thought I understood dynamic event triggering, but clearly I am missing something. I am working on a application that involves software triggering. Basically, I want to use a front panel Boolean control to initiate a dynamic event (rather than a static event). This is actually quite simple to do: create event with a label and data type, register event, add event case for your front panel control, and then generate the event when that control is activated. This passes the data to the dynamic event. However, if you put the event in the class private data of a particular class (e.g. in the Actor Framework), this no longer works. It does not pass the data. Instead of passing 'trig' (the label of the event), it passes 'stop', which is the label of another event (the CPD has two events, stop and trig, each Boolean). The two events are created in pre-launch init. I've also attached a vi that works perfectly but doesn't CPD (or AF). What is the difference between the two approaches?
Solved! Go to Solution.
03-19-2020 11:37 AM
Not clear for me what are you trying to achieve but can you save the VIs in an older LabVIEW version? I don't have LV19 yet.
03-19-2020 11:54 AM
Hi,
I want to do the following simple task: I want to use a front panel control to pass data to a dynamic event, 'Trig', which, for the purposes of this example, just turns on an indicator light. The straightforward way to do this is shown in Dynm events working.vi. I created a user event called 'Trig', registered it, and then whenever someone clicks on the Trigger front panel control, it generates this event. The data is then passed to the dynamic event and turns on the indicator. So the Trigger control is controlling the indicator light but it does so through this combination of a static and dynamic event. This works just fine. However, if I have the event stored in the class private data of a class, e.g. as shown in the Actor Core.vi, this no longer works. Everything here is the same except that I created the user event in prelaunch init.vi, and then I unbundled it in the actor core.vi. However, instead of passing the data to the dynamic event 'Trig', it is passing data from a different event 'Stop'. There are two events defined in the class private data of Actor One.lvclass (Stop and Trig). My question is why doesn't the 'Trig' data get passed just like in the Dynm working.vi case? It's the exact same thing, isn't it? The reason I want to do it using the class private data is so that I can generate events during messaging in the Actor Framework. I saved it in an older labview version (v16)
03-19-2020 12:15 PM
You forgot to upload Actor One.lvclass so everything is broken and I cannot debug. I'll try to build my own example in the meantime.
03-19-2020 12:18 PM
The forum doesn't allow me to load .lvclass (filetype not supported).
03-19-2020 12:34 PM - edited 03-19-2020 12:35 PM
Here is my working example with LV18 (zip file attached).
I noticed that in your <Trig>:User Event, the indicator is not wired:
03-19-2020 12:57 PM
@speclabAI wrote:
The forum doesn't allow me to load .lvclass (filetype not supported).
Put everything into a zip file and post that. It makes life easier on everybody.
03-19-2020 02:15 PM
Hi,
Yes, I got the same result. My question is why the data is labelled as 'Stop' and not 'Trig' in the bottom left hand corner of the UI Events. In the traditional way of doing it (without bundling into the CPD), the data for the trig event is labelled as it was when the event was created.
03-20-2020 12:17 AM
This is because when I created the controls to be added in the actor private data, I created the refnum from Create User Event function of the "Stop" event (right click on "user event out" -> Create -> Control) and then I copied the resulted refnum control and labeled it "Trig Ev". If instead of that, you create the second refnum from the Create User Event of the "Trig" event, the data of the event in the Event Structure will be labeled correctly "Trig".
03-20-2020 08:24 AM
Thank you. I think that cleared it up for me. I just couldn't understand how the two were different. Much appreciated!