Node Red server connection lost connecting IOT2040 to S7-1200

Hi Guys,

I'm having problems with a simple flow reading data from my non-optimized DB1,WORD0 using an S7 1200 with V14 SP1. I am using the S7 In node connected to a debug node (Msg.Payload).

When my string is deployed the indicator on the "S7 In" node turns yellow(connecting) then a message appears "Lost connection to server". I have deleted the flow numerous times from the IOT2040 and set it up again but I kept having the same problem.

On a previous test program I had no connection problems and communication was fine, I was able to send and receive data to the PLC. I have also tried to change the IP address, to no avail.
I have tried a factory reset on the PLC, created new program and reuploaded the image for the IOT and installed the S7 library, but I still have the same issue as seen in the log report below. I have also changed cables and switch ports.

In order to access node red again i have to delete the flows.

See script and Node red log below.
I'm very new to this so any help is much appreciated.
Regards.

[{"id":"10146917.7654c7","type":"s7 in","z":"b469084f.726ab8","endpoint":"4d278213.c75a8c","mode":"single","variable":"OUT","diff":true,"name":"","x":110,"y":80,"wires":[["2f3e1868.683a68"]]},{"id":"4d278213.c75a8c","type":"s7 endpoint","z":"","transport":"iso-on-tcp","address":"192.168.0.3","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","adapter":"","busaddr":"2","cycletime":"5000","timeout":"2

Node Red Log:
9 Nov 22:11:02 - [info] Starting flows
9 Nov 22:11:02 - [info] Started flows
9 Nov 22:18:05 - [info] Stopping flows
9 Nov 22:18:05 - [info] Stopped flows
9 Nov 22:18:05 - [info] Starting flows
9 Nov 22:18:06 - [info] Started flows
9 Nov 22:18:06 - [error] [s7 out:bde46f5e.59633] Error: Not connected
9 Nov 22:18:06 - [red] Uncaught Exception:
9 Nov 22:18:06 - TypeError: stream.off is not a function
at ISOOnTCPClient.isoOnTcp.createConnection (/usr/lib/node_modules/node-red- contrib-s7/node_modules/@st-one-io/nodes7/src/s7endpoint.js:207:24)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ISOOnTCPClient.emit (events.js:208:7)
at process.nextTick (/usr/lib/node_modules/node-red-contrib-s7/node_modules/ iso-on-tcp/src/client.js:193:45)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)

Hello,
a few questions:

  • can you ping the PLC from yout IOT2040?
  • is the Put/Get checkbox enabled in the PLC?
  • did you configure Rack 0 Slot 1 in your node-red flow?

Could you please post your flow again here? It seems that the flow you pasted here is not complete.

Also can you show the start of the node red startup log please.

Hi Guys,
The problem is resolved.
I installed the S7 node via "Manage Palette" in which it installs the version 3.0.0-beta.3. There must some problem with this.
I re-uploaded the image and installed V2.2.1 through the terminal with "npm install -g node-red-contrib-s7@2.2.1" and I'm back in business.
I had also posted the problem on the Siemens forum and one the technical experts assisted me.

Regardless, thank you for taking the time to respond to my query.

Hey @Dedoyler,
great that you manage to solve the problem!
I'm part of ST-One, the company who developed this S7-Node. Could you please send me your Node (and Node-RED) versions number?
I see that you are running this on a IoT2040 and we only support users of our own hardware (ST-One), not generic hardwares, but anyway, we would like to simulate your problem here in our environment.