Accessing the external .Net DLL for scripting

Windows® Compatible Software for Displaying LIN Messages
Post Reply
wojciech
Posts: 1
Joined: Tue 29. Jul 2025, 08:20

Accessing the external .Net DLL for scripting

Post by wojciech » Fri 10. Oct 2025, 14:45

Hello,

I'm wondering if I can use references to external dlls from the PLIN-view pro.
For example, to trigger ouotput changes on Labview DAQ-mx devices, or to read its states.

I see that the DAQmx dll is present on list, when I go to Tools -> Options -> References.
Image
but how to use it in scripts? Any example on calling the methods?

thanks,
Wojciech

M.Lang
Software Development
Software Development
Posts: 39
Joined: Wed 22. Sep 2010, 13:28

Re: Accessing the external .Net DLL for scripting

Post by M.Lang » Wed 15. Oct 2025, 13:19

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

Post Reply