Hi all,

while porting the code to use the PlcValue objects I did notice when updating 
all existing PlcFieldHandlers that the code looks sort of almost the same.
While I would say the S7FieldHandler is by far the most advanced one (actually 
checking the data has the right type and doing range checks for every element).

How about moving most of this code to a base class?
I did notice that an essential part of this are the internal types defined by 
every protocol. But these types might have different names, but in general they 
do have the same meaning.

So how about we define an Enum with the different types and then either use 
them in the drivers or simply provide a mapping of driver types to plc4x-types?

I know that writing the FieldHandler was something that required a lot of code 
and coding … this way we could reuse the code and simplify things greatly when 
writing new drivers?

Of course will there be fields that don’t fit this schema, especially for KNX 
and BACnet, but most of the other drivers could easily reuse the code.

What do you think?


Chris

Reply via email to