epics-modules / opcua

EPICS Device Support for OPC UA
Other
19 stars 13 forks source link

Array type matches are too strict #148

Open dirk-zimoch opened 1 year ago

dirk-zimoch commented 1 year ago

Currently, the EPICS type of the array record must match the OPC-UA data type quite precisely. It is not possible to load arrays into a record of a different (even larger) type, e.g. UInt16 into LONG.

This is particularly annoying with arrays of Boolean, as there is no matching EPICS type.

It is no problem to load any scalar integer type into a longin or ai record, even Boolen and unsigned types. The same should be possible for arrays.

ralphlange commented 1 year ago

This was an intentional design decision, based on performance concerns.

If sizes match, arrays can be copied using memcpy(). If sizes don't match, we need to loop and copy element by element.

ralphlange commented 1 year ago

For OPC UA Boolean, I think UCHAR arrays work.