Discussion:
[mono-vb] Serial port PinChanged handle (Vb Win to Linux)
Fábio Braglin
2014-06-20 12:37:48 UTC
Permalink
Dear,

I have a simple application in vb that check the SerialPort (previously
choosed) and wait for a Dsr pin change.

This code works in Windows, but not in Ubuntu 14, doesn't shows any error
message, I'm using a Serial-USB adapter, so, I can see that the Serial port
is open because de data LED is blinking, but nothing happens when the
external signal arrive!

* Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click*
* With SerialPort1*
* If .IsOpen = True Then .Close()*
* .PortName = ComboBox1.SelectedItem*
* .DtrEnable = True*
* .RtsEnable = True*
* .Open()*
* End With*
* Timer1.Enabled = True*
* End Sub*
* Private Sub com_PinChanged(sender As Object, e As
System.IO.Ports.SerialPinChangedEventArgs) Handles SerialPort1.PinChanged*
* Try*
* If IO.Ports.SerialPinChange.DsrChanged Then*
* Panel1.BackColor = Color.YellowGreen*
* End If*
* Catch ex As Exception*
* Msgbox(ex.message)*
* End Try*
* End Sub*

The Pinchanged handle for mono need to be different in linux?


Thanks!

Loading...