Good idea that needs more followup.
I try to get started with writing a plugin in c#, got the basics working.
Getting anyting done was not without frustrations and a bit time consuming.
So in the process of it I also made a plugin for testing calls and functions.
That plugin was a good idea for me and I would like to share it.
The plugin is as simple as possible, deviding code in regions of releted bits and pieces.
Logging is added to see what exactly is done in what order. And if there are any problems, details about it.
Note: the solution have references to 'Plugininterface.dll' and 'UC100_wrapper.cs' which are not included
in the zip file. See _README_.txt for more details
The zipfile includes the builds for a debug and a release version. You can try the plugin without compiling it the first time.
This version of the plugin has two buttons one for getting statistics and one for asking the current position.
And a MDI line similar to the one in the UCCNC software.
Here is an examle of the log that is produced from that plugin.
Info: UCCNC plugin: action = "Create"; name = Testbed; version = 0.1.1.0; time = 2022/07/03 09:54:20
Warn: UCCNC plugin: This plugin is for the development environment only. It is (inherently) *not safe* to load it by default in a productions environment.
Debug: UCCNC plugin: Getproperties_event(author = "A.H.M. Steenveld", pluginname = "Testbed", pluginversion = 0.1.1.0)
Debug: UCCNC plugin: Init_event(UC)
Warn: UCCNC plugin: Init_event; action = "init repeated event"
Debug: UCCNC plugin: Startup_event()
Form: action = "initialise application"
Debug: UCCNC plugin: Buttonpress_event(buttonnumber = 144, onscreen = True)
GetStatistics(ref result) = UC100_OK; DistX = 289649.000; DistY = 363524.000; DistZ = 112727.000
GetAxisPosition(...) = UC100_OK
GetAxisIndex(...) = UC100_OK
X = 163.328 units; X = 21777 steps
Y = 240.847 units; Y = 32113 steps
Z = -28.230 units; Z = -3764 steps
Debug: UCCNC plugin: Textfieldclick_event(labelnumber = 1000, Ismainscreen = True)
Debug: UCCNC plugin: Textfieldclick_event(labelnumber = 1000, Ismainscreen = True, text = "g0 x0 y0")
GetStatistics(ref result) = UC100_OK; DistX = 289658.997; DistY = 363533.997; DistZ = 112727.000
GetAxisPosition(...) = UC100_OK
GetAxisIndex(...) = UC100_OK
X = 153.330 units; X = 20444 steps
Y = 230.850 units; Y = 30780 steps
Z = -28.230 units; Z = -3764 steps
Plugin: WriteMDI("g0 x10 y10")
GetStatistics(ref result) = UC100_OK; DistX = 289668.997; DistY = 363543.997; DistZ = 112727.000
GetAxisPosition(...) = UC100_OK
GetAxisIndex(...) = UC100_OK
X = 163.328 units; X = 21777 steps
Y = 240.847 units; Y = 32113 steps
Z = -28.230 units; Z = -3764 steps
Debug: UCCNC plugin: Shutdown_event()
Debug: UCCNC plugin: action = "Finalise"
Debug: UCCNC plugin: action = Dispose(False)