From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial reading sample rate

Solved!
Go to solution

Hi

 

I'am reading from a serial device with VISA.

 

I am reading the data OK but I like to know how can I measure the sample rate (Hz) ? 

 

The data is displayed on a Waveform Chart.

 

Thanks

0 Kudos
Message 1 of 8
(5,327 Views)
The sample rate is something that the device using the RS232 communication controls. The sample rate will be limited by the RS232 transmission speed. But the sample rate and the communication speed is not directly linked to each other.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 8
(5,320 Views)
Solution
Accepted by topic author John_Rif

hi,

 Place  a while loop and place wait until next ms multiple vi and wire to some 1000.Inside the while write the program for acquisition through the serial port.Now after some time..stop the while loop and check the value of i(no of seconds)...and check the array size of the values...and like that you can calculate the sampling rate...Remember it is a software timing(maynot be correct).

 

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 3 of 8
(5,318 Views)

Hi

 

I managed to get the sample rate and is somehow lower than I expected.

 

With another program I get around 50Hz and with Labview ~33Hz.

 

Can I finetune VISA to get a higher sample rate ?

 

Thank you

0 Kudos
Message 4 of 8
(5,287 Views)

The RS232 isn't that fast, so you should be able to fetch all values. Nice task for a consumer producer architekture.

If you post your reading code it would be easier to help.

 

Read the manual of your device, sometime they offer a mode to send continously values at a defined (max) frequency....   BTW what device? Maybe there is already a ready made driver for it.

 

/cristall ball mode

init the visa port once at beginning and close it once at the end will speed up things a lot....

/cristall ball mode off

Message Edited by Henrik Volkers on 04-30-2010 03:35 PM
Message Edited by Henrik Volkers on 04-30-2010 03:36 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 8
(5,278 Views)

I used the advanced serial example from Labview, I attached the parameters. The device is supporting a baud rate of 115200, I tried with 9600 and the same ~33Hz.

 

The data I read is OK, is terminating with C1.

 

The device is sending with a sample rate of 50Hz, with another program (EyesWeb http://musart.dist.unige.it/EywMain.html) the sample rate it's OK.

 

 

0 Kudos
Message 6 of 8
(5,262 Views)
No idea how you are measuring 33Hz. The example you mention will only run once so sample rate does not apply. If you are doing something silly such as using the run continuous button, stop doing that. That is not at all the correct method to run. You would have to modify the esxample to add a while loop around the read and write portion.
Message 7 of 8
(5,250 Views)
Thank you Dennis, now I am getting 50Hz.
0 Kudos
Message 8 of 8
(5,236 Views)