locked
C# Write to serialPort question RRS feed

  • Question

  • Hi guys,

    I am developing a winForm application to write and read with a serialPort object from a MDB mechanisms (Bill validator and coin changer) and that's through a board (hardware that communicates with the MDB mechanisms) that does Poll by its own,, at some point I need to send a poll Command to verify an error recover let's say but that inturrupts or loses what the serialPort can read at this moment (by the DataReceived Event handler),,

    If any one knows how we can handle that (I mean send Poll command from my application not the one is being done by the port without interference with the incoming data to the serialPort) I ll appreciate.

    thanks.

    Mena

    • Moved by edhickey Friday, March 11, 2011 6:03 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    Friday, March 11, 2011 5:29 PM

Answers

  • I don't think you can ever guarantee no packet clashes between the two.

    Although, I guess if there is a second or two between the hardware polls then you may get away with it - you may need to monitor the reply from the hardware poll (if there is one) and send your command immediately after.

    May be hit and miss though

    K

    • Marked as answer by Cookie Luo Monday, March 21, 2011 1:43 AM
    Friday, March 11, 2011 10:54 PM

All replies

  • I don't think you can ever guarantee no packet clashes between the two.

    Although, I guess if there is a second or two between the hardware polls then you may get away with it - you may need to monitor the reply from the hardware poll (if there is one) and send your command immediately after.

    May be hit and miss though

    K

    • Marked as answer by Cookie Luo Monday, March 21, 2011 1:43 AM
    Friday, March 11, 2011 10:54 PM
  • Thanks man, I ll try that.

    Mena.

    Monday, March 14, 2011 1:54 PM

  • Hi Mena1,

    I am writing to check the status of the issue. Have you resolved it? Or have any other questions?

    I mark the reply as an answer. If you find it is not a solution when you come back, please unmark it.

    Thanks,


    Cookie Luo[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 21, 2011 1:43 AM