Runtime Error PAC

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

  1. richy

    richy

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

    I'm trying to debug some logic in my PAC, I need to do it during runtime.

    Question 1.
    If I use the WriteLn function in the PAC logic, will the output show in my PICED windows. Is it possible to do this, if so how?

    Question 2.
    Why do I get this Runtime error when trying to run the Logic engine for my PAC.
    "Logic Run-Time error R100 at Line 236:00 - other error (unable to open com port (win error code:5))"

    The line in question:
    OpenSerial(1, 1, 9600, 8, 1, 0, 0);

    Is this due the fact the Piced software is running on my PC, and the code is trying to open a physical com port on that PC, rather thatn the PAC. ??

    Is there a way to run logic on a PAC, that open its serial ports, that I can debug ??
     
    richy, Feb 2, 2006
    #1
  2. richy

    Matty

    Joined:
    Oct 15, 2004
    Messages:
    131
    Likes Received:
    0
    Runtime

    Hi,

    1. The WriteLn function will display in the 'messages' box at the bottom of the logic engine window. WriteLn functions will do nothing when run in the PAC however you could use the following:

    if not IsPac then
    WriteLn('text here');

    2. When running the logic on the PC it will do exactly what its told to do, which in this case is open the com port. The error will be raised if the com port on your PC is non existant or in use by another program.

    To overcome this make com port 1 available for the logic engine when testing in PICED or try the following:

    [Global Variables]
    ComNumber:Integer;

    [Initialisation]
    if IsPac then
    ComNumber:=1
    else
    ComNumber:=2; {this will be the number of the available port on the PC}

    OpenSerial(1, ComNumber, 9600, 8, 1, 0, 0);

    As for your last idea, the only way I can think of is to open the other serial port and replace your WriteLn messages with WriteSerial commands. Then connect the com port of the PAC to a com port of your PC and read what is coming in via a hyperterminal session.

    Regards,
    Matty.
     
    Matty, Feb 3, 2006
    #2
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.