Grueni
FabulaTech Forum Newbie
Gender: Posts: 3
|
|
Windows exeption
on: May 23rd, 2011, 2:49am |
Quote Modify
|
Hello all, I need your help. we use the control to communicate with a measuring device. It sends 10 ASCII for a single measurment. We measure 4000 times / sec. All goes well for a couple of hours. But some times we get a windows exeption: in this code section: Private Sub CHRControl_OnReceive(ByVal Sender As Object, _ ByVal NumberOfBytesInBuffer As System.UInt32) _ Handles CHRControl.OnReceive '---------------------------------------------------------------- Dim BytesInBuffer(CInt(NumberOfBytesInBuffer - 1)) As Byte Dim ActualNumberOfBytesInBuffer As Integer = 0 Try ActualNumberOfBytesInBuffer = _ CInt(CHRControl.ReadArray(BytesInBuffer)) If ActualNumberOfBytesInBuffer > 0 Then '--------------------------------------------------------- CHRBuffer.Append(Encoding.ASCII.GetString(BytesInBuffer)) '--------------------------------------------------------- End If Catch ex As FabulaTech.SPC.FTSPCException End Try End Sub We are using Windows 7 prof. 32Bit Fabula control 2.0 Visual Studio 2011 VB.net The exception says overflow of "NumberOfBytesInBuffer"= 4294966994 Overflow Exception arithmetric operation resulted in an overflow Do you have any advice? Thanks Rainer
|