Menu

BaudRate set bug in DF1comm.vb

Help
2011-11-18
2013-05-30
  • Yardape8000

    Yardape8000 - 2011-11-18

    in beta 319
    lines 103 - 105
                If value <> m_BaudRate Then
                    If DLL IsNot Nothing Then
                        DLL(MyDLLInstance).CloseComms()

    Shouldn't line 104 be:
                    If DLL(MyDLLInstance) IsNot Nothing Then

    Otherwise it crashes if you change the baud rate value.

    Just started looking at the program, looks nice so far.

     
  • Yardape8000

    Yardape8000 - 2011-12-04

    I noticed the bug in "DF1comm.vb" was not fixed in the new 321 release.

    If I do not modify the source code as I mentioned, any compiled programs will crash on launching in set_BaudRate() if it is not set to AUTO.

    Thanks

     
  • Archie

    Archie - 2011-12-05

    This fix was missed in 3.21

    I changed the code to this:

                If value <> m_BaudRate Then
                    If Not Me.DesignMode Then
                        '* If a new instance needs to be created, such as a different Com Port
                        CreateDLLInstance()

                        If DLL(MyDLLInstance) IsNot Nothing Then
                            DLL(MyDLLInstance).CloseComms()
                            Try
                                DLL(MyDLLInstance).BaudRate = value
                            Catch ex As Exception
                                '* 0 means AUTO to the data link layer
                                DLL(MyDLLInstance).BaudRate = 0
                            End Try
                        End If
                    End If
                    m_BaudRate = value
                End If

     

Log in to post a comment.