All Projects → svroonland → TwinRx

svroonland / TwinRx

Licence: Apache-2.0 license
.NET library for connecting with Beckhoff TwinCAT PLC via Reactive Extensions (Rx)

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to TwinRx

TcOpen
Application framework for industrial automation built on top of TwinCAT3 and .NET.
Stars: ✭ 187 (+1068.75%)
Mutual labels:  plc, twincat, beckhoff, twincat-ads, beckhoff-twincat-plc
TcBlack
Opnionated code formatter for TwinCAT.
Stars: ✭ 67 (+318.75%)
Mutual labels:  plc, twincat, beckhoff, beckhoff-twincat-plc
ads-client
Unofficial Node.js ADS library for connecting to Beckhoff TwinCAT automation systems using ADS protocol.
Stars: ✭ 44 (+175%)
Mutual labels:  plc, twincat, beckhoff, twincat-ads
Examples-Inxton.Package.Vortex.Core
Repository contains introductory examples to Inxton.Package.Vortex.Core
Stars: ✭ 32 (+100%)
Mutual labels:  twincat, beckhoff, twincat-ads, beckhoff-twincat-plc
SoftBeckhoff
Virtual Beckhoff PLC for local testing with docker support
Stars: ✭ 40 (+150%)
Mutual labels:  plc, twincat, beckhoff
TwinCAT.JsonExtension
TwinCAT variables to and from json
Stars: ✭ 39 (+143.75%)
Mutual labels:  twincat, beckhoff, twincat-ads
tame4
JS library for the access to a TwinCAT PLC. Current version V4.3.1 final.
Stars: ✭ 37 (+131.25%)
Mutual labels:  twincat, beckhoff, twincat-ads
TcUnit-Runner
Program that makes it possible to automate runs of TcUnit unit tests
Stars: ✭ 23 (+43.75%)
Mutual labels:  plc, twincat, beckhoff
node-ads
NodeJS Twincat ADS protocol implementation
Stars: ✭ 49 (+206.25%)
Mutual labels:  twincat, beckhoff
ioBroker.beckhoff
ioBroker Adapter to Communicate with Beckhoff Automation System over ADS
Stars: ✭ 14 (-12.5%)
Mutual labels:  twincat, beckhoff
Easymodbustcp.net
Modbus TCP, Modbus UDP and Modbus RTU client/server library for .NET implementations
Stars: ✭ 358 (+2137.5%)
Mutual labels:  plc
Icsmaster
ICS/SCADA Security Resource(整合工控安全相关资源)
Stars: ✭ 582 (+3537.5%)
Mutual labels:  plc
Pycomm3
A Python Ethernet/IP library for communicating with Allen-Bradley PLCs.
Stars: ✭ 102 (+537.5%)
Mutual labels:  plc
Sharpscada
C# SCADA
Stars: ✭ 2,043 (+12668.75%)
Mutual labels:  plc
Python Snap7
A Python wrapper for the snap7 PLC communication library
Stars: ✭ 317 (+1881.25%)
Mutual labels:  plc
Sharp7
Nuget package for Sharp7
Stars: ✭ 89 (+456.25%)
Mutual labels:  plc
Libplctag
This C library provides a portable and simple API for accessing Allen-Bradley and Modbus PLC data over Ethernet.
Stars: ✭ 314 (+1862.5%)
Mutual labels:  plc
Iotclient
这是一个物联网设备通讯协议实现客户端,将会包括主流PLC通信读取、ModBus协议、Bacnet协议等常用工业通讯协议。本组件终身开源免费,采用最宽松的MIT开源协议,您可以随意修改和商业使用(商业使用请做好评估和测试)。
Stars: ✭ 311 (+1843.75%)
Mutual labels:  plc
Fuxa
Web-based Process Visualization (SCADA/HMI/Dashboard) software
Stars: ✭ 262 (+1537.5%)
Mutual labels:  plc
Node Ethernet Ip
A Lightweight Ethernet/IP API written to interface with Rockwell ControlLogix/CompactLogix Controllers.
Stars: ✭ 163 (+918.75%)
Mutual labels:  plc

NOTE

As of version 4.2.172.0, the Beckhoff ADS library for .NET also includes support for Reactive Extensions, making this library obsolete. See here for more information: https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_adsnetref/7312584843.html&id=


Build status NuGet version

TwinRx

TwinRx is a library for connecting a .NET application with a Beckhoff TwinCAT PLC program via Reactive Extensions (Rx) over ADS.

Features

  • Create an IObservable for a PLC variable, bringing changes to the PLC variable into the Reactive world.
  • Make use of Rx's extensive event processing and querying capabilities to transform the observable into events of interest.
  • Stream (write) an existing IObservable to a PLC variable
  • Transparently reregister the notifications after a connection loss

Requires

  • .NET 4.5 or higher
  • Beckhoff TwinCAT PLC (v2 or v3)

Installation

  • Install the NuGet package "TwinRx" using the NuGet Package Manager in Visual Studio

Example code

using System;
using System.Reactive.Linq;
using TwinCAT.Ads;
using TwinRx;

var adsClient = new TcAdsClient();
adsClient.Connect(801); // 801 for TwinCAT 2, 851 for TwinCAT 3

var client = new TwinCatRxClient(adsClient);

var counter = client.ObservableFor<short>("MAIN.var1", 20);

// Print out each value as it changes
counter.Subscribe(v => Console.WriteLine("Variable is now:" + v));

// Print out 10 values at a time
var buffered = counter.Buffer(10);
buffered.Subscribe(v => Console.WriteLine("Last 10 values were:" + String.Join(" - ", v)));

// Values including timestamp
var valuesWithTimestamp = counter.Select(i => new Tuple<short, DateTime>(i, DateTime.Now));
valuesWithTimestamp.Subscribe(Console.WriteLine);

// Take a single value each second
valuesWithTimestamp
	.Sample(TimeSpan.FromSeconds(5))
	.Subscribe(Console.WriteLine);

var myString = client.ObservableFor<string>("MAIN.var2");
myString.Subscribe(Console.WriteLine);

// Write a value to the PLC periodically
var valueEverySecond = Observable
	.Interval(TimeSpan.FromSeconds(1))
	.Select(i => (short) i);
var writer = client.StreamTo("MAIN.var3", valueEverySecond);

// Only even ones
var evens = client.ObservableFor<short>("MAIN.var4").Where(i => i%2 == 0);
var evensWithTimestamp = evens
	.Timestamp()
	.Zip(evens.TimeInterval(), (valWithTimestamp, interval) => new { val = "Even value is " + valWithTimestamp, interval });
evensWithTimestamp.Subscribe(Console.WriteLine);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].