LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger event when value from accelerometer go over set limit

Hello,

My situation is following. I have two types of information coming to my system in real time - from 2 separate devices (Lets say GPS and IMU sensor). One is position of object in xy coordinates and second is data from IMU sensor (acc, gyro and mag).

Everything is already working perfectly - separately.

Now I would like to make it work like that: 

When value from accelerometer go over limit (lets say 16G) it would need to create event which would read and save position in that exact moment from GPS sensor. 

Real world example: Football player. He would carry IMU sensor on his leg and GPS receiver on his body. When he would hit the ball there would be a spike (value) from accelerometer which would go over set limit and also position xy in that exact moment. System would need to register that spike from accelerometer and read position in the moment of spike. 

 

Can you please help me with the code or appoint me to some examples, tutorials, since I am new to labview and never dealt with events. 

Thank you for your help in advance.

0 Kudos
Message 1 of 2
(2,372 Views)

hi there!

 

first i'd recommend skimming through this https://forums.ni.com/t5/Community-Documents/Unofficial-Forum-Rules-and-Guidelines/ta-p/3536495

at the bottem (as well as at the top of this forum https://forums.ni.com/t5/LabVIEW/bd-p/170) you will find some links to learning material. if you have a valid subscription, then do take the core1 and core2 of the self-paced learning from NI.

 

regarding your problem, i'd say you should have three loops,

one for each data-source, then you can regulate the measurement intervals of each,

and a third loop, that can manage the gui (e.g. input reads).

 

use queues/user-events/notifiers to get information to your state-machine (gui) loop.

i personally prefer User Events (since you can react on them with the Event Structure,

otherwise they work like queues).

 

this is a combination of producer-consumer and state-machine design pattern.

for examples, have a look in Labview's Examples ("Help" -> "Find Examples"),

and use the search terms in the forum.

 

hope that helps pointing you in the right direction.

 

come back with your tries, and people will critique them,

so you can learn from the experience of the people here in the forum.

 

regards


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 2
(2,359 Views)