WriteSerial String Format - PICED & RS232

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Pink Panther, Jul 1, 2007.

  1. Pink Panther

    Pink Panther

    Joined:
    Jul 1, 2007
    Messages:
    26
    Likes Received:
    0
    Location:
    Auckland, New Zealand
    Objective: To control a Marantz AV Receiver from a Colour C-Touch via RS232.

    Problem: Tried several ways - direct as per below (i.e., @PWR:20D), converted to hex, converted to ASCII code number, but must be going wrong somewhere as can't seem to be able to enter the complete string in the correct format without generating a compile error.

    For example, the Marantz code format for Power On is as follows:

    Start Character: @
    Command: PWR:2
    End Character: 0Dh (Hexadecimal value for CR - Carriage Return)

    Question: Can someone give me some clues as to the correct way to code in a string for serial control?

    :confused:

    PS After having spent a couple of years using the forum as an excellent training tool, this is the first time that I have posted a request for help, so hope I've posed the question in an appropriate manner.
     
    Pink Panther, Jul 1, 2007
    #1
  2. Pink Panther

    Matty

    Joined:
    Oct 15, 2004
    Messages:
    131
    Likes Received:
    0
    Hi Pink,

    To send a CR following your command you could do it by sending it with the command or sending it afterwards. The easy way is to send it afterwards like this:

    WriteSerial(1, #13);

    To send it with the command just add it to the end of the string:

    WriteSerial(1, '@PWR:2'#13);

    For your post I give you 5 stars :)

    Regards,

    Matty
     
    Matty, Jul 2, 2007
    #2
  3. Pink Panther

    Pink Panther

    Joined:
    Jul 1, 2007
    Messages:
    26
    Likes Received:
    0
    Location:
    Auckland, New Zealand
    Thanks

    Thanks Matty

    Cut 'n' pasted your example command and it compiled ok ... you've saved me a heap of time.

    Cheers

    Pink Panther

    :)
     
    Pink Panther, Jul 3, 2007
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.