using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
namespace PACNET
{
/// PAC_IO API
public partial class PAC_IO
{
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteDO_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool WriteDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, uint lDO_Value);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadDIO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadDIO_MF(IntPtr hPort, int slot, int iDI_TotalCh, int iDO_TotalCh, ref uint lDI_Value, ref uint lDO_Value);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadDI_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ReadDI_MF(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lDO_Value);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadDO_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ReadDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lDO_Value);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadDICNT_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadDICNT_MF(IntPtr hPort, int slot, int iChannel, int iDI_TotalCh, ref uint lCounter_Value);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ClearDICNT_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ClearDICNT_MF(IntPtr hPort, int slot, int iChannel, int iDI_TotalCh);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModulePowerOnValueDO_MF")]//PowerON status is 0ff and ruturn the 0 of powerOn value even the powerON value isn't 0 saved on fram
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModulePowerOnValueDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModulePowerOnValueDO_MF")]//PowerOn value large 0 means the PowerOn value is enabled
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModulePowerOnValueDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, uint lData);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModuleSafeValueDO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModuleSafeValueDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModuleSafeValueDO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModuleSafeValueDO_MF(IntPtr hPort, int slot, int iDO_TotalCh, uint lData);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadAO_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ReadAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, ref float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteAO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModulePowerOnValueAO_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModulePowerOnValueAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, ref float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModulePowerOnValueAO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModulePowerOnValueAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModuleSafeValueAO_MF")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModuleSafeValueAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, ref float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModuleSafeValueAO_MF")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModuleSafeValueAO_MF(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, float fValue);
}
}