Dear all,
I'm using a worker script to communicate using a serial port.
I've 2 functions to open and close the serial port: this is mandatory for my application because of I've to switch from 2 different baudrates and protocols.
This is part of my script:
If I call "comInit()" just 1 time, all comes fine: I receive the frames correctly.
After calling "comStop()" and "comInit()" again, the receive operation doesn't work properly: it seems the receiveid characters are duplicated.
Fill free to ask me any kind of clarification.
KR.
GDM
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you have to call scriptInf.dataReceivedSignal.disconnect(rxCallback) or call connect only once. If you don't do this the signal is connected several times to the slot function and therefore the slot function will be called several times.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-01-04
Hi Stefan,
thank you for your kind reply.
I confirm your solution solves the "issue".
I just inform you the "disconnect()" method seems not documented.
KR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I'm using a worker script to communicate using a serial port.
I've 2 functions to open and close the serial port: this is mandatory for my application because of I've to switch from 2 different baudrates and protocols.
This is part of my script:
If I call "comInit()" just 1 time, all comes fine: I receive the frames correctly.
After calling "comStop()" and "comInit()" again, the receive operation doesn't work properly: it seems the receiveid characters are duplicated.
Fill free to ask me any kind of clarification.
KR.
GDM
Hi,
you have to call scriptInf.dataReceivedSignal.disconnect(rxCallback) or call connect only once. If you don't do this the signal is connected several times to the slot function and therefore the slot function will be called several times.
Hi Stefan,
thank you for your kind reply.
I confirm your solution solves the "issue".
I just inform you the "disconnect()" method seems not documented.
KR
I will add this to the manual for the next release. Thx for reporting this.