PICED Serial debug

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by richy, Sep 27, 2006.

  1. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Hi,

    Just wondering how people are using PICED to debug logic code that actually depends on serial data being sent to it.

    i.e.
    ReadSerial(2, s, #13#10);
    LowerCase(s);
    if pos('on', s) = 1 then
    begin
    copy(ss, s, 4, 100);
    WriteLn('ON : ', ss);
    GA := StringToInt(ss);
    SetLightingState(GA, ON);
    WriteSerial(2, 'OK'#13#10);
    end
    else if pos('off', s) = 1 then
    begin
    copy(ss, s, 4, 100);
    WriteLn('OFF : ', ss);
    GA := StringToInt(ss);
    SetLightingState(GA, OFF);
    WriteSerial(2, 'OK'#13#10);
    end
    else if i <> 0 then
    SetLightingState(32, ON);

    Looking at the above code, which is a sample from the Examples Folder.

    I need to write to the serial port, to have a particular GA turn on or OFF,
    e.g. ON 32

    But how do I simulate this with PICED???

    Can someone please spell it out for me, it may be simple, and I'm just missing it ...

    Cheers
     
    richy, Sep 27, 2006
    #1
  2. richy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Run hyperterminal or some other serial communications software on your computer. Connect one serial port to another using a cross-over cable (aka null modem cable). Send the commands from hyperterminal out one serial port and back into the other serial port to be read by PICED.
     
    Darren, Sep 28, 2006
    #2
  3. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Thanks,

    Was doing that already, but had a issue with the COM ports I was using.

    Sorted that, and it works, exactly as you have described ... cheers

    FYI - dont use Hyper Terminal
    There is a great app called BillSerialMonitor

    Check it out!
     
    richy, Sep 28, 2006
    #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.