Ok the first timer is called that sets up the WorkerThread the
second sub is called, however what I would like to do is pass both COM
ports information in the Private Sub DODSIWork but for some reason it
only accepts t information from COM port 1
Any ideas?
Public Sub StartWorkerThre adDualDSI1(ByVa l gageType As String)
Case "DSI"
AddHandler dataBackgroundW orker.DoWork, AddressOf
DoDualDSIWorkCO M1
AddHandler dataBackgroundW orker.RunWorker Completed,
AddressOf DualDSIWorkComp lete
expectedBaudRat e = "9600"
AddHandler dataBackgroundW orker2.DoWork, AddressOf
DoDualDSIWorkCO M2
AddHandler dataBackgroundW orker.RunWorker Completed,
AddressOf DualDSIWorkComp lete
expectedBaudRat e = "9600"
End Select
currentSerial = GetSerialPortUs ed(1)
ChangeCOMBaudRa teIfNecessary(e xpectedBaudRate )
currentSerial2 = GetSerialPortUs edCOM2(2)
ChangeCOMBaudRa teIfNecessary(e xpectedBaudRate )
dataBackgroundW orker.RunWorker Async(New Object()
{currentSerial} )
dataBackgroundW orker2.RunWorke rAsync(New Object()
{currentSerial2 })
Me.tmrBackgroun dWorker.Enabled = True
Me.tmrBackgroun dWorker2.Enable d = True
End sub
Private Sub DoDSIWork(ByVal sender As Object, ByVal e As
DoWorkEventArgs )
Try
Dim args() As Object = e.Argument
Dim intloop As Integer
CType(args(0), IO.Ports.Serial Port).DiscardIn Buffer()
muxClass.GetDSI Input(CType(arg s(0), IO.Ports.Serial Port),
pFile.Gages(int loop))
Catch ex As Exception
tListener.AddMe thodError(ex)
End Try
End Sub
second sub is called, however what I would like to do is pass both COM
ports information in the Private Sub DODSIWork but for some reason it
only accepts t information from COM port 1
Any ideas?
Public Sub StartWorkerThre adDualDSI1(ByVa l gageType As String)
Case "DSI"
AddHandler dataBackgroundW orker.DoWork, AddressOf
DoDualDSIWorkCO M1
AddHandler dataBackgroundW orker.RunWorker Completed,
AddressOf DualDSIWorkComp lete
expectedBaudRat e = "9600"
AddHandler dataBackgroundW orker2.DoWork, AddressOf
DoDualDSIWorkCO M2
AddHandler dataBackgroundW orker.RunWorker Completed,
AddressOf DualDSIWorkComp lete
expectedBaudRat e = "9600"
End Select
currentSerial = GetSerialPortUs ed(1)
ChangeCOMBaudRa teIfNecessary(e xpectedBaudRate )
currentSerial2 = GetSerialPortUs edCOM2(2)
ChangeCOMBaudRa teIfNecessary(e xpectedBaudRate )
dataBackgroundW orker.RunWorker Async(New Object()
{currentSerial} )
dataBackgroundW orker2.RunWorke rAsync(New Object()
{currentSerial2 })
Me.tmrBackgroun dWorker.Enabled = True
Me.tmrBackgroun dWorker2.Enable d = True
End sub
Private Sub DoDSIWork(ByVal sender As Object, ByVal e As
DoWorkEventArgs )
Try
Dim args() As Object = e.Argument
Dim intloop As Integer
CType(args(0), IO.Ports.Serial Port).DiscardIn Buffer()
muxClass.GetDSI Input(CType(arg s(0), IO.Ports.Serial Port),
pFile.Gages(int loop))
Catch ex As Exception
tListener.AddMe thodError(ex)
End Try
End Sub