Products for USB Sensing and Control
It is currently Mon Oct 20, 2014 11:17 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Jan 12, 2012 5:34 am 
Offline
Phidgetsian

Joined: Thu Oct 06, 2011 9:15 pm
Posts: 8
When i set my phidget data rate to lower than 64 ms

Peak appears shown in the figure? why's that?

It's only the magnetic field comes with that problem


Attachments:
wrong.png
wrong.png [ 55.48 KiB | Viewed 351 times ]
Top
 Profile Send private message  
 
PostPosted: Thu Jan 12, 2012 6:16 am 
Offline
Phidgetsian

Joined: Thu Oct 06, 2011 9:15 pm
Posts: 8
the problems appear only in matlab, it's alright for other compilers


Top
 Profile Send private message  
 
PostPosted: Thu Jan 12, 2012 9:03 am 
Offline
Human-Cyborg Relations
User avatar

Joined: Tue Sep 27, 2011 2:37 pm
Posts: 406
Location: Calgary
From page 14 of the 1056's product manual:

"Magnetic field data will become unavailable for ~28ms every 2 seconds as the compass performs internal calibrations. During this time, polling the magnetic field will return EPHIDGET_UNKNOWNVAL, or throw an UNKNOWNVAL exception. The magnetic field data in the SpatialData event will equal PUNK_DBL."

_________________
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com


Top
 Profile Send private message  
 
PostPosted: Thu Jan 12, 2012 10:43 am 
Offline
Phidgetsian

Joined: Thu Oct 06, 2011 9:15 pm
Posts: 8
burley wrote:
From page 14 of the 1056's product manual:

"Magnetic field data will become unavailable for ~28ms every 2 seconds as the compass performs internal calibrations. During this time, polling the magnetic field will return EPHIDGET_UNKNOWNVAL, or throw an UNKNOWNVAL exception. The magnetic field data in the SpatialData event will equal PUNK_DBL."

but why I didn't find this happen in other compiler like netbean

can i actually avoid it in matlab by other means?


Top
 Profile Send private message  
 
PostPosted: Thu Jan 12, 2012 11:15 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2630
Location: Canada
You need to check the return value from the CPhidgetSpatial_getMagneticField call - if it is EPHIDGET_UNKNOWNVAL, don't use the data.

-Patrick


Top
 Profile Send private message  
 
PostPosted: Fri Jan 13, 2012 9:25 pm 
Offline
Phidgetsian

Joined: Thu Oct 06, 2011 9:15 pm
Posts: 8
Thanks very much for you guys' answer

But one last question, did any one know how to made matlab act like java listen, that is, the program runs whenever data comes it, instead of the matlab, which I have to set a pause every time to wait for the new data, i think this kinda inaccurate.

Anyone one got experience on that?


Top
 Profile Send private message  
 
PostPosted: Mon Jan 16, 2012 8:10 am 
Offline
Human-Cyborg Relations
User avatar

Joined: Tue Sep 27, 2011 2:37 pm
Posts: 406
Location: Calgary
Matlab is not capable of doing events. It is one of the shortcomings of the language.

_________________
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Jump to:  
Powered by phpBB® Forum Software © phpBB Group