none
System.timeoutexception in vc++2010 express edition RRS feed

  • Question

  • Hi everybody,

    I am using VC++ 2010 express edition with two serialport. suddenly show error message as belows,

    anybody got any idea for that?

    Monday, March 25, 2013 7:59 AM

All replies

  • Hi,
    Welcome here.
    According to your description, I'd like to move this thread to .NET Framework Class Libraries Forum for better support.
    Thanks for your understanding.
    Regards,


    Elegentin Xie
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 26, 2013 7:21 AM
  • Hi Mickey,

    Would you like to tell us more about your application?

    Where do you write data in serialport?

    What action cause above exception?

    Do you have any related code?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 28, 2013 2:24 PM
    Moderator
  • Hi everyone,

    Please anyone help !!!!! I am doing one project by using VC++  with two serial port. Sometime show error message "Microsoft .net Framework" the write time out.

    error is as belows:

    See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.TimeoutException: The write timed out. at System.IO.Ports.SerialStream.Write(Byte[] array, Int32 offset, Int32 count, Int32 timeout) at System.IO.Ports.SerialPort.Write(Byte[] buffer, Int32 offset, Int32 count) at BTREKCANDAEMONV1.WriteToSerial_PusherCount(SerialPort& serial_port, Int32 command, Int32 pusher_Count) at motorClass.TurnOff(motorClass* , SerialPort& serial_port, Int32 pusher_Count) at BTREKCANDAEMONV1.Form1.OffMotor() at BTREKCANDAEMONV1.Form1.Form1_FormClosed(Object sender, FormClosedEventArgs e) at System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e) at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- MRT-ONLINE Assembly Version: 1.0.4820.31316 Win32 Version: CodeBase: file:///C:/Program%20Files%20(x86)/SMC/MRT-ONLINE/MRT-ONLINE.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1002 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1001 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1001 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.233 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.233 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

    MY CODE AS BELOW:

    private:int writeSerial(array<unsigned char>^ buffer, int count)
    {
    int nn = 0;
    resend_datasize = 0;
    while(SeriallockFlag)
    Sleep(LockSleepMillsec);
    SeriallockFlag = 1;
    if (sPort&&(sPort!=nullptr)&&(sPort->IsOpen))
    {

    sPort->Write(buffer, 0, count);//SHOW ERROR THE WRITE TIME OUT
    nn = count;
    for (int ii=0;ii<nn; ii++)
    resend_databuffer[ii] = buffer[ii];
    resend_datasize = nn;
    }
    SeriallockFlag = 0;

    return nn;
    }

    Thanks in advance

    MICKYDORA

    Thursday, March 28, 2013 2:33 PM
  • Hi,
    Welcome here.
    Here you asked the same question:
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/288cad81-4f21-4f21-b7af-4af90222bff6
    So I will merge this one to the original, thanks for your understanding.
    Regards,

    Elegentin Xie
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 29, 2013 7:26 AM