A simple D binding to LIBNODAVE
Clone or download
Latest commit dfeaffc Nov 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
c Add createConnection Jun 8, 2017
examples Add getU8Array Nov 27, 2018
lib Initial commit. Oct 28, 2014
src/dinodave Bumped version to 1.7.1 Nov 30, 2018
tests Add closeConnection Nov 30, 2018
.editorconfig Add timer example Jun 8, 2017
.gitattributes Add gitattributes Mar 30, 2017
.gitignore Add NodaveReadException Nov 28, 2018
.travis.yml Updated travis Jan 26, 2017
CHANGELOG.md Changed makefile (dub based) Jul 19, 2016
LICENSE Initial commit Oct 28, 2014
README.md Update README Sep 26, 2018
bump-version.sh Formatted with dfmt Sep 26, 2018
dub.sdl Add bufferappender Nov 28, 2018
hmod.cfg Aggiornato make Jun 9, 2017
install-libnodave.sh Updated travis Jan 26, 2017
makefile Aggiornato make Jun 9, 2017
makefile.win32 Updated makefile Feb 5, 2015
mlstyle.css Add timer example Jun 9, 2017

README.md

dinodave

Build Status Dub version Dub download Status

A simple D binding to LIBNODAVE, a free library to communicate to Siemens S7 PLCs

Note that project's development happens on the GitLab. GitHub repository is a mirror, it might not always be up-to-date.

Compiling

With dub:

$ dub build

with make (linux):

$ make

(win32)

$ make -f makefile.win32

On Win32 see also wiki.

Testing

With dub:

$ dub test

with make (only for linux):

$ make test

Example usage

import std.stdio;
import dinodave;

void main(string[] args) {
   enum string IP = "192.168.221.102";
   enum DB = 11;
   try {
      auto s7 = new IsoTcp(IP);
      s7.openConnection(0);
      scope(exit) s7.closeConnection();

      int start = 160;
      int length = 2;
      s7.readBytes(DB, start, length);

      int a = s7.getU16();
      writeln("db11.160: ", a);

   } catch(Exception e) {
      writeln(e);
   }
}

See also directory examples/ and wiki.

Install libnodave

$ git clone git@github.com:netdata/libnodave.git
$ cd libnodave
$ make
$ sudo make install

or use install-libnodave.sh