Home / C#

C#

Modbus with C#: a how-to video

In this video I explain how to use NModbus to read and write values from Modbus holding registers. This video follows the article “Modbus with C#” and should dissipate the doubts around setting up Modbus and using the functions provided. I’m using a modbus simulator and comport simulator, so it ...

Read More »

WPF touch-friendly controls for resistive touch-screen

While it’s fairly common, when working in automation field, to make software that runs on resistive touch-screens, I admit that it’s not a trivial task to make a good user experience, especially with a desktop technology like WPF and C#. In this article I posted some of the problems that ...

Read More »

Snap7: an open source Siemens S7 communication library

In a recent comment i came across Snap7, a new Siemens S7 open source library to communicate with Siemens Plc S7-300, S7-400, S7-1200 and S7-1500. It supports many languages (C++, C# and more) and it’s multi-platform. The library can be downloaded from http://snap7.sourceforge.net and the official page of the project ...

Read More »

OPC XML DA Client with C#

With this article I want to show how to create a webservice in C# to communicate with an OPC-XML-DA server, like the one of SIMOTION D plc. OPC-XML-DA is a communication protocol based on SOAP and XML. To connect to a OPC-XML-DA server you need a WSDL file, that defines ...

Read More »

Writing your first HMI project in C# – WPF

UPDATE 08/03/2017: I see that this article is quite popular, however it takes a simple approach to get you started, by using timers and other shortcomings. If you want to build your HMI with WPF and MVVM you can check also my new series HMI with C# and WPF. In ...

Read More »

How to use Windows 7 dialogs with WPF

Wpf is an advanced technology to build responsive user interfaces, but for many tasks (MessageBox, Folder Browser, Progress Dialog) you still have to use the old Windows Forms dialogs. Windows 7 replaced this old forms with new ones to provide a better User Interface and a better feeling to their ...

Read More »

Using AdvancedHMI’s PLC drivers with C#

AdvancedHmi is a free and “almost open-source” HMI framework written in VB.Net that offer some drivers for PLCs, and also offer free SCADA objects for winforms users. I say “almost open-source” because the code of the two main libraries is not provided (MfgControl.AdvancedHMI.Drivers.dll and MfgControl.AdvancedHMI.Controls.dll), but it’s provided how to ...

Read More »