04-15-2012 03:31 PM
I do not know what is wrong here. I am not able to get the bandwidth that I desire (2kHz). On the "print screen" from LabView, it looks like the bandwidth
is approx. 100Hz. I think that the problem is in the programming. I have attached the VI.
Any suggestion is very much appreciated!
Hardware:
I/O Board, Phidgets 8/8/8, Update rate 2kHz.
Sensor, accelerometer, bandwith 2,5kHz
Kind regards,
Leif Lindgren, Newbe to LabView
04-15-2012 04:08 PM
Well, your loop contains a 10ms wait, which limits the loop rate to 100Hz, right? 😄
(I cant really tell more, because all your subVIs are missing, but the code looks overy convoluted. You do a lot of unecessary or duplicate operations)
04-15-2012 09:30 PM
Are you trying to get an update rate of 2kHz in software? For an extended period of time? If so, forget it. You can't guarantee that level of speed in a non-real-time OS. You will need to do hardware-based timed acquisitions or a real-time OS.
04-16-2012 09:38 AM
Hi Altenbach,
Thank you for a fast reply!
I have changed the "wait" to 1mS, but no difference.
"but the code looks over convoluted" - Yes, this is just a way for a newbe to get a start with the I/O board to comunicate with LabView. This original VI is an example that come with the Phidgets I/O board, and I customized a little. Just to get a start.
"I cant really tell more, because all your subVIs are missing" - Oh, I did not know that. Is there a way to include the subVI's ?
/Leif
04-16-2012 09:56 AM
Thank you smercurio_fc for your fast reply!
"Are you trying to get an update rate of 2kHz in software? For an extended period of time?" - An acquisition time of 3 to 5 seconds is just about it.
Any suggestion why the bandwidth shown in LabView is so low ?
/Leif
04-16-2012 10:17 AM
@Loola wrote:
"I cant really tell more, because all your subVIs are missing" - Oh, I did not know that. Is there a way to include the subVI's ?
Yes, you can zip all the subVIs.
One thing is that the phidget provided driver tools are not very well written and all dll calls are forced to run in the UI thread. According to them, this is actually not necessary, so you should change the dll calls to run in any thread.
04-16-2012 03:00 PM
altenbach,
"Yes, you can zip all the subVIs" - I hope that the attachment will contain all the VI's
/Leif
04-17-2012 01:47 AM - edited 04-17-2012 01:51 AM
I am not familiar with your device, but I quickly glanced at the manual (assuming you have the 1018). You need to read the specifications of your device:
While the data rate can be from 1 to 1000 samples per second, they are only transmitted every 8ms to the PC over USB. You are reading a single point, so the max rate is 125Hz.
I don't understand why you do the IFevent stuff? That only seems to return data when the input changes (if I understand this correctly). Does it actually?
To get the max rate, you should set the rate to 1kHz and simply read the sensor value. If you read every 8 ms, you'll get 8 samples at a time (see e.g. page 13).