Siemens LOGO in NodeRED: How to use one instance and split variables / messages?

Hi,
after getting the basic setup of my LOGO PLC with NodeRed running as expected, I would like trying to optimize my flow a little bit (if possible and if it make sense at all :slight_smile: )

Here's what the whole thing looks like at the moment:

Each variable is using one "LOGO" Connection (is this the right term?)
And connects to one sensor for Showing the values in my HomeAssistant.

Now, I would like to use only one connection to my LOGO, like this:

  1. how do I split the output from LOGO and route it to the specific sensor from HomeAssistant?
  2. What should I select as "mode" ?
    -> All variables, once per message
    -> All variables

Thanks a lot and with best regards,
Christoph

Attach a debug node (set to show complete message) and show us what comes out of that node.

Expand all properties and copy paste a screen snip of the debug message (paste snip image into your reply)

Also, copy the full debug message but using the copy value button that appears when you hover over the debug message in the sidebar.

Use the code button before pasting code.

Hi Steve-Mcl,
thanks for your reply.
Do you mean the debug output like this?

24.2.2021, 22:59:11node: e41dd3f5.a60f88Q11 : msg.payload : boolean
false
24.2.2021, 22:59:11node: e41dd3f5.a60f88Q12 : msg.payload : boolean
false
24.2.2021, 22:59:11node: e41dd3f5.a60f88Q13 : msg.payload : boolean
false
24.2.2021, 22:59:11node: e41dd3f5.a60f88Q14 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q15 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q16 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q17 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q18 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q19 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88Q20 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I01 AI03 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I02 AI04 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I03 High Freq : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I04 High Freq : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I05 High Freq : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I06 High Freq : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I07 AI01 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I08 AI02 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I09 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I10 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I11 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I12 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I13 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I14 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I15 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I16 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I17 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I18 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I19 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I20 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I21 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I22 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I23 : msg.payload : boolean
false
24.2.2021, 22:59:12node: e41dd3f5.a60f88I24 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI01 : msg.payload : number
462
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI02 : msg.payload : number
1
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI03 : msg.payload : number
1
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI04 : msg.payload : number
1
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI06 : msg.payload : number
288
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI07 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI08 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AI09 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ01 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ02 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ03 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ04 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ05 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ06 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ07 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ08 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88AQ09 : msg.payload : number
0
24.2.2021, 22:59:13node: e41dd3f5.a60f88M01 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M02 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M03 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M04 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M05 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M06 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M07 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M08 Start : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M09 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M10 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M11 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M12 : msg.payload : boolean
false
24.2.2021, 22:59:13node: e41dd3f5.a60f88M13 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M14 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M15 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M16 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M17 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M18 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M19 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M20 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M21 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M22 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M23 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M24 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M25 LOGO Screen White : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M26 TDE Screen White : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M27 CharSet : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M28 LOGO Screen Orange : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M29 LOGO Screen Red : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M30 TDE Screen Orange : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M31 TDE Screen Red : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M32 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88M33...64 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88AM1 : msg.payload : number
461
24.2.2021, 22:59:14node: e41dd3f5.a60f88AM2 : msg.payload : number
220
24.2.2021, 22:59:14node: e41dd3f5.a60f88AM3 : msg.payload : number
0
24.2.2021, 22:59:14node: e41dd3f5.a60f88AM4 : msg.payload : number
0
24.2.2021, 22:59:14node: e41dd3f5.a60f88AM5...64 : msg.payload : number
0
24.2.2021, 22:59:14node: e41dd3f5.a60f88NI1 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88NI1..64 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88NQ1 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88NQ1..64 : msg.payload : boolean
false
24.2.2021, 22:59:14node: e41dd3f5.a60f88NAI1 : msg.payload : number
0
24.2.2021, 22:59:14node: e41dd3f5.a60f88NAI1...64 : msg.payload : number
0
24.2.2021, 22:59:14node: e41dd3f5.a60f88NAQ1 : msg.payload : number
0
24.2.2021, 22:59:15node: e41dd3f5.a60f88NAQ2...64 : msg.payload : number
0
24.2.2021, 22:59:15node: e41dd3f5.a60f88Tageslicht Sonnenaufgang : msg.payload : number
1796
24.2.2021, 22:59:15node: e41dd3f5.a60f88
Tageslicht Sonnenuntergang : msg.payload : number
5943

Well i dont think you set the debug to show complete message...

image

Anyhow - it looks like that S7-LOGO9 node outputs lots of different messages, each with a unique a topic (they should mean something to you)

So your request was "how do I split the output from LOGO and route it" - well, you would use a switch node and enter each topic of interest like this...
image

then you can route those message with them topics
image


It does seem to me you are lacking some really base node-red knowledge so I would definately recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Hi Steve-Mcl,
thanks a lot!
Honestly, I've just started with NodeRed yesterday evening, so I am very happy about the goals I've already reached :smiley:

Thanks for the Playlist - I will use the weekend to watch all the stuff :slight_smile:

With your reply, I think I will be able to get what I want.
Thanks a lot!

I think i understand this bit now.

I beleive if you switch between All variables, once per message and All variables - i think one of them modes will output ALL values in one message (hopefully as a JS object). If so, then there is no need to route - you simply use the value in the next function. e.g. msg.payload.NAQ1 and msg.payload.NAQ2 etc.

Have a play - best way to learn.

hi Steven-Mci,

I've played around a bit and I think, I've made a mistake above :slight_smile:
This is the output of the debug with "all variables" and the whole message:

24.2.2021, 23:28:48node: b6a11be3.3f2a38
msg : Object
object
payload: object
Q01: false
Q02: false
Q03: false
Q04: false
Q05: false
Q06: false
Q07: false
Q08: false
Q09: false
Q10: false
Q11: false
Q12: false
Q13: false
Q14: false
Q15: false
Q16: false
Q17: false
Q18: false
Q19: false
Q20: false
I01 AI03: false
I02 AI04: false
I03 High Freq: false
I04 High Freq: false
I05 High Freq: false
I06 High Freq: false
I07 AI01: false
I08 AI02: false
I09: false
I10: false
I11: false
I12: false
I13: false
I14: false
I15: false
I16: false
I17: false
I18: false
I19: false
I20: false
I21: false
I22: false
I23: false
I24: false
AI01: 465
AI02: 1
AI03: 1
AI04: 1
AI06: 287
AI07: 0
AI08: 0
AI09: 0
AQ01: 0
AQ02: 0
AQ03: 0
AQ04: 0
AQ05: 0
AQ06: 0
AQ07: 0
AQ08: 0
AQ09: 0
M01: false
M02: false
M03: false
M04: false
M05: false
M06: false
M07: false
M08 Start: false
M09: false
M10: false
M11: false
M12: false
M13: false
M14: false
M15: false
M16: false
M17: false
M18: false
M19: false
M20: false
M21: false
M22: false
M23: false
M24: false
M25 LOGO Screen White: false
M26 TDE Screen White: false
M27 CharSet: false
M28 LOGO Screen Orange: false
M29 LOGO Screen Red: false
M30 TDE Screen Orange: false
M31 TDE Screen Red: false
M32: false
M33...64: false
AM1: 465
AM2: 218
AM3: 0
AM4: 0
AM5...64: 0
NI1: false
NI1..64: false
NQ1: false
NQ1..64: false
NAI1: 0
NAI1...64: 0
NAQ1: 0
NAQ2...64: 0
Tageslicht Sonnenaufgang: 1796
Tageslicht Sonnenuntergang: 5943
topic: ""
_msgid: "4ed4d87f.175268"

So I think, this is what you've requested and which should be a JS Object as per your last reply.
I will try to get the output as per your suggestion - maybe, I'll try both methods to compare them.

as i said before...

i.e...

image

Hi, It seems that it worked just as expected :slight_smile:

The code which I've pasted above is exactly what the debug node is putting out
I can't get everything into one screenshot - the payload just contains the name of the block from the Logo and the value.
There are no Sub-properties (at least not in my current setup)

Thanks a lot for your support :slight_smile: