Author |
Message |
angel61606
Joined: Jul 8, 2020 Posts: 106
|
Posted: May 24, 2021 3:20 PM 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: 1056
|
Posted: May 24, 2021 3:53 PM 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: 106
|
Posted: May 25, 2021 6: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: 1056
|
Posted: May 25, 2021 12:58 PM Post subject: |
|
Does this happen only when you open the dialog for the first time, or every time? |
|
 |
angel61606
Joined: Jul 8, 2020 Posts: 106
|
Posted: May 25, 2021 1:05 PM 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: 1056
|
Posted: May 25, 2021 1:22 PM 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: 106
|
Posted: May 25, 2021 1:39 PM Post subject: |
|
I have already tried that it did not work |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1056
|
Posted: May 25, 2021 2:52 PM 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: 106
|
Posted: May 26, 2021 11: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: 1056
|
Posted: May 26, 2021 1:28 PM 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. |
|