S7-1200 read variable

Hello,
Have started for my first project with node red:
System: CentOS 7
Nodejs: 2:10.16.3
Node Red: v1.0.0
S7-1200 CPU1214C, Firmware 4.1

Have configured S7In from node-red-contrib-s7 and connected to debug in Flow.
Node Parameter: Cycle: 10000 ms, Timeout: 5000 ms
Get sometimes Timeout's:

"Keine Antwort, Neustart der Kommunikation" = "Timeout, restart Communication"

2.10.2019, 09:19:48node: e768e368.f8cd28](192.168.130.172:1880/#)msg : string[41]

"Keine Antwort, Neustart der Kommunikation"

2.10.2019, 09:19:53node: 9c3247.85f75db8](192.168.130.172:1880/#)msg.payload : Object

{ T1_Abgabe: 22.299999237060547 }

2.10.2019, 09:20:00node: e768e368.f8cd28](192.168.130.172:1880/#)msg : string[41]

"Keine Antwort, Neustart der Kommunikation"

2.10.2019, 09:20:03node: 9c3247.85f75db8](192.168.130.172:1880/#)msg.payload : Object

{ T1_Abgabe: 22.399999618530273 }

2.10.2019, 09:20:12node: e768e368.f8cd28](192.168.130.172:1880/#)msg : string[41]

"Keine Antwort, Neustart der Kommunikation"

2.10.2019, 09:20:14node: 9c3247.85f75db8](192.168.130.172:1880/#)msg.payload : Object

{ T1_Abgabe: 22.5 }

2.10.2019, 09:20:24node: 9c3247.85f75db8](192.168.130.172:1880/#)msg.payload : Object

{ T1_Abgabe: 22.5 }

2.10.2019, 09:20:24node: e768e368.f8cd28](192.168.130.172:1880/#)

ICMP Ping from Node Red host to S7:

64 bytes from 192.168.130.23: icmp_seq=1 ttl=30 time=0.822 ms
64 bytes from 192.168.130.23: icmp_seq=2 ttl=30 time=0.900 ms
64 bytes from 192.168.130.23: icmp_seq=3 ttl=30 time=0.943 ms
64 bytes from 192.168.130.23: icmp_seq=4 ttl=30 time=0.879 ms
64 bytes from 192.168.130.23: icmp_seq=5 ttl=30 time=0.701 ms
64 bytes from 192.168.130.23: icmp_seq=6 ttl=30 time=0.656 ms
64 bytes from 192.168.130.23: icmp_seq=7 ttl=30 time=1.49 ms
64 bytes from 192.168.130.23: icmp_seq=8 ttl=30 time=0.932 ms
64 bytes from 192.168.130.23: icmp_seq=9 ttl=30 time=0.806 ms

Has somebody any useful hints?

Thanks and all the best,
Frank

Have you read the "Notes on S7-1200/1500" of the s7 node? Maybe some configuration issue...:thinking:

I haven't tried the s7 node on 1200/1500 PLCs because we implemented our own TCP-based protocol for communication.

Yes, "Optimized block access" is disabled for the DB.
Permit access with PUT/GET is enabled.

I still getting values, read from the DB but also a lot of timeouts.

Okay, I found out, the debug error comes not from the S7.

2.10.2019, 11:08:40node: e768e368.f8cd28
msg : string[41]
"Keine Antwort, Neustart der Kommunikation"

In debug window, if I select current flow, the error of the node is not visible.
If I select ALL NODES the error comes back. I have only one flow. How can I find out, what node: e768e368.f8cd28 is?

Have you tried clicking on the number? It should take you to that node (provided it isn’t in a subflow)

If I filter for the node e768e368.f8cd28 I get no result, also by clicking on the node id

Could be the config node (s7-endpoint).

I have exported the flow, in notepade I find the node ID. But I can't as a new user upload the file. So it's placed here:

[{"id":"6c23acd6.00a0c4","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"e768e368.f8cd28","type":"s7 endpoint","z":"","transport":"iso-on-tcp","address":"192.168.130.23","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","adapterauto":true,"adapterport":"","busaddr":"2","adapteraddr":"0","cycletime":"10000","timeout":"5000","verbose":"default","name":"","vartable":[{"addr":"DB26,REAL0","name":"T1_Abgabe"}]},{"id":"742b85b7.f0debc","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"6e60af29.6fcd2","type":"ui_group","z":"","name":"Kühlwasser","tab":"742b85b7.f0debc","disp":false,"width":"6","collapse":false},{"id":"78255b7b.2b4f64","type":"ui_base","theme":{"name":"theme-dark","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#aeae00","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#097479","value":"#aeae00","edited":true},"page-titlebar-backgroundColor":{"value":"#aeae00","edited":false},"page-backgroundColor":{"value":"#111111","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#fafa00","edited":false},"group-borderColor":{"value":"#555555","edited":false},"group-backgroundColor":{"value":"#333333","edited":false},"widget-textColor":{"value":"#eeeeee","edited":false},"widget-backgroundColor":{"value":"#aeae00","edited":false},"widget-borderColor":{"value":"#333333","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Celebrate Records","hideToolbar":"false","allowSwipe":"false","lockMenu":"true","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"32d0288f.c95fb","type":"s7 in","z":"6c23acd6.00a0c4","endpoint":"e768e368.f8cd28","mode":"all","variable":"","diff":false,"name":"","x":154.5,"y":66,"wires":[["4f6166e7.0f94d8"]]},{"id":"be3bcecc.8a7f8","type":"ui_gauge","z":"6c23acd6.00a0c4","name":"","group":"6e60af29.6fcd2","order":0,"width":0,"height":0,"gtype":"gage","title":"","label":"","format":"{{msg.payload | number:1}}°C","min":"10","max":"40","colors":["#ca0000","#00ca00","#ca0000"],"seg1":"20","seg2":"23","x":631.5,"y":169,"wires":[]},{"id":"4f6166e7.0f94d8","type":"split","z":"6c23acd6.00a0c4","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":394.5,"y":172,"wires":[["be3bcecc.8a7f8","e55ece13.850f38"]]},{"id":"e55ece13.850f38","type":"ui_chart","z":"6c23acd6.00a0c4","name":"","group":"6e60af29.6fcd2","order":1,"width":0,"height":0,"label":"Kühlwasser Abgabe","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"waiting for data ...","dot":false,"ymin":"19","ymax":"25","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":688.5,"y":212,"wires":[[]]}]

It comes from the endpoint S7: "id":"e768e368.f8cd28","type":"s7 endpoint",

Do I have forgot something to configure for this endpoint?

Please format your shared flows properly.

The message "Keine Antwort, Neustart der Kommunikation" indicates that the config node re-establishes the PLC connection due to timeouts.

I don't know which options the s7 node provides, but is there a configurable timeout that may be too short?

Another point could be the PLC cycle time... maybe it is too busy?

The PLC has a stable cycle time of 2 ms, maximum 5 ms.

I have add a DB (not optimized), in my Main OB1 I do move a value into the DB from which I read in Node red. The timout in S7 Node inside Node Red is set to 10000ms - I think long enougth.

The Profinet Options have some Parameters:
Keep-Alive-Connection monitoring, set by default: 30s
Webserver in PLC is disabled.

Please take a look into the following debug log, I have added as debug of the data I've get from the PLC:

The error seems to be a false positive, because data was transmitted, take a look to the timestamps.

S7 endpoint cycle time is set to 10000ms but the debug shows data every 1000 ms.

I think, the S7 PLC will polled every 10000ms?

The data is in fact being received every 10 seconds.

I have no other clue what is going on here, could be a problem with the S7-1200/1500 protocol.
I think you should open an issue at Github and/or contact the node's author.

The problem is solved. After update to json-c-0.11-4.el7_0.x86_64, the error was gone.
Thanks for all help and useful hints.

Just out of curiosity... where is this library being used?

The only thing I found, it was installed as dept:

Dep-Install json-c-0.11-4.el7_0.x86_64 @base
Updated libfastjson-0.99.4-2.el7.x86_64 ?

It was was a fresh CentOS 7 container, only node red was installed. So I think, it was installed as a dept of the node red installation. After performing a system wide update, the error was never seen in the debug log. So I think, it comes from the jason Lib maybe.

I can't imagine how that could be related to the PLC connection. :thinking:

Maybe the restart fixed it.