PDA

View Full Version : PACA 2-way communication with Daikin VRV over serial


nickrusanov
10 Jun 09, 05:52 PM
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 (http://www.wago.com/cps/rde/xchg/SID-53EFFEF9-789F1398/wago/style.xsl/gle-337.htm)

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

nickrusanov
11 Jun 09, 01:59 AM
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.

nickrusanov
12 Jun 09, 02:36 AM
updated with working code

DmitryShu
13 Jul 09, 11:33 PM
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.

Darren
15 Jul 09, 12:20 PM
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.
I don't understand what you mean. Please post your question in Russian, and we will try to translate it.

DmitryShu
15 Jul 09, 05:33 PM
Спасибо за понимание =)

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

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

2. Для того чтобы PAC прочитал свой com port1, а затем включил исполнительное устройство я применяю код:
если длинна прочтенной строки равна 5 символам тогда перейти к след блоку

ReadSerial(1, answer_string, #13#10);
if (length(answer_string) = 5) then
receive_flag := FALSE;
end;

Здесь происходит чтение пришедшей команды и деление ее на две части - группу(2 символа) и уровень(3 символа),а затем отработка исполнительного устройства по считанным параметрам.

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)?

Спасибо за понимание и поддержку!

nickrusanov
16 Jul 09, 12:33 AM
Далее используя прогрмму COM Port Toolkit 3.9, я посылаю в виде строки комманду 05255#13#10, чтобы зажечь 5й адрес диммера на 100%, но результата нет!


Как у Вас настроен диммер? Точно группа 005 установлена на соответствующий канал диммера?



И еще вопрос - если команда на включение составляется из 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)?

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

DmitryShu
16 Jul 09, 01:16 AM
Привет, Николай!
То что именно на 5м адресе сидит лампочка для зажигания - точнее не бывает =)

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

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

nickrusanov
16 Jul 09, 03:12 AM
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

Darren
16 Jul 09, 10:24 AM
Thanks nickrusanov for helping out there.


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

1. To send a command to COM1, PAC uses WriteSerial(1, send_string); (all is easy here - I press a button on DLT and in the application that is receiving the events I see the record for the command 05255, and 050 for the off command)
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.

2. Для того чтобы PAC прочитал свой com port1, а затем включил исполнительное устройство я применяю код:
если длинна прочтенной строки равна 5 символам тогда перейти к след блоку

ReadSerial(1, answer_string, #13#10);
if (length(answer_string) = 5) then
receive_flag := FALSE;
end;

Здесь происходит чтение пришедшей команды и деление ее на две части - группу(2 символа) и уровень(3 символа),а затем отработка исполнительного устройства по считанным параметрам.

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%, но результата нет!

We translated this as:
2. I use this code for PAC module to read data from COM port and then send the Set Level commands. If the length of the read string is 5 characters then go to the next block.

ReadSerial(1, answer_string, #13#10);
if (length(answer_string) = 5) then
receive_flag := FALSE;
end;
Here the previous command is being read and split in 2 parts: Group (2 characters) and Level (3 characters), then the execution module works through the received parameters.

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;

Now using the application COM Port Toolkit 3.9 (PICED 3.9??) I send the single string command 05255#13#10 so that 5th channel of the dimmer would go fully on, but nothing happens!

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"

И еще вопрос - если команда на включение составляется из 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)?


We translated this as:

Another question. If the ON command consists of 5 characters:

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

then why do we need the program "CBUS 2 RS232" which generates this string \\053800790545g\r which does the same thing as the mentioned above command (05255#13#10)?
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.

DmitryShu
20 Jul 09, 06:50 PM
Сейчас я постараюсь подробно описать свои действия, прилагая экраны программ, и буду рад вашей помощи.

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

2. В окне Log... вижу следующие RS232 команды, представленные на рисунке
1055Cbus232.JPG,
здесь нажимаю на кнопку DLT панели (загорается лампа по адресу 5 на 100%) и удостоверяюсь, что команды пишутся именно в COM 2 моего компьютера
1056(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 все еще записывает команды по нажатию кнопки
1057(Tool232.jpg).

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

Вопросы:
1. в каком пункте моя ошибка?
2. Как в Log... можно видеть одновременно и чтение, и запись в com порт?

Darren
22 Jul 09, 02:58 PM
We have translated the above as follows:

My actions.

I will now try to describe in details my actions accompanying them with the screenshots. I will appreciate your help.

1. I open the project rwcom.ctd in PICED, upload it to the PAC and run logic.

2. The Log window displays the following RS232 commands. See the screenshot.

* Cbus232.JPG

here I press a button on DLT (the load associated with address 5 goes fully on) and make sure that the commands appear on the COM2 port of my computer

* MyComDevice.jpg

- This way I tested the ability of PAC to write to its COM1, which is directly connected to COM2 of the computer.

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.

3. To be able to send a message to CBUS, i.e. to verify the ability of PAC 5500 controller to read data sent using ASCII command in the program COM Port Toolkit 3.9, I have to close PICED as it keeps the COM2 locked and doesn't allow this program to connect.

4. Having closed PICED I run COM Port Toolkit 3.9, press the button on DLT as on step 2 above and observe in the right window of the program that PAC is still recording the key press commands.

* Tool232.jpg
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.

5. After this I try to send ASCII command 05255#13#10 that is seen in the left panel of the program but nothing happens (Tool232.jpg)! The load associated with address 5 does not go fully on in response to this command!

Questions:
1. Where did I make a mistake?
2. How can I see in the Log simultaneously data read from and written to the COM port?
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.

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

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. - Можно подробнее?

Спасибо за ответы! Неужели я единственный, кто столкнулся с проблемой оправки 232 сообщений в pac?

nickrusanov
04 Aug 09, 06:54 AM
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)