Hello,
As decripted in the documentation topic "Options and References Dialog Box" and the section "References", all locally available .NET assemblies are listed there, regardless of whether their use in the software is useful.
One reason for using an external .NET assembly DLL is, for example, that you want to write your own counter implementation, CRC or checksum calculation in your preferred .NET language.
Then you know how to use your .NET assembly DLL in the C# scripting functions of PLIN-View Pro.
Here is a small code example programmed in C# in Microsoft Visual Studio that could be part of such a .NET assembly:
Code: Select all
namespace Peak.Samples.Simple
{
public class Counter
{
private int minVal = 0;
private int maxVal = 255;
private int incVal = 1;
public Counter(int MinValue, int MaxValue, int IncrementValue)
{
minVal = MinValue;
maxVal = MaxValue;
incVal = IncrementValue;
}
public byte IncByte(byte Value)
{
int res = Value + incVal;
if (res > maxVal)
res = minVal;
if (res < Byte.MinValue)
return Byte.MinValue;
if (res > Byte.MaxValue)
return Byte.MaxValue;
else
return Convert.ToByte(res);
}
}
}
Here is a small code snippet for using this .NET assembly DLL in PLIN-View Pro and in the C# script:
Code: Select all
private Peak.Samples.Simple.Counter counterObj = new Peak.Samples.Simple.Counter(1, 0xA0, 2);
public bool RollingCounterExternal(int id, int length, ref byte[] data)
{
if (id == 0x01)
data[1] = counterObj.IncByte(data[1]);
return true;
}
And, of course, the .NET assembly must be loaded in the PLIN-View Pro (see under Options and References -> Program).
If you want to use a different external .NET assembly DLL, for example, from another company, you must contact that company for more information about using that DLL.
Further information about C# scripting can also be found in the PLIN-View Pro documentation under the main topic "Automation".
Regards
M.Lang