public double GetSignal() { IntPtr pAddressOfFunctionToCall = DllMethods.GetProcAddress(_pDll, "getInputs"); GetInputs getInputs = (GetInputs)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(GetInputs)); return(getInputs(_portNumber)); }
public void SetSignal(double value) { IntPtr pAddressOfFunctionToCall = DllMethods.GetProcAddress(_pDll, "setInputs"); SetInputs setinputs = (SetInputs)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(SetInputs)); setinputs(_portNumber, value); }
private void Terminate() { IntPtr pAddressOfFunctionToCall = DllMethods.GetProcAddress(_pDll, "terminate"); terminate Terminate = (terminate)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(terminate)); Terminate(); }
private void Initialze() { IntPtr pAddressOfFunctionToCall = DllMethods.GetProcAddress(_pDll, "initialize"); initialize Initialize = (initialize)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(initialize)); Initialize(); }
public void Step() { foreach (var inSignal in _inSignals) { inSignal.Update(); } IntPtr pAddressOfFunctionToCall = DllMethods.GetProcAddress(_pDll, "step"); step Step = (step)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(step)); Step(); foreach (var outSignal in _outSignals) { outSignal.Update(); } }