Bucher100

How to communicate between Logo 0BA7 and Node Red

Apr 1st, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. https://community.home-assistant.io/t/anyone-experience-with-siemens-logo-0ba7/446790
  2.  
  3. HOW TO COMMUNICATE BETWEEN SIEMENS LOGO 0BA7 AND NODE RED
  4.  
  5. **STEP 1:** Follow this guide: https://flows.nodered.org/flow/272a6d2104474c68f7b0e01bae025ead
  6.  
  7. But where it says
  8.  
  9. * PLC properties (little pencil)
  10. * Change for your IP adress (where red node is intalled)
  11.  
  12. There is a mistake, this should be the IP address of your Logo. See my examples of configuration that works for me. 192.168.0.2 is the IP of my Logo in this example. Node Red S7 node config:
  13.  
  14. https://imgur.com/joFAInF
  15.  
  16. "Name" change to whatever you like, it's just left at the default "S7-LOGO8" here.
  17.  
  18. LOGO!Soft Comfort v8.3 config:
  19.  
  20. https://imgur.com/qKpviP0
  21.  
  22. Fill in your default gateway IP here if you for some reason want to access the Logo directly from outside of your local network, otherwise i'ts fine to leave it blank, or at least it was in my case.
  23.  
  24. **STEP 2:** If you followed every step in the Logo 8 guide you will have a list of Logo 8 variables configured in your s7 node. However, these are for Logo 8 and need to be altered for the Logo 7. I won't go into detail on Logo 7 adressing, parameter VM mapping and such but I'll help you along.
  25.  
  26. As a reference for figuring out the 0BA7 adresses I used this document:
  27.  
  28. https://docplayer.net/126912375-Application-note-connecting-a-logo-0ba7-0ba8-s7a-driver-v7-51-build-104.html
  29.  
  30. Here's my list of variables to get you started, this is far from a complete list and it may contain errors since I'm only using some of these myself, but it should get you started. If you save this as a .csv you may be able to import it directly as a file to your variable config.
  31.  
  32. ```
  33. DB1,X942.0;Q01
  34. DB1,X942.1;Q02
  35. DB1,X942.2;Q03
  36. DB1,X942.3;Q04
  37. DB1,X942.4;Q05
  38. DB1,X942.5;Q06
  39. DB1,X942.6;Q07
  40. DB1,X942.7;Q08
  41. DB1,X923.0;I01
  42. DB1,X923.1;I02
  43. DB1,X923.2;I03
  44. DB1,X923.3;I04
  45. DB1,X923.4;I05
  46. DB1,X923.5;I06
  47. DB1,X923.6;I07
  48. DB1,X923.7;I08
  49. DB1,X924.0;I09
  50. DB1,X924.1;I10
  51. DB1,X924.2;I11
  52. DB1,X924.3;I12
  53. DB1,INT926;AI01
  54. DB1,INT928;AI02
  55. DB1,INT944;AQ01
  56. DB1,INT946;AQ02
  57. DB1,X948.0;M01
  58. DB1,X948.1;M02
  59. DB1,X948.2;M03
  60. DB1,X948.3;M04
  61. DB1,X948.4;M05
  62. DB1,X948.5;M06
  63. DB1,X948.6;M07
  64. DB1,X948.7;M08
  65. DB1,X949.0;M09
  66. DB1,X949.1;M10
  67. DB1,X949.2;M11
  68. DB1,X949.3;M12
  69. DB1,X949.4;M13
  70. DB1,X949.5;M14
  71. DB1,X949.6;M15
  72. DB1,X949.7;M16
  73. DB1,X950.0;M17
  74. DB1,X950.1;M18
  75. DB1,X950.2;M19
  76. DB1,X950.3;M20
  77. DB1,X950.4;M21
  78. DB1,X950.5;M22
  79. DB1,X950.6;M23
  80. DB1,X950.7;M24
  81. DB1,X951.0;M25
  82. DB1,X951.1;M26
  83. DB1,X951.2;M27
  84. DB1,INT952;AM1
  85. DB1,INT954;AM2
  86. DB1,INT956;AM3
  87. DB1,INT958;AM4
  88. DB1,INT960;AM5
  89. DB1,INT962;AM6
  90. DB1,INT964;AM7
  91. DB1,INT966;AM8
  92. DB1,INT968;AM9
  93. DB1,INT970;AM10
  94. DB1,INT972;AM11
  95. DB1,INT974;AM12
  96. DB1,INT976;AM13
  97. DB1,INT978;AM14
  98. DB1,INT980;AM15
  99. DB1,INT982;AM16
  100. DB1,B0;VB0
  101. DB1,B1;VB1
  102. DB1,B2;VB2
  103. DB1,B3;VB3
  104. DB1,B4;VB4
  105. DB1,B5;VB5
  106. DB1,B6;VB6
  107. DB1,B7;VB7
  108. ```
  109. With boolean values you can use symbolic adressing such as Q0.0, Q0.1 etc but in my example I use the full addresses. With block parameter from the Bxxx blocks such as analog amplifier, PI controller and so forth you have to use parameter VM mapping in LSC. E.g. if you address a "Word" (2 bytes) in LSC to address 0 you use "DB1,B0;VB0" and "DB1,B0;VB0" to catch it in NR. Some tinkering to format these values, e.g. timestamp from a timer is sent in Hex format, was a struggle for me to figure out and format but piece of cake if you are decent with NR (or HA if you prefer to format there). Here's an example of my VM mapping, these translate to VB0..5 in the s7 node (2 bytes per parameter for the "Word" type).
  110.  
  111. https://imgur.com/HlZqEit
  112.  
  113. Hope this will be useful for a few people out there, good luck!
  114.  
  115.  
Add Comment
Please, Sign In to add comment