LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic event structure example- Help

Solved!
Go to solution

Hello All,

 

I am programming in Labview from two months...  starter... I a want to use a event structure in my case, So I started with examples and  had a problem understanding one.

This is the example I am talking about     labview\examples\general\dynamicevents.llb\dynamicallr register for events.vi

 

1) In the blockdiagram , outside while loop , can you please explain the three inputs given to the thrre propertis under Register event property node ??? 

 

2) Why to use shift registers for sending the Register events into while loop ? Why dosent a tunnel works in this case ?

 

3) Inside the event event strucure why we have again include 'Register event' property node and how to give reference to its properties ?

 

4) In the while loop, event case 1 Mouse down event , mouse down property is left free, but mouse move was connected to sone refernce, how does this works ???

 

I would be glad if can refer me some literature about his event structures

 

Thank you

 

Regards

Neo 

 

 

0 Kudos
Message 1 of 11
(5,326 Views)

@Neo6 wrote:

1) In the blockdiagram , outside while loop , can you please explain the three inputs given to the thrre propertis under Register event property node ??? 


These are references.  The first is a reference to a VI.  The other two are an array of references to the controls in the current VI.


@Neo6 wrote:

2) Why to use shift registers for sending the Register events into while loop ? Why dosent a tunnel works in this case ?


Because what is being registered is changed inside of the structure.  You need to save this registration in the shift register or you will be registered back to the original registration.


@Neo6 wrote:

3) Inside the event event strucure why we have again include 'Register event' property node and how to give reference to its properties ?


The writer is dynamically changing what controls/VI the events are registered for.


@Neo6 wrote:

4) In the while loop, event case 1 Mouse down event , mouse down property is left free, but mouse move was connected to sone refernce, how does this works ???


As the comment states, there is not change to what controls the mouse down and mouse up events are registered to.  If you don't wire anything to them, they keep what was in the event registration wire.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(5,317 Views)

Hi Neo,

 

there are comments in the block diagram to comment all those operations.

 

The point is to register the mouse move event only when it is needed: between mouse down and mouse up...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(5,313 Views)

HI  @Gerd , @ crossrulz,

 

Thank you for the reply, I will go through it and report you back

 

Thank you once again

 

 

Regards

Neo

0 Kudos
Message 4 of 11
(5,279 Views)

Hi Crossrulz,

 

Now I can understand the logic behind mouse, up down events, But I have still more to go

 

1)In event structure, in Mouse move event, Can you please explain me how the refernce is connected to property node, what reference willit get from shift register ? and what is logic behind it ?? What is need to connect its output again to shift register ??

 

2)In mouse down event, What is need of control reference to tunnel via event structure and end with shift register ?

 

3)In mouse up event why 'not refnum constsnt' is tunneled and terminate with shift register on while loop ?

 

what all I know about shift registers is, it store a value on for loop whichis useful for iteration .......  If  you think I need more knowledge on shift registers prior to this example, please refer to me to good literature, Or I will be glad if you can asnswer my questions

 

Thanks and Regards

NEO

0 Kudos
Message 5 of 11
(5,261 Views)

Neo6 wrote:

1)In event structure, in Mouse move event, Can you please explain me how the refernce is connected to property node, what reference willit get from shift register ? and what is logic behind it ?? What is need to connect its output again to shift register ??

 

2)In mouse down event, What is need of control reference to tunnel via event structure and end with shift register ?

 

3)In mouse up event why 'not refnum constsnt' is tunneled and terminate with shift register on while loop ?


This VI was written so that it could have more controls and automatically work with them.  Think about the sequence of things to happen.

  1. User clicks on control (mouse down).  What control?  Oh, we grab its reference and save it in the shift register for use in the mouse move event.
  2. The user is dragging around the control (mouse move).  Which control?  Oh, we saved it in the shift register.  Now we can move it to where the mouse is.
  3. The user releases the mouse button (mouse up).  We don't want our control to move anymore.  Just shove a NULL into the shift register so we don't accidentally move any controls while the user is moving the mouse around.

I modified the example here so you can see how it works with multiple controls.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 11
(5,252 Views)

Hi Crossrulz,

 

Thanks for  your patience..... 90% clear... I will the execute the program and report you back.

 

Thankyou very much

 

Regards

Neo

0 Kudos
Message 7 of 11
(5,218 Views)

Hello Crossrulz,

 

I executed the vi. I have few more questions

 

1)At the very begining, when I hit the run, what all the events available for the event structure in the while loop  ? (If I understand correctly, all the events associated with front pannel controls and mouse move are available since they are registered outside the loop . Am I correct ????)

 

2)Along with all the pannelcontrol events, there is also one mouse move event is already registered outside the while loop and sent to the event structure, but again inthe 'Mouse down' event we are again registering the 'mouse move' event and storing in shift register.  What is the difference between registering outside while loop  and Registering inside the 'mouse down' event structure ?   If registering inside a event structure is updating the already existing event or is it filling the empty position for the Event structure ????

 

If it is updating process , what are the parameters it is updating in the already existing event ?

 

Regards

Neo.

0 Kudos
Message 8 of 11
(5,208 Views)

Hello Crossrulz,

 

Waiting for your reply for tmy ybove questions

 

Thank you

 

Regards

Neo

0 Kudos
Message 9 of 11
(5,167 Views)
Solution
Accepted by topic author Neo6

@Neo6 wrote:

1)At the very begining, when I hit the run, what all the events available for the event structure in the while loop  ? (If I understand correctly, all the events associated with front pannel controls and mouse move are available since they are registered outside the loop . Am I correct ????)


Technically, all of the events are available.  It is just a matter of what objects will cause the events.  Initially, the Mouse Move event is registered to a NULL VI.  Since there isn't one of those around, the event won't happen.  The Mouse Up and Mouse Down were associated with all of the controls on the front panel.  So if the mouse went up or down on a control, the event would fire.

 


Neo6 wrote:

2)Along with all the pannelcontrol events, there is also one mouse move event is already registered outside the while loop and sent to the event structure, but again inthe 'Mouse down' event we are again registering the 'mouse move' event and storing in shift register.  What is the difference between registering outside while loop  and Registering inside the 'mouse down' event structure ?   If registering inside a event structure is updating the already existing event or is it filling the empty position for the Event structure ????


We are simply updating what object can cause the event.  Inside of the Mouse Down event, we say that the current VI can cause a Mouse Move event.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 11
(5,163 Views)