Click or drag to resize

DataConverterGetConverter Method

Returns a function that will convert a value from one type to another.

Namespace:  Demo3D.PLC.Comms
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public static ConversionDelegate GetConverter(
	IDataContextProvider? contextProvider,
	DataType expectedSourceType,
	DataType destinationType
)

Parameters

contextProvider
Type: Demo3D.PLC.CommsIDataContextProvider
The context of conversions.
expectedSourceType
Type: Demo3D.PLC.CommsDataType
The expected source data type of the value.
destinationType
Type: Demo3D.PLC.CommsDataType
The data type of the value to return.

Return Value

Type: ConversionDelegate
A function that will convert a value from one type to another.
Remarks
The value passed to the conversion function is expected to be expectedSourceType, but the conversion will still be attempted if it's a different type.
See Also