Click here to Skip to main content
15,890,845 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Using dynamic enum as type in a parameter of a method Pin
Not Active23-May-10 4:30
mentorNot Active23-May-10 4:30 
GeneralRe: Using dynamic enum as type in a parameter of a method Pin
PIEBALDconsult23-May-10 6:51
mvePIEBALDconsult23-May-10 6:51 
QuestionCheck the serial port event PinChanged Pin
feromontalvo20-May-10 3:09
feromontalvo20-May-10 3:09 
AnswerRe: Check the serial port event PinChanged Pin
Luc Pattyn20-May-10 5:05
sitebuilderLuc Pattyn20-May-10 5:05 
GeneralRe: Check the serial port event PinChanged Pin
feromontalvo21-May-10 0:38
feromontalvo21-May-10 0:38 
GeneralRe: Check the serial port event PinChanged Pin
Luc Pattyn21-May-10 2:10
sitebuilderLuc Pattyn21-May-10 2:10 
GeneralRe: Check the serial port event PinChanged Pin
feromontalvo21-May-10 8:32
feromontalvo21-May-10 8:32 
GeneralRe: Check the serial port event PinChanged Pin
Luc Pattyn21-May-10 8:48
sitebuilderLuc Pattyn21-May-10 8:48 
Hi,

I haven't studied all that, just a few comments and ideas:

1.
there is a property SerialPort.CanRaiseEvents; I don't recall having needed it ever, and it seems read-only. After opening the port, you should read it and make sure it returns true.

2.
if you enable some kind of hardware handshake the driver may change the way your control pins get used; so make sure SerialPort.HandShake is set to Handshake.None

3.
if button cmdRTS is meant to toggle the RTS output pin, then I would simplify it to:
Private Sub cmdRTS_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdRTS.Click
    comm1.RtsEnable = NOT comm1.RtsEnable

    If comm1.RtsEnable Then
        Call ctrl_log.EscribeLog("PP")
    Else
        Call ctrl_log.EscribeLog("AP")
    End If
End Sub


4.
if you were to connect RTS and CTS (without a switch), then each click on the cmdRTS button really should raise a PinChanged event.

5.
I have no idea how the serial port settings get initialized; sometimes it feels like a port remembers its most recent settings (at the Windows level). So I tend to set everything explicitly, taking a dozen lines of code, right after the SerialPort.Open()

6.
Are you using real serial ports? on your PC's motherboard? on a plug-in card?
or are you using an USB-to-serial cable?

the latter might behave a bit different, depending on the manufacturer. It also often needs a vendor specific driver. Maybe there is a bug; maybe it requires you to transmit a character (SerialPort.Write) before it updates the control pins; remember: it will try and collect commands and data in USB data packets, it probably doesn't send a packet for each character. I know it is a bit slower (but quite capable of normal 19200 Bd and probably higher too).

Hope any of this helps.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Check the serial port event PinChanged Pin
feromontalvo24-May-10 23:07
feromontalvo24-May-10 23:07 
Questioncollection of different sections in app.config file Pin
dashingsidds20-May-10 0:43
dashingsidds20-May-10 0:43 
AnswerRe: collection of different sections in app.config file Pin
Richard MacCutchan20-May-10 2:12
mveRichard MacCutchan20-May-10 2:12 
GeneralRe: collection of different sections in app.config file Pin
dashingsidds20-May-10 19:57
dashingsidds20-May-10 19:57 
QuestionDataSet.AddTable order dependence? Pin
Marc Clifton19-May-10 10:28
mvaMarc Clifton19-May-10 10:28 
AnswerRe: DataSet.AddTable order dependence? Pin
Not Active19-May-10 13:02
mentorNot Active19-May-10 13:02 
QuestionResize a monochrome bitmap without using any class Pin
Mehdi Ghiasi19-May-10 7:54
Mehdi Ghiasi19-May-10 7:54 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Luc Pattyn19-May-10 14:55
sitebuilderLuc Pattyn19-May-10 14:55 
QuestionRe: Resize a monochrome bitmap without using any class Pin
Mehdi Ghiasi20-May-10 2:06
Mehdi Ghiasi20-May-10 2:06 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Luc Pattyn20-May-10 2:19
sitebuilderLuc Pattyn20-May-10 2:19 
QuestionRe: Resize a monochrome bitmap without using any class Pin
Mehdi Ghiasi20-May-10 7:18
Mehdi Ghiasi20-May-10 7:18 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Thomas Krojer21-May-10 4:08
Thomas Krojer21-May-10 4:08 
JokeRe: Resize a monochrome bitmap without using any class Pin
T M Gray21-May-10 5:24
T M Gray21-May-10 5:24 
QuestionAccepting a rejected character in a Masked Textbox Pin
gmhanna18-May-10 1:58
gmhanna18-May-10 1:58 
AnswerRe: Accepting a rejected character in a Masked Textbox Pin
Peace ON18-May-10 2:42
Peace ON18-May-10 2:42 
QuestionAdvanced .NET cource Pin
marca29217-May-10 19:56
marca29217-May-10 19:56 
AnswerRe: Advanced .NET cource Pin
Richard MacCutchan17-May-10 21:26
mveRichard MacCutchan17-May-10 21:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.