RS232 comminication

Discussion in 'C-Bus Serial Protocols' started by HSLee, May 28, 2013.

  1. HSLee

    HSLee

    Joined:
    Dec 16, 2008
    Messages:
    30
    Likes Received:
    0
    Hi Guys ,

    i'm try to use PAC rs232 port to control some 3rd party devices, but currently some problem facing.

    trying to control via hyper terminal it work find with the command,
    but when i try with PAC rs232 is was unable to control with the same command.
    I try to supply 24VAC to PAC.

    Print Screen shown below 1st picture

    PAC to computer com port


    The command of PAC shown as below
    once GetLightingState(1) = ON then
    begin
    SetLightingState(3, ON);
    OpenSerial(1, 1, 9600, 8, scOneStopBit, scNoFlowControl, scNoParity);
    WriteSerial(1, #91#77#32#51#48#32#57#57#93);
    CloseSerial(1);
    end;



    I try send out above command via hyper terminal.
    The controller have response
    2nd picture
     

    Attached Files:

    • 3.JPG
      3.JPG
      File size:
      141.6 KB
      Views:
      832
    • 4.JPG
      4.JPG
      File size:
      70.5 KB
      Views:
      859
    Last edited by a moderator: May 28, 2013
    HSLee, May 28, 2013
    #1
  2. HSLee

    DonB

    Joined:
    Apr 6, 2011
    Messages:
    22
    Likes Received:
    0
    Location:
    Adelaide
    Initialisation String?

    If your not already doing so include in your logic an Initialisation String.

    OpenSerial (1,1,9600,8,1,0,0); or similar

    Further info can be found in Logic.pdf in Manual folder installed with PICED.

    Please note that you have placed this thread on a area related to C-Bus Serial Protocol use. Which is used to communicate directly to C-Bus via a PC interface.
    The RS232 provided on a PACA or Touchscreen as an interpretation to suit devices predefined codes of other devices.
     
    DonB, Jun 4, 2013
    #2
  3. HSLee

    HSLee

    Joined:
    Dec 16, 2008
    Messages:
    30
    Likes Received:
    0

    Thx DonB,

    try with the way initialisation with the code of
    Initialisation
    OpenSerial(1, 1, 9600, 8, scOneStopBit, scNoFlowControl, scNoParity);

    Module
    once GetLightingState(1) = ON then
    begin
    SetLightingState(3, ON);
    WriteSerial(1, '[M 30 99]');
    end;

    with the above coding,it was able to receive code and show at windows hyper terminal
    [M 30 99]
    but it was fail to trigger 3rd party controller

    PACA rs232 port 1 -> 3rd party controller

    If i send out the same code [M 30 99] via hyper terminal to third party devices it was able to trigger 3rd party controller

    Computer with COM port -> 3rd party controller


    is it because of PACA issue?
     
    HSLee, Jun 6, 2013
    #3
  4. HSLee

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    When you are using hyperterminal, you may be sending carriage return/line feed characters as well. You do not have these in your logic code. It is possible that this is the problem.
     
    Darren, Jun 8, 2013
    #4
  5. HSLee

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Try adding a carriage return (CR) to the end of the string. Most 3rd party devices require either a carriage return or line feed to signify the end of the command. When you enter commands into hyper terminal you naturally end then with a Return key.

    e.g. WriteSerial(1, '[M 30 99]'#13);

    (Looks like Darren can type faster than I can :) )
     
    Last edited by a moderator: Jun 10, 2013
    Ashley, Jun 8, 2013
    #5
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.