Sonnich Jensen
2016-07-07 14:21:11 UTC
Hi all
I have a some SW, which has worked for 6+ months, but now I sometimes get a
The requested resource is in use
on this line
MySerialPort.Write(buffer, 0, n);
At the state of SW the error it should not be busy, as it only started to communicate. The device should not send data at this moment.
My receiver part can also send data when started, but first it needs a setup message, then a "start process" message.
(the device will react to the setup message, I wait for that and only when "confirmed" I send the "start process")
MySerialPort.BytesToWrite does not seem to provide the values I need to know, as it returns simply 7.
I recall ports, which would fire an event when data was sent, and at that moment new date could be sent from a buffer.
I dont seem to have that option with the visual studio SerialPort.
Can anyone help in some way?
WBR
Sonnich
I have a some SW, which has worked for 6+ months, but now I sometimes get a
The requested resource is in use
on this line
MySerialPort.Write(buffer, 0, n);
At the state of SW the error it should not be busy, as it only started to communicate. The device should not send data at this moment.
My receiver part can also send data when started, but first it needs a setup message, then a "start process" message.
(the device will react to the setup message, I wait for that and only when "confirmed" I send the "start process")
MySerialPort.BytesToWrite does not seem to provide the values I need to know, as it returns simply 7.
I recall ports, which would fire an event when data was sent, and at that moment new date could be sent from a buffer.
I dont seem to have that option with the visual studio SerialPort.
Can anyone help in some way?
WBR
Sonnich