Skip to content

Commit d3b9d72

Browse files
authored
Adds new plc_tag_create_from_tag method available from v2.7.0 (#471)
1 parent 0f0e1ac commit d3b9d72

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/libplctag.NativeImport/NativeMethods.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static NativeMethods()
5353
[DllImport(DLL_NAME, EntryPoint = nameof(plc_tag_create_ex), CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
5454
public static extern Int32 plc_tag_create_ex([MarshalAs(UnmanagedType.LPStr)] string lpString, callback_func_ex func, IntPtr userdata, int timeout);
5555

56+
[DllImport(DLL_NAME, EntryPoint = nameof(plc_tag_create_from_tag), CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
57+
public static extern Int32 plc_tag_create_from_tag(Int32 src_tag_id, [MarshalAs(UnmanagedType.LPStr)] string attrib_str, callback_func_ex func, IntPtr userdata, int timeout);
5658

5759
[DllImport(DLL_NAME, EntryPoint = nameof(plc_tag_destroy), CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
5860
public static extern int plc_tag_destroy(Int32 tag);

src/libplctag.NativeImport/plctag.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public static Int32 plc_tag_create_ex(string lpString, callback_func_ex func, In
4444
return NativeMethods.plc_tag_create_ex(lpString, func, userdata, timeout);
4545
}
4646

47+
public static Int32 plc_tag_create_from_tag(Int32 src_tag_id, string attrib_str, callback_func_ex func, IntPtr userdata, int timeout)
48+
{
49+
return plc_tag_create_from_tag(src_tag_id, attrib_str, func, userdata, timeout);
50+
}
51+
4752
public static int plc_tag_destroy(Int32 tag)
4853
{
4954
return NativeMethods.plc_tag_destroy(tag);

0 commit comments

Comments
 (0)