using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
namespace PACNET
{
/// i8KR IO API
public partial class PAC_IO
{
///
[DllImport("PACSDK.dll", EntryPoint = "pac_InitModuleWDTInterrupt")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool InitModuleWDTInterrupt(int slot, PAC_CALLBACK_FUNC f);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_SetModuleWDTInterruptStatus")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetModuleWDTInterruptStatus(int slot, short enStatus);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_GetModuleWDTInterruptStatus")]
public static extern short GetModuleWDTInterruptStatus(int slot);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_GetModuleLastOutputSource")]
public extern static short GetModuleLastOutputSource(IntPtr hPort, int slot);//以後整合87K的功能進去
///
[DllImport("PACSDK.dll", EntryPoint = "pac_GetModuleWDTStatus")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool GetModuleWDTStatus(IntPtr hPort, int slot);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_GetModuleWDTStatusEX")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetModuleWDTStatusEX(IntPtr hPort, int slot, ref uint status);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_GetModuleWDTConfig")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool GetModuleWDTConfig(IntPtr hPort, int slot, ref short enStatus, ref int wdtTimeout, ref int ifWDT_Overwrite); //v
///
[DllImport("PACSDK.dll", EntryPoint = "pac_SetModuleWDTConfig")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool SetModuleWDTConfig(IntPtr hPort, int slot, short enStatus, int wdtTimeout, int ifWDT_Overwrite);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ResetModuleWDT")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ResetModuleWDT(IntPtr hPort, int slot);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_RefreshModuleWDT")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool RefreshModuleWDT(IntPtr hPort, int slot);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModuleSafeValueDO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModuleSafeValueDO(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModuleSafeValueDO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModuleSafeValueDO(IntPtr hPort, int slot, int iDO_TotalCh, uint lData);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModuleSafeValueAO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModuleSafeValueAO(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, ref float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModuleSafeValueAO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModuleSafeValueAO(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModulePowerOnValueDO")]//PowerOn value large 0 means the PowerOn value is enabled
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModulePowerOnValueDO(IntPtr hPort, int slot, int iDO_TotalCh, uint lData);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModulePowerOnValueDO")]//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(IntPtr hPort, int slot, int iDO_TotalCh, ref uint lValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_WriteModulePowerOnValueAO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool WriteModulePowerOnValueAO(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, float fValue);
///
[DllImport("PACSDK.dll", EntryPoint = "pac_ReadModulePowerOnValueAO")]
[return:MarshalAs(UnmanagedType.I1)]
public static extern bool ReadModulePowerOnValueAO(IntPtr hPort, int slot, int iChannel, int iAO_TotalCh, ref float fValue);
}
}