PACA 2-way communication with Daikin VRV over serial

Discussion in 'Pascal Logic Code Examples' started by nickrusanov, Jun 10, 2009.

  1. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    (updated) 2-way RS232 universal communication with LON and Modbus using WAGO and PACA

    Update!
    The problem we had is now solved! :)

    We made this program to get communication between C-Bus and another automation system (we use WAGO, but it could be Beckhoff or devices like Daikin Coolmaster). These automation systems can work with LON, ModBus, BACnet and other automation protocols which are not supported by C-Bus, so we use it as universal gateway. (When Wiser came out, I thought it would work as universal gateway, but as I see, this application is not supposed).

    WAGO I/O system website

    Communication is done by RS232 and C-Bus PACA controller. WAGO consists of main controller with LON, like 750-819, RS232 controller to communicate to PACA and other needed devices (like ModBus interfaces etc.).

    Program was done for a real country house, which is a lot like many other houses around Moscow. This particular application controls and monitors 8xDaikin Air VRVIII conditioners with LON interface, Power Generator through ModBus, Systemair ventilation through ModBus and UPS with through ModBus.

    Here we have the description of how it works and which variables should be programmed in WAGO. You will need a person which will have a good knowledge of the automation system, which you choose (like WAGO) and it?s software (a CodeSys variant, most likely). It will get the main work on it's shoulders, using snandard LON and ModBus drivers.

    Please see attachments. .ctd file contains logic, .doc file contains variables, which should be programmed in WAGO, .pdf file has an image of how it connects to each other, .cbz file is the backup of our toolkit project
     

    Attached Files:

    Last edited by a moderator: Jun 11, 2009
    nickrusanov, Jun 10, 2009
    #1
  2. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    Attached is protocol descriprion for the device, which makes Daikin VRV control through RS232 (without additional LON interface or any WAGO-like equipment). we used it in some projects.

    .ctd file attached in upper post can be used with small modifications.
     

    Attached Files:

    Last edited by a moderator: Jun 11, 2009
    nickrusanov, Jun 10, 2009
    #2
  3. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    updated with working code
     
    nickrusanov, Jun 11, 2009
    #3
  4. nickrusanov

    DmitryShu

    Joined:
    Jul 13, 2009
    Messages:
    15
    Likes Received:
    0
    Location:
    Russia
    rs232 to PAC

    Greetings, guys!
    Explain, if you will not complicate how to send commands in Cbus on RS232 for inclusion for example dimmer. With record in PAC port I have understood, and here read out commands from Pac port could not.
    Also explain for what program CBUS 2 RS232 if I can create a line from these variables serves:

    string is 5 digits long

    format: XXYYY
    XX – group number
    YYY – group level 000 to 255
    (for on-off - 000=OFF, 001-255=ON)

    P.S. I use program COM Port Toolkit 3.9 for reading and record in com port on my PC.
     
    Last edited by a moderator: Jul 13, 2009
    DmitryShu, Jul 13, 2009
    #4
  5. nickrusanov

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I don't understand what you mean. Please post your question in Russian, and we will try to translate it.
     
    Darren, Jul 15, 2009
    #5
  6. nickrusanov

    DmitryShu

    Joined:
    Jul 13, 2009
    Messages:
    15
    Likes Received:
    0
    Location:
    Russia
    Спасибо за понимание =)

    Поправьте меня, если я не прав!

    1. Для того чтобы записать команду в com port1 PAC используется след команда - WriteSerial(1, send_string); (здесь все просто - я нажимаю на кнопку DLT и в программме прослушки com порта1 вижу запись команды 05255, а после выключения 050..)

    2. Для того чтобы PAC прочитал свой com port1, а затем включил исполнительное устройство я применяю код:
    если длинна прочтенной строки равна 5 символам тогда перейти к след блоку
    Code:
     ReadSerial(1, answer_string, #13#10);
          if (length(answer_string) = 5) then
          receive_flag := FALSE;
        end;
    
    Здесь происходит чтение пришедшей команды и деление ее на две части - группу(2 символа) и уровень(3 символа),а затем отработка исполнительного устройства по считанным параметрам.
    Code:
    IF (receive_flag = FALSE) then
      begin
        copy(GroupCH, answer_string, 1, 2);
        Group:=StringToInt(GroupCH);
        copy(LevelCH, answer_string, 3, 5);
        Level:=StringToInt(LevelCH);
        SetCBusLevel(254, 56, Group, Level, "0s");
        send_string:='ok';
        send_flag:=True;
        answer_string:='';
        receive_flag:=true;
      end
    else receive_flag:=true;
    Далее используя прогрмму COM Port Toolkit 3.9, я посылаю в виде строки комманду 05255#13#10, чтобы зажечь 5й адрес диммера на 100%, но результата нет!

    И еще вопрос - если команда на включение составляется из 5 символов:

    string is 5 digits long
    format: XXYYY
    XX – group number
    YYY – group level 000 to 255
    (for on-off - 000=OFF, 001-255=ON)

    Тогда для чего пужна программа "CBUS 2 RS232" создающая такую
    \\053800790545g\r строку для того же действия что и выше описанная (05255#13#10)?

    Спасибо за понимание и поддержку!
     
    DmitryShu, Jul 15, 2009
    #6
  7. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    Как у Вас настроен диммер? Точно группа 005 установлена на соответствующий канал диммера?

    "CBUS 2 RS232" предназначена для генерации строк управления C-Bus через PC интерфейс (5500PC). Чтобы со стороны управлять системой, лучше использовать ее. А для 2-сторонней коммуникации при помощи PACA контроллера понятнее и проще использовать нашу программку. =))
     
    nickrusanov, Jul 15, 2009
    #7
  8. nickrusanov

    DmitryShu

    Joined:
    Jul 13, 2009
    Messages:
    15
    Likes Received:
    0
    Location:
    Russia
    Привет, Николай!
    То что именно на 5м адресе сидит лампочка для зажигания - точнее не бывает =)

    именно ее я и использовал, если речь идет о full rs232 to PACA.ctd выложенная тобой выше.

    Где моя ошибка кроется?
     

    Attached Files:

    Last edited by a moderator: Jul 15, 2009
    DmitryShu, Jul 15, 2009
    #8
  9. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    u menya vash project vidaet oshibki:

    Error C013 at line 109:1 - "end" expected
    Error C053 at line 112:1 - "until" expected
    Error C168 at line 113:1 - Undefined label
    label 1003
    Error C006 at line 113:1 - Illegal symbol
    Error C399 at line 119:0 - Feature not implemented
    Error C399 at line 119:0 - Feature not implemented
    Error C021 at line 119:0 - "." expected
     
    nickrusanov, Jul 15, 2009
    #9
  10. nickrusanov

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Thanks nickrusanov for helping out there.

    We translated this as:

    OK. I am assuming that you have some device connected to the serial port of the PAC so that you can interface to C-Bus.

    We translated this as:
    It looks like this should work. There are a few things you can try:
    1. Use the C-Bus Diagnostic Utility to see whether a message is actually sent onto C-Bus. As nickrusanov said, it might be that you have the wrong group address on the dimmer, or there might be another problem.
    2. Another thing you can do is to use the PAC LED to show that you have received an RS232 command.
    3. Test the code in PICED before using it in the PAC. PICED has a lot more debugging options available.
    4. Check that you are actually sending the #13#10 at the end of the message. If you use PICED to run the logic, there is an option in the log to show logic RS232 messages.
    5. See the logic help file topic "Debugging Serial"

    We translated this as:
    The C-Bus protocol string \\053800790545g\r contains a lot more information than just the group address and level. Refer to the C-Bus protocol documentation for details.
     
    Darren, Jul 16, 2009
    #10
  11. nickrusanov

    DmitryShu

    Joined:
    Jul 13, 2009
    Messages:
    15
    Likes Received:
    0
    Location:
    Russia
    Мои действия...

    Сейчас я постараюсь подробно описать свои действия, прилагая экраны программ, и буду рад вашей помощи.

    1. Открываю проект View attachment rwcom.ctd rwcom.ctd в PICED, заливаю в PAC и запускаю logic.

    2. В окне Log... вижу следующие RS232 команды, представленные на рисунке
    Cbus232.JPG Cbus232.JPG,
    здесь нажимаю на кнопку DLT панели (загорается лампа по адресу 5 на 100%) и удостоверяюсь, что команды пишутся именно в COM 2 моего компьютера
    MyComDevice.JPG (MyComDevice.jpg)
    - Таким образом я проверил способность записи PAC в свой com1, котрый напрямую соединен с Com2 компьютера.

    3. Далее для того чтобы отправить сообщение в CBUS, то есть проверить способность чтения Pac 5500 контроллера при помощи отправки ASCII команд пограммой COM Port Toolkit 3.9, мне приходиться закрывать PICED, тк он занимает Com2 моего компьютера и не дает возможность подключения этой программы.

    4. Закрыв Piced, я запускаю COM Port Toolkit 3.9 нажимаю на кнопку DLT как в пункте 2 и вижу в правом окне программы, что PAC все еще записывает команды по нажатию кнопки
    Tool232.JPG (Tool232.jpg).

    5. Затем пытаюсь отправить ASCII команду 05255#13#10 в левой части программы это можно видеть, но ничего не происходит (Tool232.jpg)! Ламна на 5 адресе не загорается на 100 процентов при помощи посылки данной команды!

    Вопросы:
    1. в каком пункте моя ошибка?
    2. Как в Log... можно видеть одновременно и чтение, и запись в com порт?
     
    Last edited by a moderator: Jul 20, 2009
    DmitryShu, Jul 20, 2009
    #11
  12. nickrusanov

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    We have translated the above as follows:

    That part of it seems to be working correctly. When you toggle the button on the DLT, the PAC sends out messages from its serial (RS232) port.

    It looks like the PAC is not replying with an "OK", or setting the Group Address. The most likely cause is that the PAC is not receiving the message.

    Are you using a power supply for the PAC RS232?

    You can use a software package called Portmon from Sysinternals which allows you to monitor serial communications in both direction.
     
    Darren, Jul 22, 2009
    #12
  13. nickrusanov

    DmitryShu

    Joined:
    Jul 13, 2009
    Messages:
    15
    Likes Received:
    0
    Location:
    Russia
    !!!

    Естественно, я использую питание 24v ac для работы с rs232 контроллера pac! Подтверждением этому является то, что я могу принимать сообщения от pac по rs232 (но немогу отсылать обратно)

    - Можно подробнее?

    Спасибо за ответы! Неужели я единственный, кто столкнулся с проблемой оправки 232 сообщений в pac?
     
    DmitryShu, Jul 22, 2009
    #13
  14. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    to clarify it to everyone:

    problem was, that other systems would not understand #13#10 correctly.

    after we removed it at all from the code - everything worked fine (ex. not "05018#13#10" but "05018" ramped group 05 to level 18)
     
    nickrusanov, Aug 3, 2009
    #14
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.