Logic control projector using 5500PACA with RS232

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Nikita.Bagritsevich, Apr 15, 2013.

  1. Nikita.Bagritsevich

    Nikita.Bagritsevich

    Joined:
    May 8, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Minsk
    Hello,
    I had a problem with the code efficiency to control the projector (Panasonic PT-AE8000) using 5500PACA with RS232. Projector must be turned on and off.

    Message format for the projector:
    [​IMG]

    Control commands:
    [​IMG]

    My Code:
    Code:
    {Enter Variable definitions here}
    str : string;
    
    {Enter Initialisation code here}
    OpenSerial(1, 1, 9600, 8, 1, 0, 0);
    
    {Modules}
    once (GetLightingState("Film") = ON) then
    begin
    Format(str, #02'PON'#03, #13#10);
    WriteSerial(1, str);
    end;
    once (GetLightingState("Film") = OFF) then
    begin
    Format(str, #02'POF'#03, #13#10);
    WriteSerial(1, str);
    end;
    but the code does not work.
    Please do tell me, what am I doing wrong?
     
    Last edited by a moderator: Apr 15, 2013
    Nikita.Bagritsevich, Apr 15, 2013
    #1
  2. Nikita.Bagritsevich

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,548
    Likes Received:
    178
    Location:
    Adelaide, Australia
    To see if the logic is being triggered, run it in PICED, open the log file (View/Log) and select 'Show Log Serial Messages' under the options tag. You should see the strings being printed.

    I noticed you are appending a CRLF to each line which isn't in the command definition and might be upsetting the projector. You could also add a small delay after the command and read back the response to see if the projector is actually receiving anything.

    Are you sure the cable is correctly wired? Have you tested it with an RS232 breakout box?

    Do you have the 24VAC power supply connected to the PAC to power the RS232 lines?

    Have you tried sending commands to the projector via a terminal emulator on a PC etc?

    Also, just for information, you don't really need the format step. Just go

    WriteSerial(1, #02'PON'#03); etc
     
    Ashley, Apr 15, 2013
    #2
  3. Nikita.Bagritsevich

    Nikita.Bagritsevich

    Joined:
    May 8, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Minsk
    yeah sure
    can I use 24 VDC power supply instead of 24VAC to power serial lines?
    unfortunately could not test, had no cable
    but I'll check it.
    Ok, used the format as a precaution
    Does it make sense to check the operation of this message? Using data in HEX.
    Code:
    WriteSerial(1, #02#50#79#78#03); //on
    WriteSerial(1, #02#50#79#70#03); //off
     
    Last edited by a moderator: Apr 15, 2013
    Nikita.Bagritsevich, Apr 15, 2013
    #3
  4. Nikita.Bagritsevich

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,548
    Likes Received:
    178
    Location:
    Adelaide, Australia
    No, you can't use a 24VDC supply. The AC supply is need to generate the positive and negative rails for the RS232 signals.

    Not really. It just makes it hard to read! Your existing code is correct.

    The other simple test to make sure the PAC is working is just loop back the output. I always keep a turn-around plug handy that just connects the Tx to the Rx lines on the PAC. After your Write statement add a small delay then issue a ReadSerial and check the result. At least then you know the PAC end is working. You can also do this at the other end of the lead that plugs into the projector.
     
    Ashley, Apr 16, 2013
    #4
  5. Nikita.Bagritsevich

    Nikita.Bagritsevich

    Joined:
    May 8, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Minsk
    Ashley,

    thanks! for your answer =)
     
    Nikita.Bagritsevich, Apr 16, 2013
    #5
  6. Nikita.Bagritsevich

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    I don't know the specifics of the PAC syntax, but it looks to me like you are missing the colon character.

    Also as stated, the crlf is not specified, so I don't think that is needed either.

    Regards

    Rohan
     
    rhamer, Apr 16, 2013
    #6
  7. Nikita.Bagritsevich

    Nikita.Bagritsevich

    Joined:
    May 8, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Minsk
    when a command witch does not require parameters to be send, a colon ( : ) is not required
     
    Nikita.Bagritsevich, Apr 17, 2013
    #7
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.