Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: High Sampling rate and problem with dialog windows
Reply to topic
Author Message
angel61606



Joined: Jul 8, 2020
Posts: 53

PostPosted: May 24, 2021 10:20 AM    Post subject: High Sampling rate and problem with dialog windows

Hi
I am using high sampling rate ,2000 sample per second. I use oscilloscope to show my signals and when I open a dialog window the signals stops. I checked what happens with a port monitoring, and i noticed I lose data samples for a about half of seconds . it seems opening dialog windows in bioera would be troublesome in high sampling rates. Any solution? u should consider this fact that even using separate threads for processing signal and dialog windows does not solve the problem.
jarek



Joined: Oct 22, 2007
Posts: 886

PostPosted: May 24, 2021 10:53 AM    Post subject:

Most dialogs should run on a separate thread. But showing a dialog may slow down java when executed the first time (because some initialization may be needed on the main thread). If you tell how exactly you open the dialog (or send a snippet) I can take a look.

You might want to try to change this advanced property "Detect data spikes" to "Always" in SerialPort. Not sure if that can help, but is worth trying.
angel61606



Joined: Jul 8, 2020
Posts: 53

PostPosted: May 25, 2021 1:21 AM    Post subject:

well, I tried to change "Detect data spikes" to "Always" in SerialPort, and it did not work. there is a button which when i press, a nested design runs at "separate dialog 1" . I also checked the option "process in seperate thread " for it but it still didn't work ;|
jarek



Joined: Oct 22, 2007
Posts: 886

PostPosted: May 25, 2021 7:58 AM    Post subject:

Does this happen only when you open the dialog for the first time, or every time?
angel61606



Joined: Jul 8, 2020
Posts: 53

PostPosted: May 25, 2021 8:05 AM    Post subject:

It depends, in core i7 computers, it happens the first time, but in slower computers all the time. I counted the number of samples I lost, sometimes I lose over 1200 samples bc of this, which is unacceptable. ;(
jarek



Joined: Oct 22, 2007
Posts: 886

PostPosted: May 25, 2021 8:22 AM    Post subject:

Here is an idea: try to put the SerialPort element inside a nested design with "Process in separate threat" option set.
angel61606



Joined: Jul 8, 2020
Posts: 53

PostPosted: May 25, 2021 8:39 AM    Post subject:

I have already tried that it did not work
jarek



Joined: Oct 22, 2007
Posts: 886

PostPosted: May 25, 2021 9:52 AM    Post subject:

That is unexpected.

Maybe try again and only include your SerialPort in a nested design like that, nothing else. Then watch console for errors and make sure there are no warnings related to "buffer overflow".
angel61606



Joined: Jul 8, 2020
Posts: 53

PostPosted: May 26, 2021 6:42 AM    Post subject:

I did what you asked me to do, but it did not work. I had a nested in which I just put Serial Port, with "Process in separate threat" option set. I do not have any buffer overflow warning however yet opening any dialog window make my signal stop. ;(
jarek



Joined: Oct 22, 2007
Posts: 886

PostPosted: May 26, 2021 8:28 AM    Post subject:

The point of this was to make sure you do not loose any data from the device to your serial port. You mentioned a monitor which you can use to detect that.

The BioEra display may be affected by a dialog for a short time (or other things like a Windows activity), so can the feedback, but it should recover shortly after that without a change to the continuity of the signal.
Reply to topic