// =================================================================
// \brief This class provide API for open.dll
// \copyright Copyright (C) Siemens AG 2024 All Rights Reserved.
// Confidential
// =================================================================
using System;
using System.Runtime.InteropServices;
namespace Siemens.SinumerikOne.OpenClientSample
{
public class OpenApiWrapper
{
public enum OpenReturnCodes : int
{
///
/// Call was successful
///
Ok = 0,
// --------- Application control and Connection ---------
///
/// An internal error occurred.
///
ErrorInternal = -1001,
///
/// SINUMERIK ONE install path not found in registry.
///
ErrorVcNotFound = -1002,
///
/// CreateProcess of SINUMERIK ONE instance failed.
///
ErrorCreateProcess = -1003,
///
/// An SINUMERIK ONE instance is already running.
///
ErrorAlreadyRunning = -1004,
///
/// SINUMERIK ONE close failed.
///
ErrorCloseFailed = -1005,
///
/// SINUMERIK ONE instance not found.
///
ErrorInstanceNotFound = -1006,
///
/// The connection to SINUMERIK ONE is occupied.
///
ErrorInstanceBusy = -1007,
///
/// No connection to SINUMERIK ONE.
///
ErrorNoConnection = -1008,
///
/// SINUMERIK ONE is not ready for communication.
///
ErrorVcNotReady = -1009,
///
/// Invalid parameter.
///
ErrorInvalidParameter = -1010,
///
/// No valid license found. This code is deprecated !
///
ErrorNoLicenseDeprecated = -1011,
///
/// Connection to SINUMERIK ONE has been closed.
///
ErrorConnectionClosed = -1012,
///
/// S7DOS simulation mode is active.
///
ErrorS7DosSimulationActive = -1013,
///
/// Version incompatible.
///
ErrorVersionIncompatible = -1014,
///
/// The called feature is not supported by the currently used backend.
///
ErrorNotSupportedByBackend = -1015,
///
/// At least one Window could not be embedded (blackbox mode).
///
WarningWindowEmbedding = 1002,
///
/// The Client has a lower(,but comnpatible) version than the Middleware.
///
WarningVersionClientOld = 1003,
///
/// The Middleware has a lower(but comnpatible) version than the Client.
///
WarningVersionMiddlewareOld = 1004,
///
/// Detected a lost client connection. Client has to reconnect.
///
WarningConnectionCorrupted = 1005,
// --------- File handling (VCPs, startprofiles, etc.) ---------
///
/// The file could not be found.
///
ErrorFileNotFound = -2001,
///
/// There is a project already open.
///
ErrorProjectOpen = -2002,
///
/// Loading the vcp file failed.
///
ErrorLoadFailed = -2003,
///
/// No project open.
///
ErrorNoProjectOpen = -2004,
///
/// File is write protected.
///
ErrorWriteProtected = -2005,
///
/// Simulation is running.
///
ErrorSimRunning = -2006,
///
/// Saving the file failed.
///
ErrorWriteFailed = -2007,
///
/// Closing the project failed.
///
ErrorVcpCloseFailed = -2008,
///
/// The file is invalid.
///
ErrorInvalidFile = -2009,
///
/// The selected cnc software is not available.
///
ErrorCncSwUnavailable = -2010,
///
/// The file could not be created.
///
ErrorFileCreationFailed = -2011,
///
/// The frontend not installed.
///
ErrorFrontendNotInstalled = -2012,
///
/// The no license for the frontend. This code is deprecated !
///
ErrorFrontendNotLicensedDeprecated = -2013,
///
/// The path to the project file is too long.
///
ErrorFilePathTooLong = -2014,
///
/// The selected nck scaling is invalid.
///
ErrorInvalidNckscaling = -2015,
///
/// The selected ncu number is invalid.
///
ErrorInvalidNcunumber = -2016,
// --------- Simulation Control ---------
///
/// Starting the simulation failed.
///
ErrorStartSimFailed = -3001,
///
/// Stopping the simulation failed.
///
ErrorStopSimFailed = -3002,
///
/// Reseting the simulation failed.
///
ErrorResetSimFailed = -3004,
///
/// Reseting the simulation failed.
///
ErrorSimSpeedInvalid = -3005,
///
/// Simulation is not available.
///
ErrorSimNotAvailable = -3006,
///
/// Simulation is not running.
///
ErrorSimNotRunning = -3007,
///
/// Simulation is running.
///
SimRunning = 3001,
///
/// Simulation is not running.
///
SimNotRunning = 3002,
// --------- Synchronized Operation ---------
///
/// The event is unknown.
///
ErrorEventUnknown = -4001,
///
/// No events are registered.
///
ErrorNoEventsRegistered = -4002,
///
/// The simulation got interrupted.
///
ErrorSimInterrupted = -4003,
// --------- Data Access ---------
///
/// Unknown dictionary entry.
///
ErrorUnknownElement = -5001,
///
/// The dictionary id is invalid.
///
ErrorInvalidDictId = -5002,
///
/// Not enough memory for the data.
///
ErrorInsufficientMemory = -5003,
///
/// Elemente is not an array.
///
ErrorNoarray = -5004,
///
/// Wrong type for the data.
///
ErrorWrongType = -5005,
///
/// Wrong accesrights for the data.
///
ErrorInsufficientRights = -5006,
///
/// The application is not in the wait state
///
ErrorNotInWait = -5007,
///
/// No further data available.
///
NoMoreData = 5001,
// --------- File Operations ---------
///
/// The domain for file system operation is invalid.
///
ErrorFileOpInvalidDomain = -6001,
///
/// The source path for file system operation is not absolute.
///
ErrorFileOpSourcePathNotAbsolute = -6002,
///
/// The source file for file system operation does not exist.
///
ErrorFileOpSourceFileNotExists = -6003,
///
/// The destination path for file system operation is not absolute.
///
ErrorFileOpDestinationPathNotAbsolute = -6004,
///
/// The destination file or directory for file system operation already exsists.
///
ErrorFileOpDestinationAlreadyExists = -6005,
///
/// The destination directory for file system operation does not exists.
///
ErrorFileOpDestinationDirectoryNotExists = -6006,
///
/// The directory for file system operation does not exists.
///
ErrorFileOpDirectoryNotExists = -6007,
///
/// The directory for file system operation is not empty.
///
ErrorFileOpDirectoryNotEmpty = -6008,
///
/// A file or a part program can't select.
///
ErrorFileSelectNotPossible = -6009,
///
/// The channel does not exists.
///
ErrorChannelNotExists = -6010,
///
/// The file is in edit mode.
///
ErrorFileUsed = -6011,
// --------- License handling ---------
///
/// General error, licensing failed.
///
ErrorLicenseNoLicense = -7001,
///
/// The application mentioned in the license file, does not match any known application in the xMVM context.
///
ErrorLicenseUnknownApplication = -7002,
///
/// The frontend is not CMVM or RMVM.
///
ErrorLicenseUnknownFrontend = -7003,
///
/// The connection to the license server could not be established.
///
ErrorLicenseNoConnection = -7004,
///
/// The license handler could not be instantiated.
///
ErrorLicenseNoLicenseHandler = -7005,
///
/// The Server is busy, cant read, cant write.
///
ErrorLicenseErrorAtServerSite = -7006,
///
/// The license for a particular feature is not available.
///
ErrorLicenseOptionalLicenseKeyNotAvailable = -7007,
///
/// The license for a particular feature could not be granted.
///
ErrorLicenseOptionalLicenseKeyNotGranted = -7008,
///
/// The license for a particular feature could not be locked at the license server.
///
ErrorLicenseOptionalLicenseNotAqcuired = -7009,
///
/// The validation of the license file failed.
///
ErrorLicenseOptionalLicenseCheckFailed = -7010,
///
/// The acquistion of a license was not successfull.
///
ErrorLicenseKeyNotAvailable = -7011,
///
/// The main license key could not be granted.
///
ErrorLicenseKeyGrantFailed = -7012,
///
/// The main license key could not be released.
///
ErrorLicenseKeyReleaseFailed = -7013,
///
/// The main license key is invalid.
///
ErrorLicenseInvalid = -7014,
///
/// The license key is already in use.
///
ErrorLicenseAlreadyInUse = -7015,
///
/// The validation of the license key failed.
///
ErrorLicenseCheckFailed = -7016,
///
/// All licenses from the license pool are currently in use.
///
ErrorLicenseAllLicensesInUse = -7017,
///
/// The type of the used license is unknown.
///
ErrorLicenseUnknownLicense = -7018,
}
public enum OpenDictionaryElementType
{
Bool = 1,
Integer8Bit = 2,
UInteger8Bit = 3,
Integer16Bit = 4,
UInteger16Bit = 5,
Integer32Bit = 6,
UInteger32Bit = 7,
Integer64Bit = 8,
UInteger64Bit = 9,
Double = 10,
String = 11,
IntegerArray32Bit = 12,
UIntegerArray64Bit = 13,
BoolArray = 14,
DoubleArray = 15,
StringArray = 16,
UIntegerArray32Bit = 17,
UIntegerArray16Bit = 18,
UIntegerArray8Bit = 19,
}
public enum OpenEventMaskDefinition : ulong
{
Unknown = 0x0000000000000000,
NckFirstIpo = 0x0000000000000008,
NckBootReady = 0x0000000000000004,
NckIpo = 0x0000000000000001,
NckChannelNewMotion = 0x0000000000000100,
NckChannelNewBlock = 0x0000000000000200,
NckChannelConfigChanged = 0x0000000000000400,
NckChannelStartPositioningMotion = 0x0000000000000800,
NckChannelEndPositioningMotion = 0x0000000000001000,
NckChannelLengthSlicePath = 0x0000000000001001,
NckChannelLengthSlicePositioning = 0x0000000000001002,
NckChannelAngleSlicePositioning = 0x0000000000001003,
NckChannelAngleSliceOrientation = 0x0000000000001004,
NckChannelStateChanged = 0x0000000000001005,
NckChannelProgramFinished = 0x0000000000001006,
PlcOb1 = 0x0000000000010000,
PlcHwConfigChanged = 0x0000000000020000,
PlcAcyclicCommunication = 0x0000000000040000,
ContentChanged = 0x0001000000000000,
ResetStarted = 0x0002000000000000,
ResetFinished = 0x0004000000000000,
}
public enum OpenAxisMode
{
///
/// axisMode undefined
///
None = 0,
///
/// interpolation mode
///
Interpolation = 1,
///
/// positioning mode
///
Positioning = 2,
///
/// speed mode turning left
///
SpeedLeft = 3,
///
/// speed mode turning right
///
SpeedRight = 4,
///
/// speed mode stopped
///
SpeedStop = 5,
///
/// following axis - no specified type
///
Following = 6,
}
public enum OpenAxisReferenceState
{
///
/// reference state undefined
///
None = 0,
///
/// not referenced
///
NotReferenced = 1,
///
/// referenced
///
Referenced = 2,
///
/// referencing not required
///
ReferenceNotRequired = 3,
}
public enum OpenMotionType
{
///
/// value undefined / OEMIPO1 / OEMIPO2 / Involute
///
None = 0,
///
/// rapid motion independent from $AC_G0MODE
///
Rapid = 1,
///
/// linear motion
///
Linear = 2,
///
/// circle motion G2 / G3 / CIP / CT
///
Circle = 3,
///
/// A/B/C-Spline / Poly
///
Spline = 4,
///
/// G33 / G331 / G332 / G34 / G35
///
Thread = 5,
///
/// involute INVCW / INVCCW
///
Involute = 6,
}
public enum OpenCircleDirection
{
///
/// value undefined
///
None = 0,
///
/// clockwise
///
Cw = 1,
///
/// counter clockwise
///
Ccw = 2,
}
public enum OpenOperatingMode
{
///
/// no operating mode
///
None = 0,
///
/// operating mode auto
///
Auto = 1,
///
/// operating jog
///
Jog = 2,
///
/// operating mode mda
///
Mda = 3,
}
public enum OpenChannelState
{
///
/// no channel state
///
None = 0,
///
/// channel state activated
///
Activated = 1,
///
/// channel state stopped
///
Stopped = 2,
///
/// channel state reseted
///
Reseted = 3,
}
public enum OpenAxisType
{
///
/// axisType undefined
///
None = 0,
///
/// linear axis
///
Linear = 1,
///
/// round axis
///
Rotatory = 2,
///
/// modulo axis
///
Modulo = 3,
///
/// spindle axis
///
Spindle = 4,
}
public enum OpenProjectStates
{
Closed = 1,
Opening = 2,
Open = 3,
Booting = 4,
RunningOrPaused = 5,
ShuttingDown = 6,
Closing = 7,
Resetting = 8,
Saving = 9,
Error = 10,
}
[DllImport("open.dll", EntryPoint = "startApplication", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes StartApplication(string strProfileFileName);
[DllImport("open.dll", EntryPoint = "stopApplication", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes StopApplication();
[DllImport("open.dll", EntryPoint = "connect", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes Connect();
[DllImport("open.dll", EntryPoint = "disconnect", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes Disconnect();
[DllImport("open.dll", EntryPoint = "openProject", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes OpenProject(string strFileName);
[DllImport("open.dll", EntryPoint = "createProject", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes CreateProject(string strFileName, string strVersion);
[DllImport("open.dll", EntryPoint = "createProjectWithScaling", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes CreateProjectWithScaling(string strFileName, string strVersion, string strNckScaling);
[DllImport("open.dll", EntryPoint = "createProjectWithScalingNCUNumber", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes CreateProjectWithScalingNCUNumber(string strFileName, string strVersion, string strNckScaling, UInt32 ncuNumber);
[DllImport("open.dll", EntryPoint = "saveProject", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes SaveProject();
[DllImport("open.dll", EntryPoint = "closeProject", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes CloseProject();
[DllImport("open.dll", EntryPoint = "bootController", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes BootController();
[DllImport("open.dll", EntryPoint = "shutdownController", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ShutdownController();
[DllImport("open.dll", EntryPoint = "resetController", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ResetController();
[DllImport("open.dll", EntryPoint = "registerForEvents", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes RegisterForEvents(UInt32 nEventListLength, IntPtr pEventList);
[DllImport("open.dll", EntryPoint = "unregisterEvents", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes UnregisterEvents();
[DllImport("open.dll", EntryPoint = "waitForEvents", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WaitForEvents();
[DllImport("open.dll", EntryPoint = "continueSimulation", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ContinueSimulation();
[DllImport("open.dll", EntryPoint = "getDictionaryId", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetDictionaryId(string strDictionaryElement, ref UInt32 pDictionaryId);
[DllImport("open.dll", EntryPoint = "registerWatch", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes RegisterWatch(UInt32 nWatchListLength, IntPtr pDictionaryIdList);
[DllImport("open.dll", EntryPoint = "unregisterWatch", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes UnregisterWatch();
[DllImport("open.dll", EntryPoint = "getDictionaryElementType", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetDictionaryElementType(UInt32 nDictionaryId, ref byte pValue);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger64BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger64BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, UInt64[] pValueList);
[DllImport("open.dll", EntryPoint = "readSignedInteger32BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadSignedInteger32BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, Int32[] pValueList);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger32BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger32BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, UInt32[] pValueList);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger16BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger16BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, UInt16[] pValueList);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger8BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger8BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, byte[] pValueList);
[DllImport("open.dll", EntryPoint = "readBoolArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadBoolArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1)] bool[] pValueList);
[DllImport("open.dll", EntryPoint = "readDoubleArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadDoubleArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, double[] pValueList);
[DllImport("open.dll", EntryPoint = "readString", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadString(UInt32 nDictionaryId, UInt32 nStringMaxLength, IntPtr pString);
[DllImport("open.dll", EntryPoint = "readStringArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadStringArray(UInt32 nDictionaryId, UInt32 nStringArrayMaxLength, UInt32 nStringMaxLength, IntPtr ppStringArray);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger16Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger16Bit(UInt32 nDictionaryId, ref UInt16 pValue);
[DllImport("open.dll", EntryPoint = "readSignedInteger16Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadSignedInteger16Bit(UInt32 nDictionaryId, ref Int16 pValue);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger32Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger32Bit(UInt32 nDictionaryId, ref UInt32 pValue);
[DllImport("open.dll", EntryPoint = "readSignedInteger32Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadSignedInteger32Bit(UInt32 nDictionaryId, ref Int32 pValue);
[DllImport("open.dll", EntryPoint = "readUnsignedInteger64Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadUnsignedInteger64Bit(UInt32 nDictionaryId, ref UInt64 pValue);
[DllImport("open.dll", EntryPoint = "readSignedInteger64Bit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadSignedInteger64Bit(UInt32 nDictionaryId, ref Int64 pValue);
[DllImport("open.dll", EntryPoint = "getNumArrayElements", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetNumArrayElements(UInt32 nDictionaryId, ref UInt32 pNumArrayElements);
[DllImport("open.dll", EntryPoint = "readBit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadBit(UInt32 nDictionaryId, ref bool pValue);
[DllImport("open.dll", EntryPoint = "readBool", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadBool(UInt32 nDictionaryId, ref bool pValue);
[DllImport("open.dll", EntryPoint = "readByte", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadByte(UInt32 nDictionaryId, ref byte pValue);
[DllImport("open.dll", EntryPoint = "readDouble", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadDouble(UInt32 nDictionaryId, ref double pValue);
[DllImport("open.dll", EntryPoint = "readWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadWord(UInt32 nDictionaryId, ref UInt16 pValue);
[DllImport("open.dll", EntryPoint = "readDoubleWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadDoubleWord(UInt32 nDictionaryId, ref UInt32 pValue);
[DllImport("open.dll", EntryPoint = "readLongWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadLongWord(UInt32 nDictionaryId, ref UInt64 pValue);
[DllImport("open.dll", EntryPoint = "readNextEvent", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadNextEvent(ref UInt64 pEvent);
[DllImport("open.dll", EntryPoint = "readNextEventWithNcuIndex", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ReadNextEventWithNcuIndex(ref UInt64 pEvent, ref Int32 pNcuIndex);
[DllImport("open.dll", EntryPoint = "writeBit", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteBit(UInt32 nDictionaryId, bool bValue);
[DllImport("open.dll", EntryPoint = "writeBool", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteBool(UInt32 nDictionaryId, bool bValue);
[DllImport("open.dll", EntryPoint = "writeByte", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteByte(UInt32 nDictionaryId, byte nValue);
[DllImport("open.dll", EntryPoint = "writeDouble", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteDouble(UInt32 nDictionaryId, double dValue);
[DllImport("open.dll", EntryPoint = "writeWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteWord(UInt32 nDictionaryId, UInt16 nValue);
[DllImport("open.dll", EntryPoint = "writeDoubleWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteDoubleWord(UInt32 nDictionaryId, UInt32 nValue);
[DllImport("open.dll", EntryPoint = "writeLongWord", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteLongWord(UInt32 nDictionaryId, UInt64 nValue);
[DllImport("open.dll", EntryPoint = "writeBoolArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteBoolArray(UInt32 nDictionaryId, UInt32 nValueListLength, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1)] bool[] pValueList);
[DllImport("open.dll", EntryPoint = "getSimulationSpeed", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetSimulationSpeed(ref UInt32 pnPercent);
[DllImport("open.dll", EntryPoint = "setSimulationSpeed", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes SetSimulationSpeed(UInt32 pnPercent);
[DllImport("open.dll", EntryPoint = "getCardPath", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetCardPath(UInt32 nCardPathMaxLength, IntPtr pCardPath);
[DllImport("open.dll", EntryPoint = "getCardPaths", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetCardPaths(UInt32 nCardPathsArrayMaxLength, UInt32 nCardPathMaxLength, IntPtr pCardPaths);
[DllImport("open.dll", EntryPoint = "getFile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetFile(string strSourceFilePath, string strDestinationFilePath);
[DllImport("open.dll", EntryPoint = "putFile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes PutFile(string strSourceFilePath, string strDestinationFilePath);
[DllImport("open.dll", EntryPoint = "selectFile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes SelectFile(string strSourceFilePath, string strChannelName);
[DllImport("open.dll", EntryPoint = "deleteFile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes DeleteFile(string strFilePath);
[DllImport("open.dll", EntryPoint = "deleteDirectory", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes DeleteDirectory(string strDirectoryPath);
[DllImport("open.dll", EntryPoint = "createDirectory", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes CreateDirectory(string strDirectoryPath);
[DllImport("open.dll", EntryPoint = "listDirectory", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ListDirectory(string strDirectoryPath, string strResultFilePath);
[DllImport("open.dll", EntryPoint = "getVersionInformation", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetVersionInformation(string strDestinationFilePath);
[DllImport("open.dll", EntryPoint = "getProjectInformation", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetProjectInformation(string strVcpFilePath, string strDestinationFilePath);
[DllImport("open.dll", EntryPoint = "getCurrentProjectInformation", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetCurrentProjectInformation(string strDestinationFilePath);
[DllImport("open.dll", EntryPoint = "getCurrentProjectState", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetCurrentProjectState(ref Int32 pProjectState);
[DllImport("open.dll", EntryPoint = "importProjectSettings", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ImportProjectSettings(string strFileName, string strImportContentFileName);
[DllImport("open.dll", EntryPoint = "exportProjectSettings", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes ExportProjectSettings(string strFileName);
[DllImport("open.dll", EntryPoint = "writeUnsignedInteger8BitArray", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes WriteUnsignedInteger8BitArray(UInt32 nDictionaryId, UInt32 nValueListMaxLength, byte[] pValueList);
[DllImport("open.dll", EntryPoint = "getNumberOfNCUs", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern OpenReturnCodes GetNumberOfNCUs(ref UInt32 pNumberOfNCUs);
}
}