Thread: Send a hex string to a serial port

  1. #1
    Registered User
    Join Date
    Oct 2022
    Posts
    4

    Send a hex string to a serial port

    Hello!

    I have to send that string:

    F5 01 00 02 00 C0 01 37 01 01

    to COM1 port (9600, ID: 1, Data bits: 8, data number: 1, timeouc 1.5 sec., no flux control, no parity).

    But my question is: there is a C serial library can help me to write that program?

  2. #2
    Registered User
    Join Date
    Sep 2022
    Posts
    55
    What operating system are you talking about?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Which OS and compiler are you using?

    I'd guess Windows, since you mentioned COM1

    CreateFileA function (fileapi.h) - Win32 apps | Microsoft Learn
    Scroll a long way down to "Communications Resources"

    See also
    Communications Resources - Win32 apps | Microsoft Learn

    and
    windows - How to use Win32 API to talk to a com port (RS232) - Stack Overflow
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. send/receive with serial port in pc104
    By omidan321 in forum C# Programming
    Replies: 0
    Last Post: 09-09-2013, 10:18 PM
  2. Send image (.jpg) file over serial port
    By aSpareName in forum Networking/Device Communication
    Replies: 2
    Last Post: 06-30-2009, 09:35 AM
  3. Send ASCII characters via serial port
    By xkrja in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2006, 09:43 AM
  4. Send and Recive Information through the serial Port RS232
    By amigoloko in forum C# Programming
    Replies: 4
    Last Post: 04-14-2006, 12:34 PM
  5. Send and receive through serial Port
    By overspray in forum C++ Programming
    Replies: 1
    Last Post: 07-21-2004, 04:15 PM

Tags for this Thread