Sending HEX to RS232

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Dan, Jan 16, 2020.

  1. Dan

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Also just double check your serial cable between the PAC and your read device, check the pinouts in the PAC manual, also remember you need to have RX going to TX on the connection between devices..
     
    jboer, Jan 20, 2020
    #21
  2. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    26
    Likes Received:
    6
    Thanks for your input. I have tried rebooting the unit also. I think i'm getting closer to whats going on, its not sending out HEX at all, its sending out ASCII!! See bellow.

    Is the WriteSerial command even correct in this instance? Should I be using the IntToHexString for example?

    OK and as for the cable how do I verify that? Are you talkin about some kind of cross over cable? The one I'm using is pictured on the first page.

    upload_2020-1-20_15-44-46.png
     
    Dan, Jan 20, 2020
    #22
  3. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    26
    Likes Received:
    6
    Well bugger. I finally figured out how to send the command correctly and it appears the unit has now died. It no-longer responds to requests :(. It powers up but does nothing, not even with the original control software which always worked fine.

    I worked out that there needed to be a '' before the command;

    WriteSerial(1, ''#$55#$56#$00#$00#$00#$03#$02#$B0);

    If it decides to start working again I'll update the thread however I don't hold much hope.

    Thanks for everyone that tried to help along the way. Disappointing outcome.

    Edit:

    I can also confirm that the PAC does actually send out the command from the serial port with the correct command above. I was able to caputre it with the monitoring software. So annoying to put in all this time to get it working and have it die.
     
    Last edited: Jan 20, 2020
    Dan, Jan 20, 2020
    #23
  4. Dan

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,554
    Likes Received:
    180
    Location:
    Adelaide, Australia
    So I had a chance to try this today with a spare PAC and it works fine using

    WriteSerial(1, #$55#$56#$00#$00#$00#$03#$02#$B0);

    Not sure why the extra quotes do anything. That's just putting an empty string at the start.
     
    Ashley, Jan 23, 2020
    #24
  5. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    26
    Likes Received:
    6
    Not sure why it worked the other way for me. What firmware is on your PAC?

    I've ordered another RS232 relay; they aren’t that expensive. It was for a personal project anyway so I will update this thread with the success or failure of the new one. I just can't let it beat me!! ;)
     
    Dan, Jan 24, 2020
    #25
    Mr Mark likes this.
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.