Error writing on serial port problem

Open a thread for a question about the simulator control software.
If you cannot receive any data in the input setup use the upper two forums!

Re: Error writing on serial port problem

Postby JBDLink » Sun 5. Jun 2016, 00:10

sirnoname wrote:The problem is to change X-Sim to use other WinAPI commands, not to change USO.
For now X-Sim send xyz zu the serial buffer and return immediatelly because it is only memory to serial port output buffer memory. I have to increase the WinAPI calls to a longer wait cycle.

Code: Select all
m_CommTimeouts.ReadIntervalTimeout = 50;
m_CommTimeouts.ReadTotalTimeoutConstant = 50;
m_CommTimeouts.ReadTotalTimeoutMultiplier = 10;
m_CommTimeouts.WriteTotalTimeoutConstant = 50;
m_CommTimeouts.WriteTotalTimeoutMultiplier = 0;


So it waits for 50ms for a buffer transfere.

By the way, what happens if you run in the program setup with the profiler on a single CPU core?
And try to increase the main program task priority in same dialog.



where I can change this values?

thanks in advance!
JBDLink
 
Posts: 19
Joined: Wed 25. May 2016, 18:31
Has thanked: 0 time
Been thanked: 0 time

Re: Error writing on serial port problem

Postby sirnoname » Sun 5. Jun 2016, 15:34

You cannot change this.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Error writing on serial port problem

Postby JBDLink » Sun 5. Jun 2016, 15:58

sirnoname wrote:You cannot change this.

Like you recomend me before I tried to play with the device manager opened but no refresh when I get the serial write error. Seems no usb problem to me.

And the problem always at same minute.

I tried with an Arduino UNO on Com4 instead of Arduino Mega on Com3 but same problem.

I tried with no motors at all, same problem.

I have unchecked the power saving option in all my usb ports.

I have updated the USB drivers on my computer again.

My OS is Windows10. My computer is i7 6700k, 16gb ram, Asus Z170 mobo and GTX970. And G27 steering wheel and Trust master T Flight Hotas.

is there any way for making x-sim to autoreconect after the error? if I close the error window and click start again on x-sim all works good for 3-4 minutes more.

I'm empy of ideas! And this error stops me to continue working.

Thanks for your time and help.
JBDLink
 
Posts: 19
Joined: Wed 25. May 2016, 18:31
Has thanked: 0 time
Been thanked: 0 time

Re: Error writing on serial port problem

Postby sirnoname » Sun 5. Jun 2016, 16:15

What about set the priorities high (or realtime) in program setup and use single CPU option?
Should be USO priority or main.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Error writing on serial port problem

Postby JBDLink » Sun 5. Jun 2016, 16:20

sirnoname wrote:What about set the priorities high in program setup and use single CPU option?

Yes, tried Too. I have priorities in real time in the program and single CPU checked.

I also have played with baud speed with no luck.
JBDLink
 
Posts: 19
Joined: Wed 25. May 2016, 18:31
Has thanked: 0 time
Been thanked: 0 time

Re: Error writing on serial port problem

Postby sirnoname » Sun 5. Jun 2016, 16:44

Do your Arduino use FTDI Chips? If yes post the device manager advanced properties.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Error writing on serial port problem

Postby JBDLink » Sun 5. Jun 2016, 18:19

sirnoname wrote:Do your Arduino use FTDI Chips? If yes post the device manager advanced properties.

I have studied and I think the arduino Uno don't use an FTDI chip

https://learn.adafruit.com/arduino-tips ... no-uno-faq
JBDLink
 
Posts: 19
Joined: Wed 25. May 2016, 18:31
Has thanked: 0 time
Been thanked: 0 time

Re: Error writing on serial port problem

Postby JBDLink » Wed 8. Jun 2016, 13:41

Well, I changed all my Arduino code to go through OBD2 instead of USO, and now is working like a charm!

I think the arduino USO serial write problem comes from the Converter Aplication.

PD: Now that I have solved my first problem and can play more time, another problem comes to me: Bass shakers stops playing sound after a random time, but this is for another post.
JBDLink
 
Posts: 19
Joined: Wed 25. May 2016, 18:31
Has thanked: 0 time
Been thanked: 0 time

Re: Error writing on serial port problem

Postby Chesin » Tue 4. Oct 2016, 02:13

Hi JBDLink,
I'm having the same problem as you. How did you change the Arduino code to go through OBD2 instead of USO? is there any other setup should be performed on Converter Application??

Thanks in advance!
Chesin
 
Posts: 1
Joined: Tue 4. Oct 2016, 02:03
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Converter questions

Who is online

Users browsing this forum: No registered users and 2 guests