SerialPort class and sending data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ASPnewb1
    New Member
    • Mar 2008
    • 14

    SerialPort class and sending data

    I'm running into a problem of how to send a string across to another machine via serial port using the serial port class.

    The string that needs to be sent is like this,

    &&<CR><LF>01110 .0<CR><LF>!!<CR ><LF>

    I've tried sending:

    SerialPort1.Wri te("&&\r\n01110 .0\r\n!!\r\n");

    It seems it's not treating the \r\n as <CR><LR>

    I have a serial port monitor/scripting program and I can send the above line with their tools (inserting the <CR><LF>) as their respective bytes but I just need my program to be able send this information.

    All of my settings are correct for the device on the receiving end,

    9600
    8
    1
    none

    I know it is working when the device answers back to my program which is has not yet (only answers back when the string or those like it above are sent through my serial port scripting application).
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Hmmm.
    Have you tried sending your message as a byte[] ?

    Comment

    Working...