Menu

Unhandled exception error

2021-08-07
2021-08-08
  • Bojan Stajcar

    Bojan Stajcar - 2021-08-07

    Robert,
    After successful compilation and f/w upload, I tried to power-up and focuser itself works with buttons, motor is moving, then stops (when limit is reached.. so everythin looks normal).
    Then I tried I tried to connect it to myFocuserPro windows application (v.1.04..2).
    It tries to connect (com13, 9600) but fails and then I have Unhandled exception error, see below.
    What I am doing wrong?

    Thanks again for your help and best regards,
    Bojan

    ** Exception Text **
    System.ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length
    at System.String.Substring(Int32 startIndex, Int32 length)
    at myFocuserPro.Focuser.GetFirmwareRev()
    at myFocuserPro.Focuser.ConnectBtn_Click(Object sender, EventArgs e)

     
  • Bojan Stajcar

    Bojan Stajcar - 2021-08-07

    Wrong Baud rate? W' app default rate is 9600.
    So I changed that to 57600
    Now there is no Exception error, buy it's still not connected (because it requires 9600).... so when I click anything to change parameters, in Status Messages window there is a message "Serial port is not connected" and all soft buttons are grayed.
    Do I have to have 470uF cap on Reset connected, could this be the cause of my problem?

     

    Last edit: Bojan Stajcar 2021-08-07
  • Bojan Stajcar

    Bojan Stajcar - 2021-08-07

    I tried previous version (myFocuserProL) and it connects, but I still I have exception error when trying to Set parameters.
    What is wrong here?

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ** Exception Text **
    System.FormatException: Input string was not in a correct format.
    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
    at myFocuserProL.Focuser.movefocusercmd(Int32 steps)
    at myFocuserProL.Focuser.plus10btn_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

     

    Last edit: Bojan Stajcar 2021-08-07
  • Bojan Stajcar

    Bojan Stajcar - 2021-08-07

    OK, all sorted...
    I was using wrong version of software.
    Actually, Souceforge is quite confusing sometimes, I thought I was downloading the right files, but that was not the case. I had to specifically search for ver. 2 to find it.
    I hope I won't bother you again with this.
    Bojan

     
  • Bojan Stajcar

    Bojan Stajcar - 2021-08-08

    Robert,
    thank you for the tips.
    I think I found and inserted all relevant subroutines into ULN2003 code, it compiles OK but some things are still missing before I try to upload and test.
    Anyway, I am not in a hurry with this since I already have what I needed (focus control via USB), more important now are mechanicals for my C11.
    Thanks again,
    Bojan

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.