dfins 0.4.1

D library for Omron FINS protocol


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

dfins

This is an implementation of the OMRON FINS protocol using D

Usage

The examples sub directory contains examples explaining how use this library.

Import the module:

import dfins;

Create an udp channel:

enum TIMEOUT_MS = 2000;
IChannel chan = createUdpChannel("192.168.221.22", TIMEOUT_MS);

Create a FinsClient object and pass it:

  • channel
  • header
Header h = header(22);
FinsClient f = new FinsClient(chan, h);

Finally read and write:

/* Reads 10 registers starting from register 00000 in the DM Memory Area */
ubyte[] d0 = f.readArea(MemoryArea.DM, 0, 10);

/* Writes the values 42, 19, 64 into DM registers 0, 1, 2 */
ushort[] v = [42, 19, 64];
f.writeArea(MemoryArea.DM, 0, v.toBytes!ushort);

Documentation

dfins uses ddoc. One way of building and serving the documentation locally (you will need libevent for serving) is:

dub build -b ddox && dub run -b ddox

Or use your favorite DDOC compiler.

Omron PLC data example

Data typeValueFINS rep.Std rep.
float3.140xF5C340480x4048F5C3
string'abcdefghi'0x42414443464548470490x4041424344454547484900
uint (32bit)0x0a0b0c0d0x0c0d0a0b0x0a0b0c0d
floatstringuint
Value3.14'abcdefghi'0x0a0b0c0d
FINS rep.0xF5C340480x42414443464548470490x0c0d0a0b
Std rep.0x4048F5C30x40414243444545474849000x0a0b0c0d
Authors:
  • Orfeo Da Viá
Dependencies:
none
Versions:
0.4.1 2019-Aug-01
0.4.0 2019-Jun-26
0.3.2 2019-Jun-26
0.3.1 2019-Jun-25
0.3.0 2019-Jun-25
Show all 10 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 0 downloads total

Score:
0.7
Short URL:
dfins.dub.pm