Welcome, Guest
Username: Password: Remember me

TOPIC: Communicate with Siemens S7-1200 PLC using Nodave

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10956

  • davew
  • davew's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
Hi all,
I totally new to ProviewR.
I'm evaluating it as a possible HMI/SCADA for use on existing plant.
The existing plant consists of 7 S7-1200 PLCs and one S7-1500 PLC.
All of the control logic is in the Siemens PLCs.

So I've set up a few virtual machines in my lab to be the ProviewR environment.
I've worked through the "getting started guide" and found that quite straight forward and it all worked fine on the dev machine as expected.

My next step was to see if I could extend that project to fetch some data from a real S7-1200.

The S7-1200 is at a remote location and accessible via a VPN. All that connection works perfectly, I can access the PLC with the Siemens tools and with other SCADA software using the ISOTCP protocol.

I added a Nodave_PLC object to the IO NodeHier object and configured it for the remote PLC.
I added a Nodave_Transaction object to the Nodave_PLC object and configured that for DB access to the DB I'm interested in.
I added 2 ChanAi objects to the Nodave_Transaction object both configured for float32 and hopefully configured to fetch the first two floats from the DB.
I added two Ai objects to the plant and connected them to the PLC Ai channels.

I then built the node for the dev box and run it.
Everything appears to build fine.
The runtime starts without problems.
All of the stuff in the getting started guide still works fine.
I didn't create any graphic entities to display the values from the S7-1200.

What I expected was to observe traffic on the network as ProvieR fetches the data from the S7-1200 but theres nothing.
I figured maybe the system wouldn't try to talk to the S7-1200 from a dev box so I took the leap of configuring up a runtime box and distribute the project to it.
That seemed to work but there are warnings generated regarding missing files and the console window indicates that the distribute tried to sudo for some reason (I suspect that failed).

What I expected was at least the same processes running on the runtime box as those running on the dev box when the runtime is running, but no. Nothing. Not one single process.
So I guess that is a sudo that "distribute" attempts and it does fail.

I investigated the missing file warnings. They appear to be because the environment on the dev box is bad.
$pwrp_load points to /pwrp/common/load, similarly all the other $pwrp_* environemnt variables, but /pwrp doesnt exist. $pwrp_root in the /etc/pwr_profile appears to be the culprit there.

Files have been copied to the runtime station though.

So 2 questions I guess.
1. Why doesnt the project run when distributed to the runtime?
2. How to get it to talk to a S7-1200 PLC?
The administrator has disabled public write access.

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10957

  • davew
  • davew's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
I've discovered why the runtime node doesn't start my distributed package.

The runtime deb package sets the QBus to 517 by default on install so it wouldn't start my distributed package that had a QBus of 1.

I think it would be a good idea if the getting started guide was expanded to distributing the project to runtime nodes.

It would also be a good idea to document the fact that the runtime deb package defaults to QBus 517 and the file where this is set in the install guide and the getting started guide.

I found it by piecing together the ocasional mentions of QBus and reading the source code.

So now I'm left with how to get the system to talk to the Siemens S7-1200.
The administrator has disabled public write access.

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10958

  • davew
  • davew's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
Browsing around the source code in the git repo I discovered that nodave appears to be disabled (dummy files).

So now I'm wondering do I need to build from source and include libnodave somehow?
The administrator has disabled public write access.

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10960

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3179
  • Thank you received: 502
  • Karma: 133
Hi Dave,

When we made the interface to libnodave some ten years ago, the libnodave code was not compilable on 64-bit linux so we have never built it with the 64-bit releases. It's possible this is fixed now, but we don't use libnodave, we have no Siemens system to test it with and we haven't had any question about for years, so it's more or less been forgotten.

Still though, the build process looks for libnodave, and if it's found it will be included, otherwise the dummy files are use to avoid undefined references.

/Claes
The administrator has disabled public write access.

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10963

  • davew
  • davew's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
Claes,
Thank you very much.

The libnodave library is somewhat ancient.
I have built a version of libnodave for x_64 though I have no idea if it works yet. Libnodave is somewhat messy and given the design of its code shouldn't really be considered a library, it should be considered a small number of source files that are included directly into a project but the author chose to build a lib.
I'm considering forking libnodave to re-write it and bring it up to date making it thread safe etc.

So far I have rebuilt the source code and it appears to be including my libnodave library but I still can't get it to communicate with the PLC or even attempt a TCP connection.

For a run time I have used the getting started guide and extended it to include an additional PLC and have attached the nodave PLC to the first thread of that PLC.
After distribution to the runtime node it starts and runs as expected but no attempt is made to generate a network connection to the PLC.

In my efforts to determine what is (or is not) happening I have found a log message. I suspect it means I've done something wrong but I've no idea what.

Screenshot_2021-03-24_10-34-42.png
The administrator has disabled public write access.

Communicate with Siemens S7-1200 PLC using Nodave 3 years 1 month ago #10964

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3179
  • Thank you received: 502
  • Karma: 133
This is the return status from the nodave dummy functions, so these are still active.

When you have setup the pwre environment, the command 'pwre configure' will list current configuration and there should be a yes on nodave. Then the nodave files have to be recompiled.

In your project you also have to specify that the plc executable should be linked with the nodave archive, by creating a BuildOptions object under the NodeConfig object in the directory volume. Set SystemModules/Nodave in this object.

/Claes
The administrator has disabled public write access.
Time to create page: 7.495 seconds