News:

SMF - Just Installed!

Main Menu

Custom Driver: Example as C#-Solution

Started by mueller_t, April 29, 2020, 10:19:34 AM

Previous topic - Next topic

mueller_t

Can share somebody a C#-Solution for a custom driver. I have implemented my own driver according the description from the SDK, but my driver is not listed in easyplc, if i want add new hardware. I'm using a licensed version of easyplc.

Thanks a lot
Thorsten

EasyPLC_Master

Hello!

In order the driver will be recognized for EasyPLC, the Assembly name must match with the driver file name, please see the Screen.gif attached example.

Please confirm if this solve your problem.


mueller_t

Hi,

yes, this is matching, see my Screenshot. I have attached my simple solution. So maybe it's possible, that you can take a look , where is the mistake in my solution. The dll is compiled as x86 / Release.

EasyPLC_Master

Hello after review your code, two comments:

1. The driver can not have an abstract or static class -> public static class FMU_Model.
This causes your driver can't be loded

2. The class that implements the IExternalDriver interface must to be named same as the Assembly name and file name, see the example attached (see screen1.gif)

Please, update your progress work.
Thanks!

EasyPLC_Master

Also as example, here is attached the source code of the Simulated I/O driver to manage the digital/analog I/O manually from a windows form.

mueller_t

Thanks for your support. I will update my driver and it should work. Best regards Thorsten