LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure and tab command

Hi,

 

I work on a program where I must change the tab command with an event (in my case, the motion of the wiimote on the right + B button change the tab value).

But my problem is that the tab change many times and not only one time.

I understand the problem: there is more than one event but I don't know how to solve it.

Can you help me?

Best regards.

 

Bonjour,

 

je travaille sur un programme où je veux changer les onglets de ma commande d'onglet suite à un évémnement (dans mon cas, le déplacement à droite de ma wiimote et l'appui sur la touche B).

Mon problème est que lorsque l'événement arrive, l'onglet change énormément de fois de valeur et non pas une seule fois.

je comprends que cela vient du fait qu'il y a plus qu'un seul événement mais je ne sais pas comment faire pour qu'il n'y en ai qu'un seul de pris en compte.

Pouvez-vous m'aider s'il vous plait?

 

Cordialement.

0 Kudos
Message 1 of 8
(2,998 Views)

Can you post the code? It is very difficult to answer without seeing the code.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 8
(2,996 Views)

It would be better if you can post the code that you have developed.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 8
(2,995 Views)

Hi,

 

I'm sorry, it was too late yesterday to create a simple Vi and send it.

Here is the simpliest Vi that I can create in order to explain you the issue.

The wiimote is controlled via the bluetooh port, nothing else.

 

Thanks for your help.


Sébastien

0 Kudos
Message 4 of 8
(2,967 Views)

Hi CIML,

 

Could you attached too the Wiimote State.ctl and Wiimote's VI please ?

 

They appear to be missing when opening it under LabVIEW 2012 :

Missing items.png

 

Thanks in advance,

0 Kudos
Message 5 of 8
(2,957 Views)

Please post the VI in 2009 version.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 6 of 8
(2,953 Views)

I think what is happening is that the Wiimote is firing the event multiple time while you have the button pressed. I do not have the hardware setup so I can't confirm. To fix this, add a shift register to store the previous value of the "B" button. If was true last time the event fired and true this time then don't change tabs. This would force the button to go from true back to false before you press the button again. You could also store the time of the last event and not change tabs if you changed tabs within some time window.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 7 of 8
(2,936 Views)

I guess the library used is this one: https://decibel.ni.com/content/docs/DOC-1353

 

Then the problem is to know when the events are triggered for the type "ButtonsAccel" => read the doc if there's one.

Did you try the LV examples provided with the lib? 

 

From an outsider point of view I don't see why the quasi-continuously changing acceleration would trigger only one event.

Maybe you will need to filter yourself inside the event to detect button state change.

 

0 Kudos
Message 8 of 8
(2,934 Views)