View unanswered posts | View active topics It is currently 10 Nov 2024, 22:23



Reply to topic  [ 2 posts ] 
multiple reading 
Author Message

Joined: 12 Aug 2009, 18:21
Posts: 2
Reply with quote
Hi all,
I am working towards a patch that will detect a fall. At the moment i hav a patch that gives a warning if the x value from the Shimmer goes below a certain value i.e. the subject is at a certain angle. code to create this block is:
double d = _pInInPin1->GetValue();
CSTR str = "WARNING THE USER HAS FALLEN";

if(d < 1800)
_pOutOutPin1->SetValue(str);
_pOutOutPin1->SetCreationTime(_clockPtr->GetTime());

I want to have a block that will constantly read in the value and maybe store it in an array or list of some kind and compare it to see when there was a sudden change.
The input seems to only be read once if i use double for input pin and i can work on that value but i want values to be constantly input in the block. i was trying using a MatrixDouble as the type for input pin but i am having trouble getting the values to the output pin.


Can anyone help with this?
i would be very grateful, Thanks, Aidan.


12 Aug 2009, 19:14
Profile

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
You can use DoubleMatrix or a TimeSeries as input (e.g., sampleddata).
Otherwise, you can store the data inside your block and generate the output only when the event your are detecting occurs.

Paolo


26 Nov 2009, 15:41
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.