commit fe8a3187f51e3e2d00309dacd29386185f649bbd Author: XingCheng3 <1773407212@qq.com> Date: Mon Jun 8 17:12:01 2026 +0800 init: CATL电池线SCADA首次入库 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b48f252 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.vs/ +packages/ +bin/ +obj/ +*.user +*.suo +*.cache +*.log +*.zip +*.rar +*.7z +_system~.ini diff --git a/DLL/ABB.Robotics.Controllers.PC.dll b/DLL/ABB.Robotics.Controllers.PC.dll new file mode 100644 index 0000000..0c9985d Binary files /dev/null and b/DLL/ABB.Robotics.Controllers.PC.dll differ diff --git a/DLL/BasicData.dll b/DLL/BasicData.dll new file mode 100644 index 0000000..e07cb48 Binary files /dev/null and b/DLL/BasicData.dll differ diff --git a/DLL/BouncyCastle.Crypto.dll b/DLL/BouncyCastle.Crypto.dll new file mode 100644 index 0000000..0310983 Binary files /dev/null and b/DLL/BouncyCastle.Crypto.dll differ diff --git a/DLL/BsRmlib.EDM.dll b/DLL/BsRmlib.EDM.dll new file mode 100644 index 0000000..18f8f20 Binary files /dev/null and b/DLL/BsRmlib.EDM.dll differ diff --git a/DLL/BsRmlib32.dll b/DLL/BsRmlib32.dll new file mode 100644 index 0000000..5565974 Binary files /dev/null and b/DLL/BsRmlib32.dll differ diff --git a/DLL/BsRmlib64.dll b/DLL/BsRmlib64.dll new file mode 100644 index 0000000..46b8678 Binary files /dev/null and b/DLL/BsRmlib64.dll differ diff --git a/DLL/ConLink.dll b/DLL/ConLink.dll new file mode 100644 index 0000000..fa95f29 Binary files /dev/null and b/DLL/ConLink.dll differ diff --git a/DLL/ConLink19.dll b/DLL/ConLink19.dll new file mode 100644 index 0000000..fa54a71 Binary files /dev/null and b/DLL/ConLink19.dll differ diff --git a/DLL/DataLinkMesWork.dll b/DLL/DataLinkMesWork.dll new file mode 100644 index 0000000..57fcd25 Binary files /dev/null and b/DLL/DataLinkMesWork.dll differ diff --git a/DLL/EnBaseM.dll b/DLL/EnBaseM.dll new file mode 100644 index 0000000..ebdeaa2 Binary files /dev/null and b/DLL/EnBaseM.dll differ diff --git a/DLL/Fwlib32.dll b/DLL/Fwlib32.dll new file mode 100644 index 0000000..58d10d9 Binary files /dev/null and b/DLL/Fwlib32.dll differ diff --git a/DLL/ICSharpCode.SharpZipLib.dll b/DLL/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..84e8c68 Binary files /dev/null and b/DLL/ICSharpCode.SharpZipLib.dll differ diff --git a/DLL/MQTTnet.Extensions.ManagedClient.dll b/DLL/MQTTnet.Extensions.ManagedClient.dll new file mode 100644 index 0000000..99035f6 Binary files /dev/null and b/DLL/MQTTnet.Extensions.ManagedClient.dll differ diff --git a/DLL/MQTTnet.dll b/DLL/MQTTnet.dll new file mode 100644 index 0000000..2951433 Binary files /dev/null and b/DLL/MQTTnet.dll differ diff --git a/DLL/MW_Log.dll b/DLL/MW_Log.dll new file mode 100644 index 0000000..aff08b4 Binary files /dev/null and b/DLL/MW_Log.dll differ diff --git a/DLL/MesWork.DeviceDriver.dll b/DLL/MesWork.DeviceDriver.dll new file mode 100644 index 0000000..dde55af Binary files /dev/null and b/DLL/MesWork.DeviceDriver.dll differ diff --git a/DLL/MesWork.MQTT.dll b/DLL/MesWork.MQTT.dll new file mode 100644 index 0000000..3ce73aa Binary files /dev/null and b/DLL/MesWork.MQTT.dll differ diff --git a/DLL/Microsoft.Extensions.DependencyInjection.Abstractions.dll b/DLL/Microsoft.Extensions.DependencyInjection.Abstractions.dll new file mode 100644 index 0000000..5583517 Binary files /dev/null and b/DLL/Microsoft.Extensions.DependencyInjection.Abstractions.dll differ diff --git a/DLL/Microsoft.Extensions.Logging.Abstractions.dll b/DLL/Microsoft.Extensions.Logging.Abstractions.dll new file mode 100644 index 0000000..1580585 Binary files /dev/null and b/DLL/Microsoft.Extensions.Logging.Abstractions.dll differ diff --git a/DLL/Microsoft.Extensions.Logging.dll b/DLL/Microsoft.Extensions.Logging.dll new file mode 100644 index 0000000..fc7d689 Binary files /dev/null and b/DLL/Microsoft.Extensions.Logging.dll differ diff --git a/DLL/Microsoft.Extensions.Options.dll b/DLL/Microsoft.Extensions.Options.dll new file mode 100644 index 0000000..f56ff80 Binary files /dev/null and b/DLL/Microsoft.Extensions.Options.dll differ diff --git a/DLL/Microsoft.Extensions.Primitives.dll b/DLL/Microsoft.Extensions.Primitives.dll new file mode 100644 index 0000000..d6560c9 Binary files /dev/null and b/DLL/Microsoft.Extensions.Primitives.dll differ diff --git a/DLL/Microsoft.Win32.Primitives.dll b/DLL/Microsoft.Win32.Primitives.dll new file mode 100644 index 0000000..8b69a69 Binary files /dev/null and b/DLL/Microsoft.Win32.Primitives.dll differ diff --git a/DLL/MySql.Data.dll b/DLL/MySql.Data.dll new file mode 100644 index 0000000..a95e69e Binary files /dev/null and b/DLL/MySql.Data.dll differ diff --git a/DLL/MySql.Data.xml b/DLL/MySql.Data.xml new file mode 100644 index 0000000..f35ac41 --- /dev/null +++ b/DLL/MySql.Data.xml @@ -0,0 +1,17803 @@ + + + + MySql.Data + + + + + The implementation of the caching_sha2_password authentication plugin. + + + + + Generates a byte array set with the password of the user in the expected format based on the + SSL settings of the current connection. + + A byte array that contains the password of the user in the expected format. + + + + Defines the stage of the authentication. + + + + + Defines the default behavior for an authentication plugin. + + + + + Gets or sets the authentication data returned by the server. + + + + + This is a factory method that is used only internally. It creates an auth plugin based on the method type + + + + + + + + + Gets the connection option settings. + + + + + Gets the server version associated with this authentication plugin. + + + + + Gets the encoding assigned to the native driver. + + + + + Sets the authentication data required to encode, encrypt, or convert the password of the user. + + A byte array containing the authentication data provided by the server. + This method may be overriden based on the requirements by the implementing authentication plugin. + + + + Defines the behavior when checking for constraints. + + This method is intended to be overriden. + + + + Throws a that encapsulates the original exception. + + The exception to encapsulate. + + + + Defines the behavior when authentication is successful. + + This method is intended to be overriden. + + + + Defines the behavior when more data is required from the server. + + The data returned by the server. + The data to return to the server. + This method is intended to be overriden. + + + + Gets the plugin name based on the authentication plugin type defined during the creation of this object. + + + + + Gets the user name associated to the connection settings. + + The user name associated to the connection settings. + + + + Gets the encoded, encrypted, or converted password based on the authentication plugin type defined during the creation of this object. + This method is intended to be overriden. + + An object containing the encoded, encrypted, or converted password. + + + + Provides functionality to read, decode and convert PEM files to objects supported in .NET. + + + + + Converts the binary data of a PEM file to an object. + + A binary representation of the public key provided by the server. + An object containing the data found in the public key. + + + + Allows connections to a user account set with the mysql_native_password authentication plugin. + + + + + Returns a byte array containing the proper encryption of the + given password/seed according to the new 4.1.1 authentication scheme. + + + + + + + + The implementation of the sha256_password authentication plugin. + + + + + The byte array representation of the public key provided by the server. + + + + + Applies XOR to the byte arrays provided as input. + + A byte array that contains the results of the XOR operation. + + + + + + + + + Defines the type of the security buffer. + + + + + Defines a security handle. + + + + + Describes a buffer allocated by a transport to pass to a security package. + + + + + Specifies the size, in bytes, of the buffer. + + + + + Bit flags that indicate the type of the buffer. + + + + + Pointer to a buffer. + + + + + Hold a numeric value used in defining other data types. + + + + + Least significant digits. + + + + + Most significant digits. + + + + + Holds a pointer used to define a security handle. + + + + + Least significant digits. + + + + + Most significant digits. + + + + + Indicates the sizes of important structures used in the message support functions. + + + + + Specifies the maximum size of the security token used in the authentication changes. + + + + + Specifies the maximum size of the signature created by the MakeSignature function. + This member must be zero if integrity services are not requested or available. + + + + + Specifies the preferred integral size of the messages. + + + + + Size of the security trailer to be appended to messages. + This member should be zero if the relevant services are not requested or available. + + + + + Allows importing large amounts of data into a database with bulk loading. + + + + + Gets or sets the connection. + + The connection. + + + + Gets or sets the field terminator. + + The field terminator. + + + + Gets or sets the line terminator. + + The line terminator. + + + + Gets or sets the name of the table. + + The name of the table. + + + + Gets or sets the character set. + + The character set. + + + + Gets or sets the name of the file. + + The name of the file. + + + + Gets or sets the timeout. + + The timeout. + + + + Gets or sets a value indicating whether the file name that is to be loaded + is local to the client or not. The default value is false. + + true if local; otherwise, false. + + + + Gets or sets the number of lines to skip. + + The number of lines to skip. + + + + Gets or sets the line prefix. + + The line prefix. + + + + Gets or sets the field quotation character. + + The field quotation character. + + + + Gets or sets a value indicating whether [field quotation optional]. + + + true if [field quotation optional]; otherwise, false. + + + + + Gets or sets the escape character. + + The escape character. + + + + Gets or sets the conflict option. + + The conflict option. + + + + Gets or sets the priority. + + The priority. + + + + Gets the columns. + + The columns. + + + + Gets the expressions. + + The expressions. + + + + Executes the load operation. + + The number of rows inserted. + + + + Asynchronous version of the load operation. + + The number of rows inserted. + + + + Executes the load operation asynchronously while the cancellation isn't requested. + + The cancellation token. + The number of rows inserted. + + + + Represents the priority set for bulk loading operations. + + + + + This is the default and indicates normal priority + + + + + Low priority will cause the load operation to wait until all readers of the table + have finished. This only affects storage engines that use only table-level locking + such as MyISAM, Memory, and Merge. + + + + + Concurrent priority is only relevant for MyISAM tables and signals that if the table + has no free blocks in the middle that other readers can retrieve data from the table + while the load operation is happening. + + + + + Represents the behavior when conflicts arise during bulk loading operations. + + + + + This is the default and indicates normal operation. In the event of a LOCAL load, this + is the same as ignore. When the data file is on the server, then a key conflict will + cause an error to be thrown and the rest of the data file ignored. + + + + + Replace column values when a key conflict occurs. + + + + + Ignore any rows where the primary key conflicts. + + + + + Summary description for CharSetMap. + + + + + Returns the text encoding for a given MySQL character set name + + Version of the connection requesting the encoding + Name of the character set to get the encoding for + Encoding object for the given character set name + + + + Initializes the mapping. + + + + Represents a SQL statement to execute against a MySQL database. This class cannot be inherited. + MySqlCommand features the following methods for executing commands at a MySQL database: + + + Item + Description + + + + ExecuteReader + + Executes commands that return rows. + + + + ExecuteNonQuery + + Executes commands such as SQL INSERT, DELETE, and UPDATE statements. + + + + ExecuteScalar + + Retrieves a single value (for example, an aggregate value) from a database. + + + + You can reset the CommandText property and reuse the MySqlCommand + object. However, you must close the MySqlDataReader + before you can execute a new or previous command. + + If a MySqlException is + generated by the method executing a MySqlCommand, the MySqlConnection + remains open. It is the responsibility of the programmer to close the connection. + + + Using the '@' symbol for paramters is now the preferred approach although the old pattern of using + '?' is still supported. Please be aware though that using '@' can cause conflicts when user variables + are also used. To help with this situation please see the documentation on the 'allow user variables' + connection string option. The 'old syntax' connection string option has now been deprecated. + + + The following example creates a MySqlCommand and + a MySqlConnection. The MySqlConnection is opened and set as the Connection + for the MySqlCommand. The example then calls ExecuteNonQuery, + and closes the connection. To accomplish this, the ExecuteNonQuery is + passed a connection string and a query string that is a SQL INSERT + statement. + + Public Sub InsertRow(myConnectionString As String) + " If the connection string is null, use a default. + If myConnectionString = "" Then + myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass" + End If + Dim myConnection As New MySqlConnection(myConnectionString) + Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)" + Dim myCommand As New MySqlCommand(myInsertQuery) + myCommand.Connection = myConnection + myConnection.Open() + myCommand.ExecuteNonQuery() + myCommand.Connection.Close() + End Sub + + + public void InsertRow(string myConnectionString) + { + // If the connection string is null, use a default. + if(myConnectionString == "") + { + myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; + } + MySqlConnection myConnection = new MySqlConnection(myConnectionString); + string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; + MySqlCommand myCommand = new MySqlCommand(myInsertQuery); + myCommand.Connection = myConnection; + myConnection.Open(); + myCommand.ExecuteNonQuery(); + myCommand.Connection.Close(); + } + + + + + + + Initializes a new instance of the MySqlCommand class. + + + The following example creates a MySqlCommand and sets some of its properties. + + + This example shows how to use one of the overloaded + versions of the MySqlCommand constructor. For other examples that might be available, + see the individual overload topics. + + + + Public Sub CreateMySqlCommand() + Dim myConnection As New MySqlConnection _ + ("Persist Security Info=False;database=test;server=myServer") + myConnection.Open() + Dim myTrans As MySqlTransaction = myConnection.BeginTransaction() + Dim mySelectQuery As String = "SELECT * FROM MyTable" + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection, myTrans) + myCommand.CommandTimeout = 20 + End Sub + + + public void CreateMySqlCommand() + { + MySqlConnection myConnection = new MySqlConnection("Persist Security Info=False; + database=test;server=myServer"); + myConnection.Open(); + MySqlTransaction myTrans = myConnection.BeginTransaction(); + string mySelectQuery = "SELECT * FROM myTable"; + MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection,myTrans); + myCommand.CommandTimeout = 20; + } + + + public: + void CreateMySqlCommand() + { + MySqlConnection* myConnection = new MySqlConnection(S"Persist Security Info=False; + database=test;server=myServer"); + myConnection->Open(); + MySqlTransaction* myTrans = myConnection->BeginTransaction(); + String* mySelectQuery = S"SELECT * FROM myTable"; + MySqlCommand* myCommand = new MySqlCommand(mySelectQuery, myConnection, myTrans); + myCommand->CommandTimeout = 20; + }; + + + + Initializes a new instance of the MySqlCommand class. + + The base constructor initializes all fields to their default values. The + following table shows initial property values for an instance of . + + + Properties + Initial Value + + + + + + empty string ("") + + + + + + 0 + + + + + + CommandType.Text + + + + + + Null + + + + You can change the value for any of these properties through a separate call to + the property. + + + The following example creates a and + sets some of its properties. + + + Public Sub CreateMySqlCommand() + Dim myCommand As New MySqlCommand() + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + MySqlCommand myCommand = new MySqlCommand(); + myCommand.CommandType = CommandType.Text; + } + + + + + + Initializes a new instance of the class with the text of the query. + The text of the query. + When an instance of is created, + the following read/write properties are set to initial values. + + + + Properties + Initial Value + + + + + + + cmdText + + + + + + + 0 + + + + + + CommandType.Text + + + + + + Null + + + + You can change the value for any of these properties through a separate call to + the property. + + + The following example creates a and + sets some of its properties. + + + Public Sub CreateMySqlCommand() + Dim sql as String = "SELECT * FROM mytable" + Dim myCommand As New MySqlCommand(sql) + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + string sql = "SELECT * FROM mytable"; + MySqlCommand myCommand = new MySqlCommand(sql); + myCommand.CommandType = CommandType.Text; + } + + + + + + Initializes a new instance of the class + with the text of the query and a . + The text of the query. + A that represents the + connection to an instance of SQL Server. + + When an instance of is created, + the following read/write properties are set to initial values. + + + + Properties + Initial Value + + + + + + + cmdText + + + + + + + 0 + + + + + + CommandType.Text + + + + + + + connection + + + + + You can change the value for any of these properties through a separate call to + the property. + + + The following example creates a and + sets some of its properties. + + + Public Sub CreateMySqlCommand() + Dim conn as new MySqlConnection("server=myServer") + Dim sql as String = "SELECT * FROM mytable" + Dim myCommand As New MySqlCommand(sql, conn) + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + MySqlConnection conn = new MySqlConnection("server=myserver") + string sql = "SELECT * FROM mytable"; + MySqlCommand myCommand = new MySqlCommand(sql, conn); + myCommand.CommandType = CommandType.Text; + } + + + + + + Initializes a new instance of the class + with the text of the query, a , and the + . + The text of the query. + A that represents the + connection to an instance of SQL Server. + + The in which the executes. + + When an instance of is created, + the following read/write properties are set to initial values. + + + + Properties + Initial Value + + + + + + + cmdText + + + + + + + 0 + + + + + + CommandType.Text + + + + + + + connection + + + + + You can change the value for any of these properties through a separate call to + the property. + + + The following example creates a and + sets some of its properties. + + + Public Sub CreateMySqlCommand() + Dim conn as new MySqlConnection("server=myServer") + conn.Open(); + Dim txn as MySqlTransaction = conn.BeginTransaction() + Dim sql as String = "SELECT * FROM mytable" + Dim myCommand As New MySqlCommand(sql, conn, txn) + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + MySqlConnection conn = new MySqlConnection("server=myserver") + conn.Open(); + MySqlTransaction txn = conn.BeginTransaction(); + string sql = "SELECT * FROM mytable"; + MySqlCommand myCommand = new MySqlCommand(sql, conn, txn); + myCommand.CommandType = CommandType.Text; + } + + + + + + Gets the last inserted id. + + + + + + Gets or sets the SQL statement to execute at the data source. + + The SQL statement or stored procedure to execute. The default is an empty string. + + + When the property is set to StoredProcedure, + the CommandText property should be set to the name of the stored procedure. + The user may be required to use escape character syntax if the stored procedure name + contains any special characters. The command executes this stored procedure when + you call one of the Execute methods. Starting with Connector/NET 5.0, having both a stored function + and stored procedure with the same name in the same database is not supported. It is + suggested that you provide unqiue names for your stored routines. + + + The following example creates a and sets some of its properties. + + Public Sub CreateMySqlCommand() + Dim myCommand As New MySqlCommand() + myCommand.CommandText = "SELECT * FROM Mytable ORDER BY id" + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + MySqlCommand myCommand = new MySqlCommand(); + myCommand.CommandText = "SELECT * FROM mytable ORDER BY id"; + myCommand.CommandType = CommandType.Text; + } + + + + + + Gets or sets the wait time before terminating the attempt to execute a command + and generating an error. + + The time (in seconds) to wait for the command to execute. The default is 30 + seconds. + + CommandTimeout is dependent on the ability of MySQL to cancel an executing query. + Because of this, CommandTimeout is only supported when connected to MySQL + version 5.0.0 or higher. + + + + + Gets or sets a value indicating how the property is to be interpreted. + + One of the values. The default is Text. + + + When you set the CommandType property to StoredProcedure, you + should set the property to the name of the stored + procedure. The command executes this stored procedure when you call one of the + Execute methods. + + + The following example creates a and sets some of its properties. + + Public Sub CreateMySqlCommand() + Dim myCommand As New MySqlCommand() + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + MySqlCommand myCommand = new MySqlCommand(); + myCommand.CommandType = CommandType.Text; + } + + + + + + Gets a boolean value that indicates whether the Prepared method has been called. + + + + + + Gets or sets the used by this instance of the + . + + The connection to a data source. The default value is a null reference + (Nothing in Visual Basic). + + + If you set Connection while a transaction is in progress and the + property is not null, an + is generated. If the Transaction property is not null and the transaction + has already been committed or rolled back, Transaction is set to + null. + + + The following example creates a and sets some of its properties. + + Public Sub CreateMySqlCommand() + Dim mySelectQuery As String = "SELECT * FROM mytable ORDER BY id" + Dim myConnectString As String = "Persist Security Info=False;database=test;server=myServer" + Dim myCommand As New MySqlCommand(mySelectQuery) + myCommand.Connection = New MySqlConnection(myConnectString) + myCommand.CommandType = CommandType.Text + End Sub + + + public void CreateMySqlCommand() + { + string mySelectQuery = "SELECT * FROM mytable ORDER BY id"; + string myConnectString = "Persist Security Info=False;database=test;server=myServer"; + MySqlCommand myCommand = new MySqlCommand(mySelectQuery); + myCommand.Connection = new MySqlConnection(myConnectString); + myCommand.CommandType = CommandType.Text; + } + + + + + + Get the + + The parameters of the SQL statement or stored procedure. The default is + an empty collection. + + Connector/NET does not support unnamed parameters. Every parameter added to the collection must + have an associated name. + + The following example creates a and displays its parameters. + To accomplish this, the method is passed a , a query string + that is a SQL SELECT statement, and an array of objects. + + Public Sub CreateMySqlCommand(myConnection As MySqlConnection, _ + mySelectQuery As String, myParamArray() As MySqlParameter) + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) + myCommand.CommandText = "SELECT id, name FROM mytable WHERE age=@age" + myCommand.UpdatedRowSource = UpdateRowSource.Both + myCommand.Parameters.Add(myParamArray) + Dim j As Integer + For j = 0 To myCommand.Parameters.Count - 1 + myCommand.Parameters.Add(myParamArray(j)) + Next j + Dim myMessage As String = "" + Dim i As Integer + For i = 0 To myCommand.Parameters.Count - 1 + myMessage += myCommand.Parameters(i).ToString() & ControlChars.Cr + Next i + Console.WriteLine(myMessage) + End Sub + + + public void CreateMySqlCommand(MySqlConnection myConnection, string mySelectQuery, + MySqlParameter[] myParamArray) + { + MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection); + myCommand.CommandText = "SELECT id, name FROM mytable WHERE age=@age"; + myCommand.Parameters.Add(myParamArray); + for (int j=0; j<myParamArray.Length; j++) + { + myCommand.Parameters.Add(myParamArray[j]) ; + } + string myMessage = ""; + for (int i = 0; i < myCommand.Parameters.Count; i++) + { + myMessage += myCommand.Parameters[i].ToString() + "\n"; + } + MessageBox.Show(myMessage); + } + + + + + + Gets or sets the within which the executes. + + The . The default value is a null reference (Nothing in Visual Basic). + + You cannot set the Transaction property if it is already set to a + specific value, and the command is in the process of executing. If you set the + transaction property to a object that is not connected + to the same as the object, + an exception will be thrown the next time you attempt to execute a statement. + + + + + Gets or sets a boolean value that indicates whether caching is enabled. + + + + + Gets or sets the seconds for how long a TableDirect result should be cached. + + + + + Gets or sets how command results are applied to the DataRow when used by the + Update method of the DbDataAdapter. + + + + + Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control. + + + + + Attempts to cancel the execution of a currently active command + + + Cancelling a currently active query only works with MySQL versions 5.0.0 and higher. + + + + + Creates a new instance of a object. + + + This method is a strongly-typed version of . + + A object. + + + + + Check the connection to make sure + - it is open + - it is not currently being used by a reader + - and we have the right version of MySQL for the requested command type + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + Number of rows affected + You can use ExecuteNonQuery to perform any type of database operation, + however any resultsets returned will not be available. Any output parameters + used in calling a stored procedure will be populated with data and can be + retrieved after execution is complete. + For UPDATE, INSERT, and DELETE statements, the return value is the number + of rows affected by the command. For all other types of statements, the return + value is -1. + + The following example creates a MySqlCommand and then + executes it using ExecuteNonQuery. The example is passed a string that is a + SQL statement (such as UPDATE, INSERT, or DELETE) and a string to use to + connect to the data source. + + Public Sub CreateMySqlCommand(myExecuteQuery As String, myConnection As MySqlConnection) + Dim myCommand As New MySqlCommand(myExecuteQuery, myConnection) + myCommand.Connection.Open() + myCommand.ExecuteNonQuery() + myConnection.Close() + End Sub + + + public void CreateMySqlCommand(string myExecuteQuery, MySqlConnection myConnection) + { + MySqlCommand myCommand = new MySqlCommand(myExecuteQuery, myConnection); + myCommand.Connection.Open(); + myCommand.ExecuteNonQuery(); + myConnection.Close(); + } + + + + + + Reset reader to null, to avoid "There is already an open data reader" + on the next ExecuteReader(). Used in error handling scenarios. + + + + + Reset SQL_SELECT_LIMIT that could have been modified by CommandBehavior. + + + + + Sends the to the Connection + and builds a . + + A object. + + + When the property is set to StoredProcedure, + the property should be set to the name of the stored + procedure. The command executes this stored procedure when you call + ExecuteReader. + + + While the is in use, the associated + is busy serving the MySqlDataReader. + While in this state, no other operations can be performed on the + MySqlConnection other than closing it. This is the case until the + method of the MySqlDataReader is called. + + + The following example creates a , then executes it by + passing a string that is a SQL SELECT statement, and a string to use to connect to the + data source. + + Public Sub CreateMySqlDataReader(mySelectQuery As String, myConnection As MySqlConnection) + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) + myConnection.Open() + Dim myReader As MySqlDataReader + myReader = myCommand.ExecuteReader() + Try + While myReader.Read() + Console.WriteLine(myReader.GetString(0)) + End While + Finally + myReader.Close + myConnection.Close + End Try + End Sub + + + public void CreateMySqlDataReader(string mySelectQuery, MySqlConnection myConnection) + { + MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection); + myConnection.Open(); + MMySqlDataReader myReader; + myReader = myCommand.ExecuteReader(); + try + { + while(myReader.Read()) + { + Console.WriteLine(myReader.GetString(0)); + } + } + finally + { + myReader.Close(); + myConnection.Close(); + } + } + + + + + + Sends the to the Connection, + and builds a using one of the values. + + One of the values. + + + When the property is set to StoredProcedure, + the property should be set to the name of the stored + procedure. The command executes this stored procedure when you call + ExecuteReader. + + + The supports a special mode that enables large binary + values to be read efficiently. For more information, see the SequentialAccess + setting for . + + + While the is in use, the associated + is busy serving the MySqlDataReader. + While in this state, no other operations can be performed on the + MySqlConnection other than closing it. This is the case until the + method of the MySqlDataReader is called. + If the MySqlDataReader is created with CommandBehavior set to + CloseConnection, closing the MySqlDataReader closes the connection + automatically. + + + When calling ExecuteReader with the SingleRow behavior, you should be aware that using a limit + clause in your SQL will cause all rows (up to the limit given) to be retrieved by the client. The + method will still return false after the first row but pulling all rows of data + into the client will have a performance impact. If the limit clause is not necessary, it should + be avoided. + + + A object. + + + + + Executes the query, and returns the first column of the first row in the + result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, or a null reference if the + result set is empty + + + Use the ExecuteScalar method to retrieve a single value (for example, + an aggregate value) from a database. This requires less code than using the + method, and then performing the operations necessary + to generate the single value using the data returned by a + + + The following example creates a and then + executes it using ExecuteScalar. The example is passed a string that is a + SQL statement that returns an aggregate result, and a string to use to + connect to the data source. + + + Public Sub CreateMySqlCommand(myScalarQuery As String, myConnection As MySqlConnection) + Dim myCommand As New MySqlCommand(myScalarQuery, myConnection) + myCommand.Connection.Open() + myCommand.ExecuteScalar() + myConnection.Close() + End Sub + + + public void CreateMySqlCommand(string myScalarQuery, MySqlConnection myConnection) + { + MySqlCommand myCommand = new MySqlCommand(myScalarQuery, myConnection); + myCommand.Connection.Open(); + myCommand.ExecuteScalar(); + myConnection.Close(); + } + + + public: + void CreateMySqlCommand(String* myScalarQuery, MySqlConnection* myConnection) + { + MySqlCommand* myCommand = new MySqlCommand(myScalarQuery, myConnection); + myCommand->Connection->Open(); + myCommand->ExecuteScalar(); + myConnection->Close(); + } + + + + + + + + + + Creates a prepared version of the command on an instance of MySQL Server. + + + Prepared statements are only supported on MySQL version 4.1 and higher. Calling + prepare while connected to earlier versions of MySQL will succeed but will execute + the statement in the same way as unprepared. + + + The following example demonstrates the use of the Prepare method. + + public sub PrepareExample() + Dim cmd as New MySqlCommand("INSERT INTO mytable VALUES (@val)", myConnection) + cmd.Parameters.Add( "@val", 10 ) + cmd.Prepare() + cmd.ExecuteNonQuery() + + cmd.Parameters(0).Value = 20 + cmd.ExecuteNonQuery() + end sub + + + private void PrepareExample() + { + MySqlCommand cmd = new MySqlCommand("INSERT INTO mytable VALUES (@val)", myConnection); + cmd.Parameters.Add( "@val", 10 ); + cmd.Prepare(); + cmd.ExecuteNonQuery(); + + cmd.Parameters[0].Value = 20; + cmd.ExecuteNonQuery(); + } + + + + + + Initiates the asynchronous execution of the SQL statement or stored procedure + that is described by this , and retrieves one or more + result sets from the server. + + An that can be used to poll, wait for results, + or both; this value is also needed when invoking EndExecuteReader, + which returns a instance that can be used to retrieve + the returned rows. + + + + Initiates the asynchronous execution of the SQL statement or stored procedure + that is described by this using one of the + CommandBehavior values. + + One of the values, indicating + options for statement execution and data retrieval. + An that can be used to poll, wait for results, + or both; this value is also needed when invoking EndExecuteReader, + which returns a instance that can be used to retrieve + the returned rows. + + + + Finishes asynchronous execution of a SQL statement, returning the requested + . + + The returned by the call to + . + A MySqlDataReader object that can be used to retrieve the requested rows. + + + + Initiates the asynchronous execution of the SQL statement or stored procedure + that is described by this . + + + An delegate that is invoked when the command's + execution has completed. Pass a null reference (Nothing in Visual Basic) + to indicate that no callback is required. + A user-defined state object that is passed to the + callback procedure. Retrieve this object from within the callback procedure + using the property. + An that can be used to poll or wait for results, + or both; this value is also needed when invoking , + which returns the number of affected rows. + + + + Initiates the asynchronous execution of the SQL statement or stored procedure + that is described by this . + + An that can be used to poll or wait for results, + or both; this value is also needed when invoking , + which returns the number of affected rows. + + + + Finishes asynchronous execution of a SQL statement. + + The returned by the call + to . + + + + + Verifies if a query is valid even if it has not spaces or is a stored procedure call + + Query to validate + If it is necessary to add call statement + + + + Creates a clone of this object. CommandText, Connection, and Transaction properties + are included as well as the entire parameter list. + + The cloned object. + + + + Summary description for API. + + + + + Summary description for CompressedStream. + + + + + Represents an open connection to a MySQL Server database. This class cannot be inherited. + + + A MySqlConnection object represents a session to a MySQL Server + data source. When you create an instance of MySqlConnection, all + properties are set to their initial values. For a list of these values, see the + MySqlConnection constructor. + + + + If the MySqlConnection goes out of scope, it is not closed. Therefore, + you must explicitly close the connection by calling + or . + + + The following example creates a and + a MySqlConnection. The MySqlConnection is opened and set as the + for the MySqlCommand. The example then calls + , and closes the connection. To accomplish this, the ExecuteNonQuery is + passed a connection string and a query string that is a SQL INSERT + statement. + + + Public Sub InsertRow(myConnectionString As String) + ' If the connection string is null, use a default. + If myConnectionString = "" Then + myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass" + End If + Dim myConnection As New MySqlConnection(myConnectionString) + Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)" + Dim myCommand As New MySqlCommand(myInsertQuery) + myCommand.Connection = myConnection + myConnection.Open() + myCommand.ExecuteNonQuery() + myCommand.Connection.Close() + End Sub + + + + + public void InsertRow(string myConnectionString) + { + // If the connection string is null, use a default. + if(myConnectionString == "") + { + myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; + } + MySqlConnection myConnection = new MySqlConnection(myConnectionString); + string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; + MySqlCommand myCommand = new MySqlCommand(myInsertQuery); + myCommand.Connection = myConnection; + myConnection.Open(); + myCommand.ExecuteNonQuery(); + myCommand.Connection.Close(); + } + + + + + + + The client used to handle SSH connections. + + + + Occurs when MySQL returns warnings as a result of executing a command or query. + + + + + Initializes a new instance of the class. + + When a new instance of is created, the read/write + properties are set to the following initial values unless they are specifically + set using their associated keywords in the property. + + + + Properties + Initial Value + + + + + + empty string ("") + + + + + + 15 + + + + + + empty string ("") + + + + + + empty string ("") + + + + + + empty string ("") + + + + You can change the value for these properties only by using the ConnectionString property. + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class when given a string containing the connection string. + + When a new instance of is created, the read/write + properties are set to the following initial values unless they are specifically + set using their associated keywords in the property. + + + + Properties + Initial Value + + + + + + empty string ("") + + + + + + 15 + + + + + + empty string ("") + + + + + + empty string ("") + + + + + + empty string ("") + + + + You can change the value for these properties only by using the ConnectionString property. + + The connection properties used to open the MySQL database. + + + + Determines whether the connection is a clone of other connection. + + + + + Returns the id of the server thread this connection is executing on + + + + + Gets the name of the MySQL server to which to connect. + + + + + Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error. + The value set is less than 0. + A value of 0 indicates no limit, and should be avoided in a + because an attempt to connect + will wait indefinitely. + + The following example creates a MySqlConnection + and sets some of its properties in the connection string. + + Public Sub CreateSqlConnection() + Dim myConnection As New MySqlConnection() + myConnection.ConnectionString = "Persist Security Info=False;Username=user;Password=pass;database=test1;server=localhost;Connect Timeout=30" + myConnection.Open() + End Sub + + + public void CreateSqlConnection() + { + MySqlConnection myConnection = new MySqlConnection(); + myConnection.ConnectionString = "Persist Security Info=False;Username=user;Password=pass;database=test1;server=localhost;Connect Timeout=30"; + myConnection.Open(); + } + + + + + Gets the name of the current database or the database to be used after a connection is opened.The name of the current database or the name of the database to be used after a connection is opened. The default value is an empty string. + + The Database property does not update dynamically. + If you change the current database using a SQL statement, then this property + may reflect the wrong value. If you change the current database using the + method, this property is updated to reflect the new database. + + + The following example creates a and displays + some of its read-only properties. + + + Public Sub CreateMySqlConnection() + Dim myConnString As String = _ + "Persist Security Info=False;database=test;server=localhost;user id=joeuser;pwd=pass" + Dim myConnection As New MySqlConnection( myConnString ) + myConnection.Open() + MessageBox.Show( "Server Version: " + myConnection.ServerVersion _ + + ControlChars.NewLine + "Database: " + myConnection.Database ) + myConnection.ChangeDatabase( "test2" ) + MessageBox.Show( "ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.NewLine + "Database: " + myConnection.Database ) + myConnection.Close() + End Sub + + + + public void CreateMySqlConnection() + { + string myConnString = + "Persist Security Info=False;database=test;server=localhost;user id=joeuser;pwd=pass"; + MySqlConnection myConnection = new MySqlConnection( myConnString ); + myConnection.Open(); + MessageBox.Show( "Server Version: " + myConnection.ServerVersion + + "\nDatabase: " + myConnection.Database ); + myConnection.ChangeDatabase( "test2" ); + MessageBox.Show( "ServerVersion: " + myConnection.ServerVersion + + "\nDatabase: " + myConnection.Database ); + myConnection.Close(); + } + + + + + + Indicates if this connection should use compression when communicating with the server. + + + + Gets the current state of the connection. + A bitwise combination of the values. The default is Closed. + + The allowed state changes are: + + + From Closed to Open, using the Open method of the connection object. + + + From Open to Closed, using either the Close method or the Dispose method of the connection object. + + + + The following example creates a , opens it, + displays some of its properties, then closes the connection. + + + Public Sub CreateMySqlConnection(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.Cr + "State: " + myConnection.State.ToString()) + myConnection.Close() + End Sub + + + public void CreateMySqlConnection(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion + + "\nState: " + myConnection.State.ToString()); + myConnection.Close(); + } + + + + + Gets a string containing the version of the MySQL server to which the client is connected.The version of the instance of MySQL.The connection is closed. + The following example creates a , opens it, + displays some of its properties, then closes the connection. + + + Public Sub CreateMySqlConnection(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.Cr + "State: " + myConnection.State.ToString()) + myConnection.Close() + End Sub + + + public void CreateMySqlConnection(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion + + "\nState: " + myConnection.State.ToString()); + myConnection.Close(); + } + + + + + + Gets or sets the string used to connect to a MySQL Server database. + + + The ConnectionString returned may not be exactly like what was originally + set but will be indentical in terms of keyword/value pairs. Security information + will not be included unless the Persist Security Info value is set to true. + + + You can use the ConnectionString property to connect to a database. + The following example illustrates a typical connection string. + + "Persist Security Info=False;database=MyDB;server=MySqlServer;user id=myUser;Password=myPass" + + The ConnectionString property can be set only when the connection is + closed. Many of the connection string values have corresponding read-only + properties. When the connection string is set, all of these properties are + updated, except when an error is detected. In this case, none of the properties + are updated. properties return only those settings contained in the + ConnectionString. + + + To connect to a local machine, specify "localhost" for the server. If you do not + specify a server, localhost is assumed. + + + Resetting the ConnectionString on a closed connection resets all + connection string values (and related properties) including the password. For + example, if you set a connection string that includes "Database= MyDb", and + then reset the connection string to "Data Source=myserver;User Id=myUser;Password=myPass", + the property is no longer set to MyDb. + + + The connection string is parsed immediately after being set. If errors in + syntax are found when parsing, a runtime exception, such as , + is generated. Other errors can be found only when an attempt is made to open the + connection. + + + The basic format of a connection string consists of a series of keyword/value + pairs separated by semicolons. The equal sign (=) connects each keyword and its + value. To include values that contain a semicolon, single-quote character, or + double-quote character, the value must be enclosed in double quotes. If the + value contains both a semicolon and a double-quote character, the value can be + enclosed in single quotes. The single quote is also useful if the value begins + with a double-quote character. Conversely, the double quote can be used if the + value begins with a single quote. If the value contains both single-quote and + double-quote characters, the quote character used to enclose the value must be + doubled each time it occurs within the value. + + + To include preceding or trailing spaces in the string value, the value must + be enclosed in either single quotes or double quotes. Any leading or trailing + spaces around integer, Boolean, or enumerated values are ignored, even if + enclosed in quotes. However, spaces within a string literal keyword or value are + preserved. Using .NET Framework version 1.1, single or double quotes may be used + within a connection string without using delimiters (for example, Data Source= + my'Server or Data Source= my"Server), unless a quote character is the first or + last character in the value. + + + To include an equal sign (=) in a keyword or value, it must be preceded by + another equal sign. For example, in the hypothetical connection string + + "key==word=value" + + the keyword is "key=word" and the value is "value". + + If a specific keyword in a keyword= value pair occurs multiple times in a + connection string, the last occurrence listed is used in the value set. + + Keywords are not case sensitive. + + The following table lists the valid names for keyword values within the + ConnectionString. + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefaultDescription
+ Connect Timeout -or- Connection Timeout + 15 + The length of time (in seconds) to wait for a connection to the server before + terminating the attempt and generating an error. +
+ Host -or- Server -or- Data Source -or- + DataSource -or- Address -or- Addr -or- + Network Address + localhost + + The name or network address of the instance of MySQL to which to connect. Multiple hosts can be + specified separated by &. This can be useful where multiple MySQL servers are configured for replication + and you are not concerned about the precise server you are connecting to. No attempt is made by the provider to + synchronize writes to the database so care should be taken when using this option. + + + In Unix environment with Mono, this can be a fully qualified path to MySQL socket filename. With this configuration, the Unix socket will be used instead of TCP/IP socket. + Currently only a single socket name can be given so accessing MySQL in a replicated environment using Unix sockets is not currently supported. + +
Port3306 + The port MySQL is using to listen for connections. This value is ignored if the connection protocol + is anything but socket. +
Protocolsocket + Specifies the type of connection to make to the server.Values can be: + socket or tcp for a socket connection
+ pipe for a named pipe connection
+ unix for a Unix socket connection
+ memory to use MySQL shared memory +
+ CharSet -or Character Set + + + Specifies the character set that should be used to encode all queries sent to the server. + Resultsets are still returned in the character set of the data returned. +
LoggingfalseWhen true, various pieces of information is output to any configured TraceListeners.
Allow Batchtrue + When true, multiple SQL statements can be sent with one command execution.

+ -Note-
+ Starting with MySQL 4.1.1, batch statements should be separated by the server-defined seperator character.
+ Commands sent to earlier versions of MySQL should be seperated with ';'. +
Encryptfalse + When true, SSL/TLS encryption is used for all data sent between the + client and server if the server has a certificate installed. Recognized values + are true, false, yes, and no. +
+ Initial Catalog -or- Database + mysqlThe name of the database to use intially
+ Password -or- pwd + + The password for the MySQL account being used.
Persist Security Infofalse + When set to false or no (strongly recommended), security-sensitive + information, such as the password, is not returned as part of the connection if + the connection is open or has ever been in an open state. Resetting the + connection string resets all connection string values including the password. + Recognized values are true, false, yes, and no. +
+ User Id -or- Username -or- Uid -or- User name + + The MySQL login account being used.
Shared Memory NameMYSQLThe name of the shared memory object to use for communication if the connection protocol is set to memory.
Allow Zero Datetimefalse + True to have MySqlDataReader.GetValue() return a MySqlDateTime for date or datetime columns that have illegal values. + False will cause a DateTime object to be returned for legal values and an exception will be thrown for illegal values. +
Convert Zero Datetimefalse + True to have MySqlDataReader.GetValue() and MySqlDataReader.GetDateTime() + return DateTime.MinValue for date or datetime columns that have illegal values. +
+ Pipe Name -or- Pipe + mysql + When set to the name of a named pipe, the MySqlConnection will attempt to connect to MySQL + on that named pipe.

This settings only applies to the Windows platform. +
+ Use Performance Monitor -or- UsePerformanceMonitor + false + Posts performance data that can be tracked using perfmon +
+ Procedure Cache Size + 25 + How many stored procedure definitions can be held in the cache +
+ Ignore Prepare + true + Instructs the provider to ignore any attempts to prepare commands. This option + was added to allow a user to disable prepared statements in an entire application + without modifying the code. A user might want to do this if errors or bugs are + encountered with MySQL prepared statements. +
Use Procedure Bodiestrue + Instructs the provider to attempt to call the procedure without first resolving the metadata. This + is useful in situations where the calling user does not have access to the mysql.proc table. To + use this mode, the parameters for the procedure must be added to the command in the same order + as they appear in the procedure definition and their types must be explicitly set. +
Auto Enlisttrue + Indicates whether the connection should automatically enlist in the current transaction, + if there is one. +
Respect Binary Flagstrue + Indicates whether the connection should respect all binary flags sent to the client + as part of column metadata. False will cause the connector to behave like + Connector/NET 5.0 and earlier. +
BlobAsUTF8IncludePatternnull + Pattern that should be used to indicate which blob columns should be treated as UTF-8. +
BlobAsUTF8ExcludePatternnull + Pattern that should be used to indicate which blob columns should not be treated as UTF-8. +
Default Command Timeout30 + The default timeout that new MySqlCommand objects will use unless changed. +
Allow User Variablesfalse + Should the provider expect user variables in the SQL. +
Interactive -or- Interactive Sessionfalse + Should this session be considered interactive? +
Functions Return Stringfalse + Set this option to true to force the return value of SQL functions to be string. +
Use Affected Rowsfalse + Set this option to true to cause the affected rows reported to reflect only the + rows that are actually changed. By default, the number of rows that are matched + is returned. +
+
+ + The following table lists the valid names for connection pooling values within + the ConnectionString. For more information about connection pooling, see + Connection Pooling for the MySql Data Provider. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefaultDescription
Connection Lifetime0 + When a connection is returned to the pool, its creation time is compared with + the current time, and the connection is destroyed if that time span (in seconds) + exceeds the value specified by Connection Lifetime. This is useful in + clustered configurations to force load balancing between a running server and a + server just brought online. + + A value of zero (0) causes pooled connections to have the maximum connection + timeout. + +
Max Pool Size100The maximum number of connections allowed in the pool.
Min Pool Size0The minimum number of connections allowed in the pool.
Poolingtrue + When true, the MySqlConnection object is drawn from the appropriate + pool, or if necessary, is created and added to the appropriate pool. Recognized + values are true, false, yes, and no. +
Connection Resetfalse + Specifies whether the database connection should be reset when being + drawn from the pool. Leaving this as false will yeild much faster + connection opens but the user should understand the side effects + of doing this such as temporary tables and user variables from the previous + session not being cleared out. +
Cache Server Propertiesfalse + Specifies whether the server variables are cached between pooled connections. + On systems where the variables change infrequently and there are lots of + connection attempts, this can speed up things dramatically. +
+
+ + When setting keyword or connection pooling values that require a Boolean + value, you can use 'yes' instead of 'true', and 'no' instead of 'false'. + + + Note The MySql Data Provider uses the native socket protocol to + communicate with MySQL. Therefore, it does not support the use of an ODBC data source name (DSN) when + connecting to MySQL because it does not add an ODBC layer. + + + CAUTION In this release, the application should use caution when constructing a + connection string based on user input (for example when retrieving user ID and password information from a + dialog box, and appending it to the connection string). The application should + ensure that a user cannot embed extra connection string parameters in these + values (for example, entering a password as "validpassword;database=somedb" in + an attempt to attach to a different database). + +
+ The following example creates a and sets some of its properties + + Public Sub CreateConnection() + Dim myConnection As New MySqlConnection() + myConnection.ConnectionString = "Persist Security Info=False;database=myDB;server=myHost;Connect Timeout=30;user id=myUser; pwd=myPass" + myConnection.Open() + End Sub 'CreateConnection + + + public void CreateConnection() + { + MySqlConnection myConnection = new MySqlConnection(); + myConnection.ConnectionString = "Persist Security Info=False;database=myDB;server=myHost;Connect Timeout=30;user id=myUser; pwd=myPass"; + myConnection.Open(); + } + + + The following example creates a in Unix environment with Mono installed. MySQL socket filename used in this example is "/var/lib/mysql/mysql.sock". The actual filename depends on your MySQL configuration. + + Public Sub CreateConnection() + Dim myConnection As New MySqlConnection() + myConnection.ConnectionString = "database=myDB;server=/var/lib/mysql/mysql.sock;user id=myUser; pwd=myPass" + myConnection.Open() + End Sub 'CreateConnection + + + public void CreateConnection() + { + MySqlConnection myConnection = new MySqlConnection(); + myConnection.ConnectionString = "database=myDB;server=/var/lib/mysql/mysql.sock;user id=myUser; pwd=myPass"; + myConnection.Open(); + } + + +
+ + + Gets a boolean value that indicates whether the password associated to the connection is expired. + + + + Begins a database transaction.An object representing the new transaction.Parallel transactions are not supported. + This command is equivalent to the MySQL BEGIN TRANSACTION command. + + You must explicitly commit or roll back the transaction using the or + method. + + If you do not specify an isolation level, the default isolation level is used. To specify an isolation + level with the method, use the overload that takes the iso parameter. Also + note that any attempt to begin a transaction while a transaction is in progress will throw an exception on MySQL 4.1 and higher. + On MySQL 4.0, an exception will not be thrown because servers 4.0 and earlier did not report their transacation status. + + + + The following example creates a and a + . It also demonstrates how to use the BeginTransaction, a + , and methods. + + Public Sub RunTransaction(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + + Dim myCommand As MySqlCommand = myConnection.CreateCommand() + Dim myTrans As MySqlTransaction + + ' Start a local transaction + myTrans = myConnection.BeginTransaction() + ' Must assign both transaction object and connection + ' to Command object for a pending local transaction + myCommand.Connection = myConnection + myCommand.Transaction = myTrans + + Try + myCommand.CommandText = "Insert into Test (id, desc) VALUES (100, 'Description')" + myCommand.ExecuteNonQuery() + myCommand.CommandText = "Insert into Test (id, desc) VALUES (101, 'Description')" + myCommand.ExecuteNonQuery() + myTrans.Commit() + Console.WriteLine("Both records are written to database.") + Catch e As Exception + Try + myTrans.Rollback() + Catch ex As MySqlException + If Not myTrans.Connection Is Nothing Then + Console.WriteLine("An exception of type " + ex.GetType().ToString() + _ + " was encountered while attempting to roll back the transaction.") + End If + End Try + + Console.WriteLine("An exception of type " + e.GetType().ToString() + _ + "was encountered while inserting the data.") + Console.WriteLine("Neither record was written to database.") + Finally + myConnection.Close() + End Try + End Sub + + + public void RunTransaction(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + + MySqlCommand myCommand = myConnection.CreateCommand(); + MySqlTransaction myTrans; + + // Start a local transaction + myTrans = myConnection.BeginTransaction(); + // Must assign both transaction object and connection + // to Command object for a pending local transaction + myCommand.Connection = myConnection; + myCommand.Transaction = myTrans; + + try + { + myCommand.CommandText = "insert into Test (id, desc) VALUES (100, 'Description')"; + myCommand.ExecuteNonQuery(); + myCommand.CommandText = "insert into Test (id, desc) VALUES (101, 'Description')"; + myCommand.ExecuteNonQuery(); + myTrans.Commit(); + Console.WriteLine("Both records are written to database."); + } + catch(Exception e) + { + try + { + myTrans.Rollback(); + } + catch (SqlException ex) + { + if (myTrans.Connection != null) + { + Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to roll back the transaction."); + } + } + + Console.WriteLine("An exception of type " + e.GetType() + + " was encountered while inserting the data."); + Console.WriteLine("Neither record was written to database."); + } + finally + { + myConnection.Close(); + } + } + + + + + Begins a database transaction with the specified isolation level.The isolation level under which the transaction should run. An object representing the new transaction.Parallel exceptions are not supported. + This command is equivalent to the MySQL BEGIN TRANSACTION command. + + You must explicitly commit or roll back the transaction using the or + method. + + If you do not specify an isolation level, the default isolation level is used. To specify an isolation + level with the method, use the overload that takes the iso parameter. + Also note that any attempt to begin a transaction while a transaction is in progress will throw an exception on MySQL 4.1 and higher. + On MySQL 4.0, an exception will not be thrown because servers 4.0 and earlier did not report their transacation status. + + + + The following example creates a and a + . It also demonstrates how to use the BeginTransaction, a + , and methods. + + Public Sub RunTransaction(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + + Dim myCommand As MySqlCommand = myConnection.CreateCommand() + Dim myTrans As MySqlTransaction + + ' Start a local transaction + myTrans = myConnection.BeginTransaction() + ' Must assign both transaction object and connection + ' to Command object for a pending local transaction + myCommand.Connection = myConnection + myCommand.Transaction = myTrans + + Try + myCommand.CommandText = "Insert into Test (id, desc) VALUES (100, 'Description')" + myCommand.ExecuteNonQuery() + myCommand.CommandText = "Insert into Test (id, desc) VALUES (101, 'Description')" + myCommand.ExecuteNonQuery() + myTrans.Commit() + Console.WriteLine("Both records are written to database.") + Catch e As Exception + Try + myTrans.Rollback() + Catch ex As MySqlException + If Not myTrans.Connection Is Nothing Then + Console.WriteLine("An exception of type " + ex.GetType().ToString() + _ + " was encountered while attempting to roll back the transaction.") + End If + End Try + + Console.WriteLine("An exception of type " + e.GetType().ToString() + _ + "was encountered while inserting the data.") + Console.WriteLine("Neither record was written to database.") + Finally + myConnection.Close() + End Try + End Sub + + + public void RunTransaction(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + + MySqlCommand myCommand = myConnection.CreateCommand(); + MySqlTransaction myTrans; + + // Start a local transaction + myTrans = myConnection.BeginTransaction(); + // Must assign both transaction object and connection + // to Command object for a pending local transaction + myCommand.Connection = myConnection; + myCommand.Transaction = myTrans; + + try + { + myCommand.CommandText = "insert into Test (id, desc) VALUES (100, 'Description')"; + myCommand.ExecuteNonQuery(); + myCommand.CommandText = "insert into Test (id, desc) VALUES (101, 'Description')"; + myCommand.ExecuteNonQuery(); + myTrans.Commit(); + Console.WriteLine("Both records are written to database."); + } + catch(Exception e) + { + try + { + myTrans.Rollback(); + } + catch (SqlException ex) + { + if (myTrans.Connection != null) + { + Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to roll back the transaction."); + } + } + + Console.WriteLine("An exception of type " + e.GetType() + + " was encountered while inserting the data."); + Console.WriteLine("Neither record was written to database."); + } + finally + { + myConnection.Close(); + } + } + + + + + Changes the current database for an open MySqlConnection.The name of the database to use. + + The value supplied in the database parameter must be a valid database + name. The database parameter cannot contain a null value, an empty + string, or a string with only blank characters. + + + + When you are using connection pooling against MySQL, and you close + the connection, it is returned to the connection pool. The next time the + connection is retrieved from the pool, the reset connection request + executes before the user performs any operations. + + The database name is not valid.The connection is not open.Cannot change the database. + The following example creates a and displays + some of its read-only properties. + + + Public Sub CreateMySqlConnection() + Dim myConnString As String = _ + "Persist Security Info=False;database=test;server=localhost;user id=joeuser;pwd=pass" + Dim myConnection As New MySqlConnection( myConnString ) + myConnection.Open() + MessageBox.Show( "Server Version: " + myConnection.ServerVersion _ + + ControlChars.NewLine + "Database: " + myConnection.Database ) + myConnection.ChangeDatabase( "test2" ) + MessageBox.Show( "ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.NewLine + "Database: " + myConnection.Database ) + myConnection.Close() + End Sub + + + + public void CreateMySqlConnection() + { + string myConnString = + "Persist Security Info=False;database=test;server=localhost;user id=joeuser;pwd=pass"; + MySqlConnection myConnection = new MySqlConnection( myConnString ); + myConnection.Open(); + MessageBox.Show( "Server Version: " + myConnection.ServerVersion + + "\nDatabase: " + myConnection.Database ); + myConnection.ChangeDatabase( "test2" ); + MessageBox.Show( "ServerVersion: " + myConnection.ServerVersion + + "\nDatabase: " + myConnection.Database ); + myConnection.Close(); + } + + + + + + Pings the server. + + true if the ping was successful; otherwise, false. + + + Opens a database connection with the property settings specified by the ConnectionString.Cannot open a connection without specifying a data source or server.A connection-level error occurred while opening the connection. + + The draws an open connection from the connection pool if one is available. + Otherwise, it establishes a new connection to an instance of MySQL. + + + The following example creates a , opens it, + displays some of its properties, then closes the connection. + + + Public Sub CreateMySqlConnection(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.Cr + "State: " + myConnection.State.ToString()) + myConnection.Close() + End Sub + + + public void CreateMySqlConnection(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion + + "\nState: " + myConnection.State.ToString()); + myConnection.Close(); + } + + + + + + Initializes the if more than one host is found. + + A string containing an unparsed list of hosts. + true if the connection data is a URI; otherwise false. + The number of hosts found, -1 if an error was raised during parsing. + + + + Creates a object based on the provided parameters. + + The host string which can be a simple host name or a host name and port. + The priority of the host. + The port number of the host. + + + + + Creates and returns a object associated with the . + + A object. + + + + Closes the connection to the database. This is the preferred method of closing any open connection. + + The Close method rolls back any pending transactions. It then releases + the connection to the connection pool, or closes the connection if connection + pooling is disabled. + + + An application can call Close more than one time. No exception is + generated. + + + The following example creates a , opens it, + displays some of its properties, then closes the connection. + + + Public Sub CreateMySqlConnection(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _ + + ControlChars.Cr + "State: " + myConnection.State.ToString()) + myConnection.Close() + End Sub + + + public void CreateMySqlConnection(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + MessageBox.Show("ServerVersion: " + myConnection.ServerVersion + + "\nState: " + myConnection.State.ToString()); + myConnection.Close(); + } + + + + + + Cancels the query after the specified time interval. + + The length of time (in seconds) to wait for the cancelation of the command execution. + + + + Sets query timeout. If timeout has been set prior and not + yet cleared ClearCommandTimeout(), it has no effect. + + timeout in seconds + true if + + + + Clears query timeout, allowing next SetCommandTimeout() to succeed. + + + + + Gets a schema collection based on the provided restriction values. + + The name of the collection. + The values to restrict. + A schema collection object. + + + Empties the connection pool associated with the specified connection. + The associated with the pool to be cleared. + + + ClearPool clears the connection pool that is associated with the connection. + If additional connections associated with connection are in use at the time of the call, + they are marked appropriately and are discarded (instead of being returned to the pool) + when Close is called on them. + + + + + Clears all connection pools. + + ClearAllPools essentially performs a on all current connection + pools. + + + + + + Initiates the asynchronous execution of a transaction. + + An object representing the new transaction. + + + + Asynchronous version of BeginTransaction. + + The cancellation token. + An object representing the new transaction. + + + + Asynchronous version of BeginTransaction. + + The isolation level under which the transaction should run. + An object representing the new transaction. + + + + Asynchronous version of BeginTransaction. + + The isolation level under which the transaction should run. + The cancellation token. + An object representing the new transaction. + + + + Asynchronous version of the ChangeDataBase method. + + The name of the database to use. + + + + + Asynchronous version of the ChangeDataBase method. + + The name of the database to use. + The cancellation token. + + + + + Asynchronous version of the Close method. + + + + + Asynchronous version of the Close method. + + The cancellation token. + + + + Asynchronous version of the ClearPool method. + + The connection associated with the pool to be cleared. + + + + Asynchronous version of the ClearPool method. + + The connection associated with the pool to be cleared. + The cancellation token. + + + + Asynchronous version of the ClearAllPools method. + + + + + Asynchronous version of the ClearAllPools method. + + The cancellation token. + + + + Asynchronous version of the GetSchemaCollection method. + + The name of the collection. + The values to restrict. + A collection of schema objects. + + + + Asynchronous version of the GetSchemaCollection method. + + The name of the collection. + The values to restrict. + The cancellation token. + A collection of schema objects. + + + + Returns schema information for the data source of this . + + A that contains schema information. + + + + Returns schema information for the data source of this + using the specified string for the schema name. + + Specifies the name of the schema to return. + A that contains schema information. + + + + Returns schema information for the data source of this + using the specified string for the schema name and the specified string array + for the restriction values. + + Specifies the name of the schema to return. + Specifies a set of restriction values for the requested schema. + A that contains schema information. + + + + Enlists in the specified transaction. + + + A reference to an existing in which to enlist. + + + + + Creates a new MySqlConnection object with the exact same ConnectionString value + + A cloned MySqlConnection object + + + + Represents the method that will handle the event of a + . + + + + + Provides data for the InfoMessage event. This class cannot be inherited. + + + + + Gets or sets an array of objects set with the errors found. + + + + + IDisposable wrapper around SetCommandTimeout and ClearCommandTimeout functionality. + + + + + Summary description for Crypt. + + + + + Simple XOR scramble + + Source array + Index inside source array + Destination array + Index inside destination array + Password used to xor the bits + Number of bytes to scramble + + + + Returns a byte array containing the proper encryption of the + given password/seed according to the new 4.1.1 authentication scheme. + + + + + + + + Encrypts a password using the MySql encryption scheme + + The password to encrypt + The encryption seed the server gave us + Indicates if we should use the old or new encryption scheme + + + + + Hashes a password using the algorithm from Monty's code. + The first element in the return is the result of the "old" hash. + The second element is the rest of the "new" hash. + + Password to be hashed + Two element array containing the hashed values + + + + Provides a means of reading a forward-only stream of rows from a MySQL database. This class cannot be inherited. + + + To create a MySQLDataReader, you must call the + method of the object, rather than directly using a constructor. + + + While the MySqlDataReader is in use, the associated + is busy serving the MySqlDataReader, and no other operations can be performed + on the MySqlConnection other than closing it. This is the case until the + method of the MySqlDataReader is called. + + + and + are the only properties that you can call after the MySqlDataReader is + closed. Though the RecordsAffected property may be accessed at any time + while the MySqlDataReader exists, always call Close before returning + the value of RecordsAffected to ensure an accurate return value. + + + For optimal performance, MySqlDataReader avoids creating + unnecessary objects or making unnecessary copies of data. As a result, multiple calls + to methods such as return a reference to the + same object. Use caution if you are modifying the underlying value of the objects + returned by methods such as GetValue. + + + The following example creates a , + a , and a MySqlDataReader. The example reads through + the data, writing it out to the console. Finally, the example closes the MySqlDataReader, then the + MySqlConnection. + + Public Sub ReadMyData(myConnString As String) + Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders" + Dim myConnection As New MySqlConnection(myConnString) + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) + myConnection.Open() + Dim myReader As MySqlDataReader + myReader = myCommand.ExecuteReader() + ' Always call Read before accessing data. + While myReader.Read() + Console.WriteLine((myReader.GetInt32(0) & ", " & myReader.GetString(1))) + End While + ' always call Close when done reading. + myReader.Close() + ' Close the connection when done with it. + myConnection.Close() + End Sub 'ReadMyData + + + public void ReadMyData(string myConnString) { + string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders"; + MySqlConnection myConnection = new MySqlConnection(myConnString); + MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); + myConnection.Open(); + MySqlDataReader myReader; + myReader = myCommand.ExecuteReader(); + // Always call Read before accessing data. + while (myReader.Read()) { + Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1)); + } + // always call Close when done reading. + myReader.Close(); + // Close the connection when done with it. + myConnection.Close(); + } + + + + + + Gets the number of columns in the current row. + + + + + Gets a value indicating whether the MySqlDataReader contains one or more rows. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Overloaded. Gets the value of a column in its native format. + In C#, this property is the indexer for the MySqlDataReader class. + + + + + Gets the value of a column in its native format. + [C#] In C#, this property is the indexer for the MySqlDataReader class. + + + + + Gets a value indicating the depth of nesting for the current row. This method is not + supported currently and always returns 0. + + + + + Closes the MySqlDataReader object. + + + + + Gets the value of the specified column as a Boolean. + + + + + + + Gets the value of the specified column as a Boolean. + + + + + + + Gets the value of the specified column as a byte. + + + + + + + Gets the value of the specified column as a byte. + + + + + + + Gets the value of the specified column as a sbyte. + + + + + + + Gets the value of the specified column as a sbyte. + + + + + + + Reads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset. + + The zero-based column ordinal. + The index within the field from which to begin the read operation. + The buffer into which to read the stream of bytes. + The index for buffer to begin the read operation. + The maximum length to copy into the buffer. + The actual number of bytes read. + + + + + Gets the value of the specified column as a single character. + + + + + + + Gets the value of the specified column as a single character. + + + + + + + Reads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset. + + + + + + + + + + + Gets the name of the source data type. + + + + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a DateTime object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a DateTime object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a DateTime object. + + + Call IsDBNull to check for null values before calling this method. + + + + MySql allows date columns to contain the value '0000-00-00' and datetime + columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot contain + or represent these values. To read a datetime value from a column that might + contain zero values, use . + + + The behavior of reading a zero datetime column using this method is defined by the + ZeroDateTimeBehavior connection string option. For more information on this option, + please refer to . + + + The column name.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a DateTime object. + + + Call IsDBNull to check for null values before calling this method. + + + + MySql allows date columns to contain the value '0000-00-00' and datetime + columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot contain + or represent these values. To read a datetime value from a column that might + contain zero values, use . + + + The behavior of reading a zero datetime column using this method is defined by the + ZeroDateTimeBehavior connection string option. For more information on this option, + please refer to . + + + The zero-based column ordinal.The value of the specified column. + + + + Gets the value of the specified column as a . + + The name of the colum. + The value of the specified column as a . + + + + Gets the value of the specified column as a . + + The index of the colum. + The value of the specified column as a . + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a Decimal object. + + + Call IsDBNull to check for null values before calling this method. + + The column nameThe value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a Decimal object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinalThe value of the specified column. + + + Gets the value of the specified column as a double-precision floating point number. + + No conversions are performed; therefore, the data retrieved must already be a Double object. + + + Call IsDBNull to check for null values before calling this method. + + The column nameThe value of the specified column. + + + Gets the value of the specified column as a double-precision floating point number. + + No conversions are performed; therefore, the data retrieved must already be a Double object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + + Gets the Type that is the data type of the object. + + + + + + + Gets the value of the specified column as a single-precision floating point number. + + + No conversions are performed; therefore, the data retrieved must already be a Float object. + + + Call IsDBNull to check for null values before calling this method. + + The column nameThe value of the specified column. + + + + Gets the value of the specified column as a single-precision floating point number. + + + No conversions are performed; therefore, the data retrieved must already be a Float object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + + Gets the value of the specified column as a globally-unique identifier(GUID). + + The name of the column. + + + + + + + Gets the value of the specified column as a 16-bit signed integer. + + No conversions are performed; threfore, the data retrieved must already be a 16 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The column nameThe value of the specified column. + + + Gets the value of the specified column as a 16-bit signed integer. + + No conversions are performed; therefore, the data retrieved must already be a 16 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + Gets the value of the specified column as a 32-bit signed integer. + + No conversions are performed; therefore, the data retrieved must already be a 32 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The column name.The value of the specified column. + + + Gets the value of the specified column as a 32-bit signed integer. + + No conversions are performed; therefore, the data retrieved must already be a 32 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + Gets the value of the specified column as a 64-bit signed integer. + + No conversions are performed; therefore, the data retrieved must already be a 64 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The column name.The value of the specified column. + + + Gets the value of the specified column as a 64-bit signed integer. + + No conversions are performed; therefore, the data retrieved must already be a 64 bit integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + + Gets the name of the specified column. + + + + + + + Gets the column ordinal, given the name of the column. + + + + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a String object. + + + Call IsDBNull to check for null values before calling this method. + + The column name.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a String object. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a Time value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + + Gets the value of the specified column as a object. + + + No conversions are performed; therefore, the data retrieved must already be a Time value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + + Gets the value of the specified column in its native format. + + + + + + + Gets all attribute columns in the collection for the current row. + + + + + + Gets the value of the specified column as a 16-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 16 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + Gets the value of the specified column as a 16-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 16 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + Gets the value of the specified column as a 32-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 32 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + Gets the value of the specified column as a 32-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 32 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + Gets the value of the specified column as a 64-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 64 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + Gets the value of the specified column as a 64-bit unsigned integer. + + No conversions are performed; therefore, the data retrieved must already be a 64 bit unsigned integer value. + + + Call IsDBNull to check for null values before calling this method. + + The zero-based column ordinal or column name.The value of the specified column. + + + + Gets a value indicating whether the column contains non-existent or missing values. + + + + + + + Advances the data reader to the next result, when reading the results of batch SQL statements. + + + + + + Advances the MySqlDataReader to the next record. + + + + + + Gets the value of the specified column as a . + + The index of the colum. + The value of the specified column as a . + + + + Gets the value of the specified column as a . + + The name of the colum. + The value of the specified column as a . + + + + Returns an that iterates through the . + + + + + Returns a DataTable that describes the column metadata of the MySqlDataReader. + + + + + + Summary description for BaseDriver. + + + + + For pooled connections, time when the driver was + put into idle queue + + + + + Loads the properties from the connected server into a hashtable + + + + + + + Loads all the current character set names and ids for this server + into the charSets hashtable + + + + + The exception that is thrown when MySQL returns an error. This class cannot be inherited. + + + + This class is created whenever the MySql Data Provider encounters an error generated from the server. + + + Any open connections are not automatically closed when an exception is thrown. If + the client application determines that the exception is fatal, it should close any open + objects or objects. + + + The following example generates a MySqlException due to a missing server, + and then displays the exception. + + + Public Sub ShowException() + Dim mySelectQuery As String = "SELECT column1 FROM table1" + Dim myConnection As New MySqlConnection ("Data Source=localhost;Database=Sample;") + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) + + Try + myCommand.Connection.Open() + Catch e As MySqlException + MessageBox.Show( e.Message ) + End Try + End Sub + + + public void ShowException() + { + string mySelectQuery = "SELECT column1 FROM table1"; + MySqlConnection myConnection = + new MySqlConnection("Data Source=localhost;Database=Sample;"); + MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); + + try + { + myCommand.Connection.Open(); + } + catch (MySqlException e) + { + MessageBox.Show( e.Message ); + } + } + + + + + + Gets a number that identifies the type of error. + + + + + True if this exception was fatal and cause the closing of the connection, false otherwise. + + + + + Gets the SQL state. + + + + + Gets an integer that representes the MySQL error code. + + + + + Summary description for Field. + + + + + We are adding a custom installer class to our assembly so our installer + can make proper changes to the machine.config file. + + + + + We override Install so we can add our assembly to the proper + machine.config files. + + + + + + We override Uninstall so we can remove out assembly from the + machine.config files. + + + + + + Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated MySQL database. This class cannot be inherited. + + + The does not automatically generate the SQL statements required to + reconcile changes made to a DataSet with the associated instance of MySQL. + However, you can create a MySqlCommandBuilder object to automatically generate SQL statements for + single-table updates if you set the SelectCommand property + of the MySqlDataAdapter. Then, any additional SQL statements that you do not set are generated by the + MySqlCommandBuilder. + + + + The MySqlCommandBuilder registers itself as a listener for RowUpdating + events whenever you set the property. You can only associate one + MySqlDataAdapter or MySqlCommandBuilder object with each other at one time. + + + + To generate INSERT, UPDATE, or DELETE statements, the MySqlCommandBuilder uses the + SelectCommand property to retrieve a required set of metadata automatically. If you change + the SelectCommand after the metadata has is retrieved (for example, after the first update), you + should call the method to update the metadata. + + + + The SelectCommand must also return at least one primary key or unique + column. If none are present, an InvalidOperation exception is generated, + and the commands are not generated. + + + + The MySqlCommandBuilder also uses the Connection, + CommandTimeout, and Transaction + properties referenced by the SelectCommand. The user should call + RefreshSchema if any of these properties are modified, or if the + SelectCommand itself is replaced. Otherwise the InsertCommand, + UpdateCommand, and + DeleteCommand properties retain + their previous values. + + + + If you call Dispose, the MySqlCommandBuilder is disassociated + from the MySqlDataAdapter, and the generated commands are no longer used. + + + + Caution must be used when using MySqlCOmmandBuilder on MySql 4.0 systems. With MySql 4.0, + database/schema information is not provided to the connector for a query. This means that + a query that pulls columns from two identically named tables in two or more different databases + will not cause an exception to be thrown but will not work correctly. Even more dangerous + is the situation where your select statement references database X but is executed in + database Y and both databases have tables with similar layouts. This situation can cause + unwanted changes or deletes. + This note does not apply to MySQL versions 4.1 and later. + + + + The following example uses the , along + and , to + select rows from a data source. The example is passed an initialized + , a connection string, a + query string that is a SQL SELECT statement, and a string that is the + name of the database table. The example then creates a MySqlCommandBuilder. + + + Public Shared Function SelectRows(myConnection As String, mySelectQuery As String, myTableName As String) As DataSet + Dim myConn As New MySqlConnection(myConnection) + Dim myDataAdapter As New MySqlDataAdapter() + myDataAdapter.SelectCommand = New MySqlCommand(mySelectQuery, myConn) + Dim cb As SqlCommandBuilder = New MySqlCommandBuilder(myDataAdapter) + + myConn.Open() + + Dim ds As DataSet = New DataSet + myDataAdapter.Fill(ds, myTableName) + + ' Code to modify data in DataSet here + + ' Without the MySqlCommandBuilder this line would fail. + myDataAdapter.Update(ds, myTableName) + + myConn.Close() + End Function 'SelectRows + + + public static DataSet SelectRows(string myConnection, string mySelectQuery, string myTableName) + { + MySqlConnection myConn = new MySqlConnection(myConnection); + MySqlDataAdapter myDataAdapter = new MySqlDataAdapter(); + myDataAdapter.SelectCommand = new MySqlCommand(mySelectQuery, myConn); + MySqlCommandBuilder cb = new MySqlCommandBuilder(myDataAdapter); + + myConn.Open(); + + DataSet ds = new DataSet(); + myDataAdapter.Fill(ds, myTableName); + + //code to modify data in DataSet here + + //Without the MySqlCommandBuilder this line would fail + myDataAdapter.Update(ds, myTableName); + + myConn.Close(); + + return ds; + } + + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with the associated object. + + The to use. + + + The registers itself as a listener for + events that are generated by the + specified in this property. + + + When you create a new instance MySqlCommandBuilder, any existing + MySqlCommandBuilder associated with this MySqlDataAdapter + is released. + + + + + + Gets or sets a object for which SQL statements are automatically generated. + + A object. + + + The registers itself as a listener for + events that are generated by the + specified in this property. + + + When you create a new instance MySqlCommandBuilder, any existing + MySqlCommandBuilder associated with this MySqlDataAdapter + is released. + + + + + + Retrieves parameter information from the stored procedure specified + in the MySqlCommand and populates the Parameters collection of the + specified MySqlCommand object. + This method is not currently supported since stored procedures are + not available in MySql. + + The MySqlCommand referencing the stored + procedure from which the parameter information is to be derived. + The derived parameters are added to the Parameters collection of the + MySqlCommand. + The command text is not + a valid stored procedure name. + + + + Gets the delete command. + + + + + + Gets the update command. + + + + + + Gets the insert command. + + + + + + + + + + + + + Represents a set of data commands and a database connection that are used to fill a dataset and update a MySQL database. This class cannot be inherited. + + + The MySQLDataAdapter, serves as a bridge between a + and MySQL for retrieving and saving data. The MySQLDataAdapter provides this + bridge by mapping , which changes the data in the + DataSet to match the data in the data source, and , + which changes the data in the data source to match the data in the DataSet, + using the appropriate SQL statements against the data source. + + + When the MySQLDataAdapter fills a DataSet, it will create the necessary + tables and columns for the returned data if they do not already exist. However, primary + key information will not be included in the implicitly created schema unless the + property is set to . + You may also have the MySQLDataAdapter create the schema of the DataSet, + including primary key information, before filling it with data using . + + + MySQLDataAdapter is used in conjunction with + and to increase performance when connecting to a MySQL database. + + + The MySQLDataAdapter also includes the , + , , + , and + properties to facilitate the loading and updating of data. + + + When an instance of MySQLDataAdapter is created, the read/write properties + are set to initial values. For a list of these values, see the MySQLDataAdapter + constructor. + + + Please be aware that the class allows only + Int16, Int32, and Int64 to have the AutoIncrement property set. + If you plan to use autoincremement columns with MySQL, you should consider + using signed integer columns. + + + The following example creates a and a . + The MySqlConnection is opened and set as the for the + MySqlCommand. The example then calls , and closes + the connection. To accomplish this, the ExecuteNonQuery is + passed a connection string and a query string that is a SQL INSERT + statement. + + Public Function SelectRows(dataSet As DataSet, connection As String, query As String) As DataSet + Dim conn As New MySqlConnection(connection) + Dim adapter As New MySqlDataAdapter() + adapter.SelectCommand = new MySqlCommand(query, conn) + adapter.Fill(dataset) + Return dataset + End Function + + + public DataSet SelectRows(DataSet dataset,string connection,string query) + { + MySqlConnection conn = new MySqlConnection(connection); + MySqlDataAdapter adapter = new MySqlDataAdapter(); + adapter.SelectCommand = new MySqlCommand(query, conn); + adapter.Fill(dataset); + return dataset; + } + + + + + + Occurs during Update before a command is executed against the data source. The attempt to update is made, so the event fires. + + + + + Occurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires. + + + + + Initializes a new instance of the MySqlDataAdapter class. + + + When an instance of is created, + the following read/write properties are set to the following initial + values. + + + + Properties + Initial Value + + + + + + + MissingMappingAction.Passthrough + + + + + + + + MissingSchemaAction.Add + + + + + You can change the value of any of these properties through a separate call + to the property. + + + The following example creates a and sets some of + its properties. + + Public Sub CreateSqlDataAdapter() + Dim conn As MySqlConnection = New MySqlConnection("Data Source=localhost;" & _ + "database=test") + Dim da As MySqlDataAdapter = New MySqlDataAdapter + da.MissingSchemaAction = MissingSchemaAction.AddWithKey + + da.SelectCommand = New MySqlCommand("SELECT id, name FROM mytable", conn) + da.InsertCommand = New MySqlCommand("INSERT INTO mytable (id, name) " & _ + "VALUES (@id, @name)", conn) + da.UpdateCommand = New MySqlCommand("UPDATE mytable SET id=@id, name=@name " & _ + "WHERE id=@oldId", conn) + da.DeleteCommand = New MySqlCommand("DELETE FROM mytable WHERE id=@id", conn) + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + End Sub + + + public static void CreateSqlDataAdapter() + { + MySqlConnection conn = new MySqlConnection("Data Source=localhost;database=test"); + MySqlDataAdapter da = new MySqlDataAdapter(); + da.MissingSchemaAction = MissingSchemaAction.AddWithKey; + + da.SelectCommand = new MySqlCommand("SELECT id, name FROM mytable", conn); + da.InsertCommand = new MySqlCommand("INSERT INTO mytable (id, name) " + + "VALUES (@id, @name)", conn); + da.UpdateCommand = new MySqlCommand("UPDATE mytable SET id=@id, name=@name " + + "WHERE id=@oldId", conn); + da.DeleteCommand = new MySqlCommand("DELETE FROM mytable WHERE id=@id", conn); + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + } + + + + + + Initializes a new instance of the class with + the specified as the + property. + + that is a SQL SELECT statement or stored procedure and is set + as the property of the . + + + When an instance of is created, + the following read/write properties are set to the following initial + values. + + + + Properties + Initial Value + + + + + + + MissingMappingAction.Passthrough + + + + + + + + MissingSchemaAction.Add + + + + + You can change the value of any of these properties through a separate call + to the property. + + + When SelectCommand (or any of the other command properties) is assigned + to a previously created , the MySqlCommand is not cloned. + The SelectCommand maintains a reference to the previously created MySqlCommand + object. + + + The following example creates a and sets some of + its properties. + + Public Sub CreateSqlDataAdapter() + Dim conn As MySqlConnection = New MySqlConnection("Data Source=localhost;" & _ + "database=test") + Dim cmd as new MySqlCommand("SELECT id, name FROM mytable", conn) + Dim da As MySqlDataAdapter = New MySqlDataAdapter(cmd) + da.MissingSchemaAction = MissingSchemaAction.AddWithKey + + da.InsertCommand = New MySqlCommand("INSERT INTO mytable (id, name) " & _ + "VALUES (@id, @name)", conn) + da.UpdateCommand = New MySqlCommand("UPDATE mytable SET id=@id, name=@name " & _ + "WHERE id=@oldId", conn) + da.DeleteCommand = New MySqlCommand("DELETE FROM mytable WHERE id=@id", conn) + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + End Sub + + + public static void CreateSqlDataAdapter() + { + MySqlConnection conn = new MySqlConnection("Data Source=localhost;database=test"); + MySqlCommand cmd = new MySqlCommand("SELECT id, name FROM mytable", conn); + MySqlDataAdapter da = new MySqlDataAdapter(cmd); + da.MissingSchemaAction = MissingSchemaAction.AddWithKey; + + da.InsertCommand = new MySqlCommand("INSERT INTO mytable (id, name) " + + "VALUES (@id, @name)", conn); + da.UpdateCommand = new MySqlCommand("UPDATE mytable SET id=@id, name=@name " + + "WHERE id=@oldId", conn); + da.DeleteCommand = new MySqlCommand("DELETE FROM mytable WHERE id=@id", conn); + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + } + + + + + + Initializes a new instance of the class with + a and a object. + + A String that is a SQL SELECT statement or stored procedure to be used by + the property of the . + + A that represents the connection. + + + This implementation of the opens and closes a + if it is not already open. This can be useful in a an application that must call the + method for two or more MySqlDataAdapter objects. + If the MySqlConnection is already open, you must explicitly call + or to close it. + + + When an instance of is created, + the following read/write properties are set to the following initial + values. + + + + Properties + Initial Value + + + + + + + MissingMappingAction.Passthrough + + + + + + + + MissingSchemaAction.Add + + + + + You can change the value of any of these properties through a separate call + to the property. + + + The following example creates a and sets some of + its properties. + + Public Sub CreateSqlDataAdapter() + Dim conn As MySqlConnection = New MySqlConnection("Data Source=localhost;" & _ + "database=test") + Dim da As MySqlDataAdapter = New MySqlDataAdapter("SELECT id, name FROM mytable", conn) + da.MissingSchemaAction = MissingSchemaAction.AddWithKey + + da.InsertCommand = New MySqlCommand("INSERT INTO mytable (id, name) " & _ + "VALUES (@id, @name)", conn) + da.UpdateCommand = New MySqlCommand("UPDATE mytable SET id=@id, name=@name " & _ + "WHERE id=@oldId", conn) + da.DeleteCommand = New MySqlCommand("DELETE FROM mytable WHERE id=@id", conn) + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + End Sub + + + public static void CreateSqlDataAdapter() + { + MySqlConnection conn = new MySqlConnection("Data Source=localhost;database=test"); + MySqlDataAdapter da = new MySqlDataAdapter("SELECT id, name FROM mytable", conn); + da.MissingSchemaAction = MissingSchemaAction.AddWithKey; + + da.InsertCommand = new MySqlCommand("INSERT INTO mytable (id, name) " + + "VALUES (@id, @name)", conn); + da.UpdateCommand = new MySqlCommand("UPDATE mytable SET id=@id, name=@name " + + "WHERE id=@oldId", conn); + da.DeleteCommand = new MySqlCommand("DELETE FROM mytable WHERE id=@id", conn); + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + } + + + + + + Initializes a new instance of the class with + a and a connection string. + + A that is a SQL SELECT statement or stored procedure to + be used by the property of the . + The connection string + + When an instance of is created, + the following read/write properties are set to the following initial + values. + + + + Properties + Initial Value + + + + + + + MissingMappingAction.Passthrough + + + + + + + + MissingSchemaAction.Add + + + + + You can change the value of any of these properties through a separate call + to the property. + + + The following example creates a and sets some of + its properties. + + Public Sub CreateSqlDataAdapter() + Dim da As MySqlDataAdapter = New MySqlDataAdapter("SELECT id, name FROM mytable", "Data Source=localhost;database=test") + Dim conn As MySqlConnection = da.SelectCommand.Connection + da.MissingSchemaAction = MissingSchemaAction.AddWithKey + + da.InsertCommand = New MySqlCommand("INSERT INTO mytable (id, name) " & _ + "VALUES (@id, @name)", conn) + da.UpdateCommand = New MySqlCommand("UPDATE mytable SET id=@id, name=@name " & _ + "WHERE id=@oldId", conn) + da.DeleteCommand = New MySqlCommand("DELETE FROM mytable WHERE id=@id", conn) + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name") + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original + End Sub + + + public static void CreateSqlDataAdapter() + { + MySqlDataAdapter da = new MySqlDataAdapter("SELECT id, name FROM mytable", "Data Source=localhost;database=test"); + MySqlConnection conn = da.SelectCommand.Connection; + da.MissingSchemaAction = MissingSchemaAction.AddWithKey; + + da.InsertCommand = new MySqlCommand("INSERT INTO mytable (id, name) " + + "VALUES (@id, @name)", conn); + da.UpdateCommand = new MySqlCommand("UPDATE mytable SET id=@id, name=@name " + + "WHERE id=@oldId", conn); + da.DeleteCommand = new MySqlCommand("DELETE FROM mytable WHERE id=@id", conn); + + da.InsertCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.InsertCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + + da.UpdateCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + da.UpdateCommand.Parameters.Add("@name", MySqlDbType.VarChar, 40, "name"); + da.UpdateCommand.Parameters.Add("@oldId", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + + da.DeleteCommand.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id").SourceVersion = DataRowVersion.Original; + } + + + + + + Gets or sets a SQL statement or stored procedure used to delete records from the data set. + + A used during to delete records in the + database that correspond to deleted rows in the . + + + During , if this property is not set and primary key information + is present in the , the DeleteCommand can be generated + automatically if you set the property and use the + . Then, any additional commands that you do not set are + generated by the MySqlCommandBuilder. This generation logic requires key column + information to be present in the DataSet. + + + When DeleteCommand is assigned to a previously created , + the MySqlCommand is not cloned. The DeleteCommand maintains a reference + to the previously created MySqlCommand object. + + + The following example creates a and sets the + and DeleteCommand properties. It assumes you have already + created a object. + + Public Shared Function CreateCustomerAdapter(conn As MySqlConnection) As MySqlDataAdapter + + Dim da As MySqlDataAdapter = New MySqlDataAdapter() + Dim cmd As MySqlCommand + Dim parm As MySqlParameter + + ' Create the SelectCommand. + cmd = New MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn) + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15) + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15) + + da.SelectCommand = cmd + + ' Create the DeleteCommand. + cmd = New MySqlCommand("DELETE FROM mytable WHERE id=@id", conn) + + parm = cmd.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id") + parm.SourceVersion = DataRowVersion.Original + + da.DeleteCommand = cmd + + Return da + End Function + + + public static MySqlDataAdapter CreateCustomerAdapter(MySqlConnection conn) + { + MySqlDataAdapter da = new MySqlDataAdapter(); + MySqlCommand cmd; + MySqlParameter parm; + + // Create the SelectCommand. + cmd = new MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn); + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15); + + da.SelectCommand = cmd; + + // Create the DeleteCommand. + cmd = new MySqlCommand("DELETE FROM mytable WHERE id=@id", conn); + + parm = cmd.Parameters.Add("@id", MySqlDbType.VarChar, 5, "id"); + parm.SourceVersion = DataRowVersion.Original; + + da.DeleteCommand = cmd; + + return da; + } + + + + + + Gets or sets a SQL statement or stored procedure used to insert records into the data set. + + A used during to insert records into the + database that correspond to new rows in the . + + + During , if this property is not set and primary key information + is present in the , the InsertCommand can be generated + automatically if you set the property and use the + . Then, any additional commands that you do not set are + generated by the MySqlCommandBuilder. This generation logic requires key column + information to be present in the DataSet. + + + When InsertCommand is assigned to a previously created , + the MySqlCommand is not cloned. The InsertCommand maintains a reference + to the previously created MySqlCommand object. + + + If execution of this command returns rows, these rows may be added to the DataSet + depending on how you set the property of the MySqlCommand object. + + + The following example creates a and sets the + and InsertCommand properties. It assumes you have already + created a object. + + Public Shared Function CreateCustomerAdapter(conn As MySqlConnection) As MySqlDataAdapter + + Dim da As MySqlDataAdapter = New MySqlDataAdapter() + Dim cmd As MySqlCommand + Dim parm As MySqlParameter + + ' Create the SelectCommand. + cmd = New MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn) + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15) + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15) + + da.SelectCommand = cmd + + ' Create the InsertCommand. + cmd = New MySqlCommand("INSERT INTO mytable (id,name) VALUES (@id, @name)", conn) + + cmd.Parameters.Add( "@id", MySqlDbType.VarChar, 15, "id" ) + cmd.Parameters.Add( "@name", MySqlDbType.VarChar, 15, "name" ) + da.InsertCommand = cmd + + Return da + End Function + + + public static MySqlDataAdapter CreateCustomerAdapter(MySqlConnection conn) + { + MySqlDataAdapter da = new MySqlDataAdapter(); + MySqlCommand cmd; + MySqlParameter parm; + + // Create the SelectCommand. + cmd = new MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn); + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15); + + da.SelectCommand = cmd; + + // Create the InsertCommand. + cmd = new MySqlCommand("INSERT INTO mytable (id,name) VALUES (@id,@name)", conn); + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15, "id" ); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15, "name" ); + + da.InsertCommand = cmd; + + return da; + } + + + + + + Gets or sets a SQL statement or stored procedure used to select records in the data source. + + A used during to select records from the + database for placement in the . + + + When SelectCommand is assigned to a previously created , + the MySqlCommand is not cloned. The SelectCommand maintains a reference to the + previously created MySqlCommand object. + + + If the SelectCommand does not return any rows, no tables are added to the + , and no exception is raised. + + + The following example creates a and sets the + and InsertCommand properties. It assumes you have already + created a object. + + Public Shared Function CreateCustomerAdapter(conn As MySqlConnection) As MySqlDataAdapter + + Dim da As MySqlDataAdapter = New MySqlDataAdapter() + Dim cmd As MySqlCommand + Dim parm As MySqlParameter + + ' Create the SelectCommand. + cmd = New MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn) + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15) + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15) + + da.SelectCommand = cmd + + ' Create the InsertCommand. + cmd = New MySqlCommand("INSERT INTO mytable (id,name) VALUES (@id, @name)", conn) + + cmd.Parameters.Add( "@id", MySqlDbType.VarChar, 15, "id" ) + cmd.Parameters.Add( "@name", MySqlDbType.VarChar, 15, "name" ) + da.InsertCommand = cmd + + Return da + End Function + + + public static MySqlDataAdapter CreateCustomerAdapter(MySqlConnection conn) + { + MySqlDataAdapter da = new MySqlDataAdapter(); + MySqlCommand cmd; + MySqlParameter parm; + + // Create the SelectCommand. + cmd = new MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn); + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15); + + da.SelectCommand = cmd; + + // Create the InsertCommand. + cmd = new MySqlCommand("INSERT INTO mytable (id,name) VALUES (@id,@name)", conn); + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15, "id" ); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15, "name" ); + + da.InsertCommand = cmd; + + return da; + } + + + + + + Gets or sets a SQL statement or stored procedure used to updated records in the data source. + + A used during to update records in the + database with data from the . + + + During , if this property is not set and primary key information + is present in the , the UpdateCommand can be generated + automatically if you set the property and use the + . Then, any additional commands that you do not set are + generated by the MySqlCommandBuilder. This generation logic requires key column + information to be present in the DataSet. + + + When UpdateCommand is assigned to a previously created , + the MySqlCommand is not cloned. The UpdateCommand maintains a reference + to the previously created MySqlCommand object. + + + If execution of this command returns rows, these rows may be merged with the DataSet + depending on how you set the property of the MySqlCommand object. + + + The following example creates a and sets the + and UpdateCommand properties. It assumes you have already + created a object. + + Public Shared Function CreateCustomerAdapter(conn As MySqlConnection) As MySqlDataAdapter + + Dim da As MySqlDataAdapter = New MySqlDataAdapter() + Dim cmd As MySqlCommand + Dim parm As MySqlParameter + + ' Create the SelectCommand. + cmd = New MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn) + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15) + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15) + + da.SelectCommand = cmd + + ' Create the UpdateCommand. + cmd = New MySqlCommand("UPDATE mytable SET id=@id, name=@name WHERE id=@oldId", conn) + + cmd.Parameters.Add( "@id", MySqlDbType.VarChar, 15, "id" ) + cmd.Parameters.Add( "@name", MySqlDbType.VarChar, 15, "name" ) + + parm = cmd.Parameters.Add("@oldId", MySqlDbType.VarChar, 15, "id") + parm.SourceVersion = DataRowVersion.Original + + da.UpdateCommand = cmd + + Return da + End Function + + + public static MySqlDataAdapter CreateCustomerAdapter(MySqlConnection conn) + { + MySqlDataAdapter da = new MySqlDataAdapter(); + MySqlCommand cmd; + MySqlParameter parm; + + // Create the SelectCommand. + cmd = new MySqlCommand("SELECT * FROM mytable WHERE id=@id AND name=@name", conn); + + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15); + + da.SelectCommand = cmd; + + // Create the UpdateCommand. + cmd = new MySqlCommand("UPDATE mytable SET id=@id, name=@name WHERE id=@oldId", conn); + cmd.Parameters.Add("@id", MySqlDbType.VarChar, 15, "id" ); + cmd.Parameters.Add("@name", MySqlDbType.VarChar, 15, "name" ); + + parm = cmd.Parameters.Add( "@oldId", MySqlDbType.VarChar, 15, "id" ); + parm.SourceVersion = DataRowVersion.Original; + + da.UpdateCommand = cmd; + + return da; + } + + + + + + Open connection if it was closed. + Necessary to workaround "connection must be open and valid" error + with batched updates. + + Row state + list of opened connections + If connection is opened by this function, the list is updated + + true if connection was opened + + + + Overridden. See . + + + + + + + + + + Overridden. See . + + + + + + + + + + Overridden. Raises the RowUpdating event. + + A MySqlRowUpdatingEventArgs that contains the event data. + + + + Overridden. Raises the RowUpdated event. + + A MySqlRowUpdatedEventArgs that contains the event data. + + + + Asynchronous version of the Fill method. + + The to fill records with. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill records with. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The name of the to use for table mapping. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The name of the to use for table mapping. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The name of the source table to use for table mapping. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The name of the source table to use for table mapping. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + An instance of . + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + An instance of . + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The start record. + The max number of affected records. + The s to fill with records. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The start record. + The max number of affected records. + The cancellation token. + The s to fill with records. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The start record. + The max number of affected records. + The name of the source table to use for table mapping. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The start record. + The max number of affected records. + The name of the source table to use for table mapping. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The name of the source table to use for table mapping. + An instance of . + The start record. + The max number of affected records. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The name of the source table to use for table mapping. + An instance of . + The start record. + The max number of affected records. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The s to fill with records. + The start record. + The max number of affected records. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The number of rows successfully added to or refreshed in the s. + + + + Asynchronous version of the Fill method. + + The s to fill with records. + The start record. + The max number of affected records. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The cancellation token. + The number of rows successfully added to or refreshed in the s. + + + + Asynchronous version of the Fill method. + + The to fill with records. + The start record. + The max number of affected records. + The name of the source table to use for table mapping. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The number of rows successfully added to or refreshed in the . + + + + Asynchronous version of the Fill method. + + The to fill with records. + The start record. + The max number of affected records. + The name of the source table to use for table mapping. + The SQL SELECT statement used to retrieve rows from the data source. + One of the values. + The cancellation token. + The number of rows successfully added to or refreshed in the . + + + + Async version of FillSchema + + DataSet to use + Schema Type + DataTable[] + + + + Async version of FillSchema + + DataSet to use + Schema Type + Source Table + DataTable[] + + + + Async version of FillSchema + + DataSet to use + Schema Type + Source Table + DataReader to use + DataTable[] + + + + Async version of FillSchema + + DataSet to use + Schema Type + DBCommand to use + Source Table + Command Behavior + DataTable[] + + + + Async version of FillSchema + + DataTable to use + Schema Type + DataTable + + + + Async version of FillSchema + + DataTable to use + Schema Type + DataReader to use + DataTable + + + + Async version of FillSchema + + DataTable to use + Schema Type + DBCommand to use + Command Behavior + DataTable + + + + Async version of Update + + DataRow[] to use + int + + + + Async version of Update + + DataSet to use + int + + + + Async version of Update + + DataTable to use + int + + + + Async version of Update + + DataRow[] to use + Data Table Mapping + int + + + + Async version of Update + + DataSet to use + Source Table + + + + + Represents the method that will handle the event of a . + + + + + Represents the method that will handle the event of a . + + + + + Provides data for the RowUpdating event. This class cannot be inherited. + + + + + Initializes a new instance of the MySqlRowUpdatingEventArgs class. + + The to + . + The to execute during . + One of the values that specifies the type of query executed. + The sent through an . + + + + Gets or sets the MySqlCommand to execute when performing the Update. + + + + + Provides data for the RowUpdated event. This class cannot be inherited. + + + + + Initializes a new instance of the MySqlRowUpdatedEventArgs class. + + The sent through an . + The executed when is called. + One of the values that specifies the type of query executed. + The sent through an . + + + + Gets or sets the MySqlCommand executed when Update is called. + + + + + Enables the provider to help ensure that a user has a security level adequate for accessing data. + + + + + Adds a new connection string with set of restricted keywords to the MySqlClientPermission object + + Settings to be used for the connection + Keywords to define the restrictions + KeyRestrictionBehavior to be used + + + + Returns MySqlClientPermission as an IPermission + + + + + + Associates a security action with a custom security attribute. + + + + + Represents a section within a configuration file. + + + + + Gets the MySQL configuations associated to the current configuration. + + + + + Gets a collection of the exception interceptors available in the current configuration. + + + + + Gets a collection of the command interceptors available in the current configuration. + + + + + Gets a collection of the authentication plugins available in the current configuration. + + + + + Gets or sets the replication configurations. + + + + + Defines the configurations allowed for an authentication plugin. + + + + + Gets or sets the name of the authentication plugin. + + + + + Gets or sets the type of the authentication plugin. + + + + + Defines the configurations allowed for an interceptor. + + + + + Gets or sets the name of the interceptor. + + + + + Gets or sets the type of the interceptor. + + + + + Represents a generic configuration element. + + + + + + Gets an enumerator that iterates through the returned list. + + An enumerator that iterates through the returned list. + + + + Helper class that makes it easier to work with the provider. + + + + + Asynchronous version of ExecuteDataRow. + + The settings to be used for the connection. + The command to execute. + The parameters to use for the command. + The DataRow containing the first row of the resultset. + + + + Asynchronous version of ExecuteDataRow. + + The settings to be used for the connection. + The command to execute. + The cancellation token. + The parameters to use for the command. + The DataRow containing the first row of the resultset. + + + + Executes a single SQL command and returns the first row of the resultset. A new MySqlConnection object + is created, opened, and closed during this method. + + Settings to be used for the connection + Command to execute + Parameters to use for the command + DataRow containing the first row of the resultset + + + + Executes a single SQL command and returns the resultset in a . + A new MySqlConnection object is created, opened, and closed during this method. + + Settings to be used for the connection + Command to execute + containing the resultset + + + + Executes a single SQL command and returns the resultset in a . + A new MySqlConnection object is created, opened, and closed during this method. + + Settings to be used for the connection + Command to execute + Parameters to use for the command + containing the resultset + + + + Executes a single SQL command and returns the resultset in a . + The state of the object remains unchanged after execution + of this method. + + object to use + Command to execute + containing the resultset + + + + Executes a single SQL command and returns the resultset in a . + The state of the object remains unchanged after execution + of this method. + + object to use + Command to execute + Parameters to use for the command + containing the resultset + + + + Updates the given table with data from the given + + Settings to use for the update + Command text to use for the update + containing the new data to use in the update + Tablename in the dataset to update + + + + Async version of ExecuteDataset + + Settings to be used for the connection + Command to execute + containing the resultset + + + + Async version of ExecuteDataset + + Settings to be used for the connection + Command to execute + Parameters to use for the command + containing the resultset + + + + Async version of ExecuteDataset + + object to use + Command to execute + containing the resultset + + + + Async version of ExecuteDataset + + object to use + Command to execute + Parameters to use for the command + containing the resultset + + + + Async version of UpdateDataset + + Settings to use for the update + Command text to use for the update + containing the new data to use in the update + Tablename in the dataset to update + + + + Executes a single command against a MySQL database. The is assumed to be + open when the method is called and remains open after the method completes. + + The object to use + The SQL command to be executed. + An array of objects to use with the command. + The number of affected records. + + + + Executes a single command against a MySQL database. + + to use. + The SQL command to be executed. + An rray of objects to use with the command. + The number of affected records. + A new is created using the given. + + + + Executes a single command against a MySQL database, possibly inside an existing transaction. + + object to use for the command + object to use for the command + Command text to use + Array of objects to use with the command + True if the connection should be preserved, false if not + object ready to read the results of the command + + + + Executes a single command against a MySQL database. + + Settings to use for this command + Command text to use + object ready to read the results of the command + + + + Executes a single command against a MySQL database. + + object to use for the command + Command text to use + object ready to read the results of the command + + + + Executes a single command against a MySQL database. + + Settings to use for this command + Command text to use + Array of objects to use with the command + object ready to read the results of the command + + + + Executes a single command against a MySQL database. + + Connection to use for the command + Command text to use + Array of objects to use with the command + object ready to read the results of the command + + + + Execute a single command against a MySQL database. + + Settings to use for the update + Command text to use for the update + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Execute a single command against a MySQL database. + + Settings to use for the command + Command text to use for the command + Parameters to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Execute a single command against a MySQL database. + + object to use + Command text to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Execute a single command against a MySQL database. + + object to use + Command text to use for the command + Parameters to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Escapes the string. + + The string to escape. + The string with all quotes escaped. + + + + Replaces quotes with double quotes. + + The string to modidify. + A string containing double quotes instead of single quotes. + + + + Async version of ExecuteNonQuery + + object to use + SQL command to be executed + Array of objects to use with the command. + Rows affected + + + + Asynchronous version of the ExecuteNonQuery method. + + to use. + The SQL command to be executed. + An array of objects to use with the command. + The number of rows affected. + + + + Asynchronous version of the ExecuteNonQuery method. + + to use. + The SQL command to be executed. + The cancellation token. + An array of objects to use with the command. + The number of rows affected. + + + + Async version of ExecuteReader + + object to use for the command + object to use for the command + Command text to use + Array of objects to use with the command + True if the connection should be preserved, false if not + object ready to read the results of the command + + + + Async version of ExecuteReader + + Settings to use for this command + Command text to use + object ready to read the results of the command + + + + Async version of ExecuteReader + + object to use for the command + Command text to use + object ready to read the results of the command + + + + Async version of ExecuteReader + + Settings to use for this command + Command text to use + Array of objects to use with the command + object ready to read the results of the command + + + + Async version of ExecuteReader + + Connection to use for the command + Command text to use + Array of objects to use with the command + object ready to read the results of the command + + + + Async version of ExecuteScalar + + Settings to use for the update + Command text to use for the update + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Async version of ExecuteScalar + + Settings to use for the command + Command text to use for the command + Parameters to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Async version of ExecuteScalar + + object to use + Command text to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Async version of ExecuteScalar + + object to use + Command text to use for the command + Parameters to use for the command + The first column of the first row in the result set, or a null reference if the result set is empty. + + + + Represents a parameter to a , This class cannot be inherited. + + + + + Gets or sets the to use when loading . + + + + + CLoses this object. + + An object that is a clone of this object. + + + + Initializes a new instance of the class with the parameter name, the , the size, and the source column name. + + The name of the parameter to map. + One of the values. + The length of the parameter. + The name of the source column. + + + + Initializes a new instance of the class with the parameter name and a value of the new MySqlParameter. + + The name of the parameter to map. + An that is the value of the . + + + + Initializes a new instance of the class with the parameter name and the data type. + + The name of the parameter to map. + One of the values. + + + + Initializes a new instance of the class with the parameter name, the , and the size. + + The name of the parameter to map. + One of the values. + The length of the parameter. + + + + Initializes a new instance of the class with the parameter name, the type of the parameter, the size of the parameter, a , the precision of the parameter, the scale of the parameter, the source column, a to use, and the value of the parameter. + + The name of the parameter to map. + One of the values. + The length of the parameter. + One of the values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which is resolved. + The total number of decimal places to which is resolved. + The name of the source column. + One of the values. + An that is the value of the . + + + + + Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. + As of MySql version 4.1 and earlier, input-only is the only valid choice. + + + + + Gets or sets a value indicating whether the parameter accepts null values. + + + + + Gets or sets the of the parameter. + + + + + Gets or sets the maximum number of digits used to represent the property. + + + + + Gets or sets the number of decimal places to which is resolved. + + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + + + + Gets or sets the value of the parameter. + + + + + Returns the possible values for this parameter if this parameter is of type + SET or ENUM. Returns null otherwise. + + + + + Gets or sets the name of the source column that is mapped to the and used for loading or returning the . + + + + + Sets or gets a value which indicates whether the source column is nullable. + This allows to correctly generate Update statements + for nullable columns. + + + + + Gets or sets the of the parameter. + + + + + Overridden. Gets a string containing the . + + + + + + Resets the DbType property to its original settings. + + + + + Represents a collection of parameters relevant to a as well as their respective mappings to columns in a . This class cannot be inherited. + + + The number of the parameters in the collection must be equal to the number of + parameter placeholders within the command text, or an exception will be generated. + + The following example creates multiple instances of + through the MySqlParameterCollection collection within the . + These parameters are used to select data within the data source and place the data in + the . This code assumes that a DataSet and a MySqlDataAdapter + have already been created with the appropriate schema, commands, and connection. + + Public Sub AddParameters() + ' ... + ' create myDataSet and myDataAdapter + ' ... + myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters" + myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239 + + myDataAdapter.Fill(myDataSet) + End Sub 'AddSqlParameters + + + public void AddSqlParameters() + { + // ... + // create myDataSet and myDataAdapter + // ... + + myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters"; + myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239; + myDataAdapter.Fill(myDataSet); + + } + + + + + + Gets a value that indicates whether the + has a fixed size. + + + + + Gets a value that indicates whether the + is read-only. + + + + + Gets a value that indicates whether the + is synchronized. + + + + + Gets the number of MySqlParameter objects in the collection. + + + + + Gets the at the specified index. + + Gets the with a specified attribute. + [C#] In C#, this property is the indexer for the class. + + + + + Gets the with the specified name. + + + + + Adds a to the with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the values. + The length of the column. + The name of the source column. + The newly added object. + + + + Adds the specified object to the . + + The to add to the collection. + The newly added object. + + + + Adds a parameter and its value. + + The name of the parameter. + The value of the parameter. + A object representing the provided values. + + + + Adds a to the given the parameter name and the data type. + + The name of the parameter. + One of the values. + The newly added object. + + + + Adds a to the with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the values. + The length of the column. + The newly added object. + + + + Removes all items from the collection. + + + + + Gets the location of the in the collection with a specific parameter name. + + The name of the object to retrieve. + The zero-based location of the in the collection. + + + + Gets the location of a in the collection. + + The object to locate. + The zero-based location of the in the collection. + Gets the location of a in the collection. + + + + This method will update all the items in the index hashes when + we insert a parameter somewhere in the middle + + + + + + + Adds an array of values to the end of the . + + + + + + Retrieve the parameter with the given name. + + + + + + + Adds the specified object to the . + + The to add to the collection. + The index of the new object. + + + + Gets a value indicating whether a with the specified parameter name exists in the collection. + + The name of the object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets a value indicating whether a MySqlParameter exists in the collection. + + The value of the object to find. + true if the collection contains the object; otherwise, false. + Gets a value indicating whether a exists in the collection. + + + + Copies MySqlParameter objects from the MySqlParameterCollection to the specified array. + + + + + + + Returns an enumerator that iterates through the . + + + + + + Inserts a MySqlParameter into the collection at the specified index. + + + + + + + Removes the specified MySqlParameter from the collection. + + + + + + Removes the specified from the collection using the parameter name. + + The name of the object to retrieve. + + + + Removes the specified from the collection using a specific index. + + The zero-based index of the parameter. + Removes the specified from the collection. + + + + Gets an object that can be used to synchronize access to the + . + + + + + Represents a single(not nested) TransactionScope + + + + + Defines security permissions assigned to a MySQL object. + + + + + Creates a set of permissions. + + A flag indicating if the reflection permission should be included. + A object representing a collection of permissions. + + + + BaseCommandInterceptor is the base class that should be used for all userland + command interceptors + + + + + Gets the active connection. + + + + + Executes an SQL statements that returns a scalar value such as a calculation. + + The SQL statement to execute. + A scalar value that represents the result returned by the execution of the SQL statement. + false. + This method is intended to be overriden. + + + + Executes an SQL statement that returns the number of affected rows. + + The SQL statement to execute. + The number of affected rows. + false. + This method is intended to be overriden. + + + + Executes an SQL statement that will return a resultset. + + The SQL statement to execute. + A value that describes the results of the query and its effect on the database. + A object containing the result of the statement execution. + false. + This method is intended to be overriden. + + + + Sets the active connection. + + The active connection. + + + + CommandInterceptor is the "manager" class that keeps the list of registered interceptors + for the given connection. + + + + + BaseExceptionInterceptor is the base class that should be used for all userland + exception interceptors. + + + + + Returns the received exception. + + The exception to be returned. + The exception originally received. + + + + Gets the active connection. + + + + + Initilizes this object by setting the active connection. + + The connection to become active. + + + + StandardExceptionInterceptor is the standard interceptor that simply returns the exception. + It is the default action. + + + + + Returns the received exception, which is the default action + + The exception to be returned. + The exception originally received. + + + + ExceptionInterceptor is the "manager" class that keeps the list of registered interceptors + for the given connection. + + + + + Interceptor is the base class for the "manager" classes such as ExceptionInterceptor, + CommandInterceptor, etc + + + + + Return schema information about procedures and functions + Restrictions supported are: + schema, name, type + + + + + + + Return schema information about parameters for procedures and functions + Restrictions supported are: + schema, name, type, parameter name + + + + + Initializes a new row for the procedure parameters table. + + + + + Parses out the elements of a procedure parameter data type. + + + + + Implementation of memcached binary client protocol. + + According to http://code.google.com/p/memcached/wiki/BinaryProtocolRevamped + + + + Sends an store command (add, replace, set). + + + + + + + + + + + Sends a get command. + + + + + + + + + Sends a delete command. + + + + + + + + Sends a command without args (like flush). + + + + + + + + Sends a command with amount (INCR/DECR) + + + + + + + + + Encodes in the binary protocol the a command of the kind set, add or replace. + + + + + + + If true applies to set, add or replace commands; if false applies to append and prepend commands. + + + + + An interface of the client memcached protocol. This class is abstract for + implementation of the Memcached client interface see for the + text protocol version and for the binary protocol version. + + + + + The port used by the connection. + + + + + The server DNS or IP address used by the connection. + + + + + The network stream used by the connecition. + + + + + Factory method for creating instances of that implement a connection with the requested features. + The connection object returned must be explicitely opened see method . + + The Memcached server DNS or IP address. + The port for the Memcached server + A set of flags indicating characterestics requested. + An instance of a client connection ready to be used. + + + + Opens the client connection. + + + + + Closes the client connection. + + + + + Adds a new key/value pair with the given TimeSpan expiration. + + The key for identifying the entry. + The data to associate with the key. + The interval of timespan, use TimeSpan.Zero for no expiration. + + + + Appens the data to the existing data for the associated key. + + The key for identifying the entry. + The data to append with the data associated with the key. + + + + Executes the Check-and-set Memcached operation. + + The key for identifying the entry. + The data to use in the CAS. + The interval of timespan, use TimeSpan.Zero for no expiration. + The CAS unique value to use. + + + + + Decrements the value associated with a key by the given amount. + + The key associated with the value to decrement. + The amount to decrement the value. + + + + Removes they pair key/value given the specified key. + + + + + + Removes all entries from the storage, effectively invalidating the whole cache. + + The interval after which the cache will be cleaned. Can be TimeSpan.Zero for immediately. + + + + Get the key/value pair associated with a given key. + + The key for which to returm the key/value. + The key/value associated with the key or a MemcachedException if it does not exists. + + + + Increments the value associated with a key by the given amount. + + The key associated with the value to increment. + The amount to increment the value. + + + + Prepends the data to the existing data for the associated key. + + The key for identifying the entry. + The data to append with the data associated with the key. + + + + Replaces the value associated with the given key with another value. + + The key for identifying the entry. + The data to replace the value associated with the key. + The interval of timespan, use TimeSpan.Zero for no expiration. + + + + Set the value of a given key. + + The key for identifying the entry. + The data to associate with the given key. + The interval of timespan, use TimeSpan.Zero for no expiration. + + + + A set of flags for requesting new instances of connections + + + + + Requests a connection implememting the text protocol. + + + + + Requests a connection implementing the binary protocol. + + + + + Requests a TCP connection. Currently UDP is not supported. + + + + + The base exception class for all Memcached exceptions. + + + + + Implementation of the Memcached text client protocol. + + + + + Sends a command to the memcached server. + + + + + + + This version is for commands that take a key, data, expiration and casUnique. + + + + Sends a command to the memcached server. + + + + + + This version is for commands that take a key, data and expiration + + + + Send a command to memcached server. + + + + + This version is for commands that don't need flags neither expiration fields. + + + + Sends a command to the server. + + + + This version is for commands that only require a key + + + + Sends a command to the server. + + + + + This version is for commands that only require a key and an integer value. + + + + Sends a command to the server. + + + + This version is for commands that only require a key and expiration. + + + + Abstract class that provides common functionality for connection options that apply for all protocols. + + + + + Readonly field containing a collection of protocol shared connection options. + + + + + Gets or sets a flag indicating if the object has access to procedures. + + + + + Gets or sets a dictionary representing key-value pairs for each connection option. + + + + + Gets or sets the name of the server. + + The server. + + + + Gets or sets the name of the database for the initial connection. + + + + + Gets or sets the protocol that should be used for communicating + with MySQL. + + + + + Gets or sets the port number that is used when the socket + protocol is being used. + + + + + Gets or sets a boolean value that indicates whether this connection + should resolve DNS SRV records. + + + + + Gets or sets the user ID that should be used to connect with. + + + + + Gets or sets the password that should be used to make a connection. + + + + + Gets or sets the path to the certificate file to be used. + + + + + Gets or sets the password to be used in conjunction with the certificate file. + + + + + Gets or sets the location to a personal store where a certificate is held. + + + + + Gets or sets a certificate thumbprint to ensure correct identification of a certificate contained within a personal store. + + + + + Indicates whether to use SSL connections and how to handle server certificate errors. + + + + + Sets the TLS versions to use in a SSL connection to the server. + + + Tls version=TLSv1.1,TLSv1.2; + + + + + Gets or sets the path to a local key file in PEM format to use for establishing an encrypted connection. + + + + + Gets or sets the path to a local certificate file in PEM format to use for establishing an encrypted connection. + + + + + Gets or sets the name of the SSH server. + + + + + Gets or sets the port number to use when authenticating to the SSH server. + + + + + Gets or sets the user name to authenticate to the SSH server. + + + + + Gets or sets the password to authenticate to the SSH server. + + + + + Gets or sets the SSH key file to authenticate to the SSH server. + + + + + Gets or sets the passphrase of the key file to authenticate to the SSH server. + + + + + Gets or sets the idle connection time(seconds) for TCP connections. + + + + + Gets or sets the character set that should be used for sending queries to the server. + + + + + Analyzes the connection string for potential duplicated or invalid connection options. + + Connection string. + Flag that indicates if the connection is using X Protocol. + Flag that indicates if the default port is used. + + + + Represents a set of methods for creating instances of the MySQL client implementation of the data source classes. + + + + + Gets an instance of the . + This can be used to retrieve strongly typed data objects. + + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbCommand. + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbConnection. + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbParameter. + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbConnectionStringBuilder. + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbCommandBuilder. + + + + Returns a strongly typed instance. + + A new strongly typed instance of DbDataAdapter. + + + + Provide a simple caching layer + + + + + Aids in the creation of connection strings by exposing the connection options as properties. + Contains connection options specific to the Classic protocol. + + + + + Main constructor. + + + + + Constructor accepting a connection string. + + The connection string. + + + + Readonly field containing a collection of classic protocol and protocol shared connection options. + + + + + Gets or sets the name of the named pipe that should be used + for communicating with MySQL. + + + + + Gets or sets a boolean value that indicates whether this connection + should use compression. + + + + + Gets or sets a boolean value that indicates whether this connection will allow + commands to send multiple SQL statements in one execution. + + + + + Gets or sets a boolean value that indicates whether logging is enabled. + + + + + Gets or sets the base name of the shared memory objects used to + communicate with MySQL when the shared memory protocol is being used. + + + + + Gets or sets the default command timeout. + + + + + Gets or sets the connection timeout. + + + + + Gets or sets a boolean value that indicates whether this connection will allow + to load data local infile. + + + + + Gets or sets a boolean value that indicates if the password should be persisted + in the connection string. + + + + + Gets or sets a boolean value that indicates if the connection should be encrypted. + + Obsolte. Use instead. + + + + Gets or sets a boolean value that indicates if RSA public keys should be retrieved from the server. + + This option is only relevant when SSL is disabled. Setting this option to true in + 8.0 servers that have the caching_sha2_password authentication plugin as the default plugin will + cause the connection attempt to fail if the user hasn't successfully connected to the server on a + previous occasion. + + + + Gets or sets a boolean value that indicates if zero date time values are supported. + + Default value is false. + + + + Gets or sets a boolean value that indicates if zero datetime values should be + converted to DateTime.MinValue. + + Default value is false. + + + + Gets or sets a boolean value that indicates if the Usage Advisor should be enabled. + + Default value is false. + + + + Gets or sets the size of the stored procedure cache. + + Default value is 25. + + + + Gets or sets a boolean value that indicates if the performance monitor hooks should be enabled. + + Default value is false. + + + + Gets or sets a boolean value that indicates if calls to the Prepare method should be ignored. + + Default value is false. + + + + Gets or sets a boolean value that indicates if an opened connection should particiapte in the current scope. + + Default value is true. + + + + Gets or sets a boolean value that indicates if security asserts must be included. + + Must be set to true when using the class in a partial trust environment, + with the library installed in the GAC of the hosting environment. Not supported in .NET Core. + Default value is false. + + + + Gets or sets a boolean value that indicates if column binary flags set by the server are ignored. + + Default value is true. + + + + Gets or sets a boolean value that indicates if TINYINT(1) shound be treated as a BOOLEAN. + + Default value is true. + + + + Gets or sets a boolean value that indicates if the provider expects user variables in the SQL. + + Default value is false. + + + + Gets or sets a boolean value that indicates if the session should be interactive. + + Default value is false. + + + + Gets or sets a boolean value that indicates if server functions should be treated as returning a string. + + Default value is false. + + + + Gets or sets a boolean value that indicates if the server should report affected rows instead of found rows. + + Default value is false. + + + + Gets or sets a boolean value that indicates if items of data type BINARY(16) should be treated as guids. + + Default value is false. + + + + Gets or sets a boolean value that indicates if SQL Server syntax should be allowed by supporting square brackets + around symbols instead of backticks. + + Default value is false. + + + + Gets or sets a boolean value that indicates if caching of TableDirect commands is enabled. + + Default value is false. + + + + Gets or sets the seconds for how long a TableDirect result should be cached. + + Default value is 0. + + + + Gets or sets a boolean value that indicates if stored routine parameters should be checked against the server. + + Default value is true. + + + + Gets or sets a boolean value that indicates if this connection will use replication. + + Default value is false. + + + + Gets or sets the list of interceptors that can triage thrown MySqlExceptions. + + + + + Gets or sets the list of interceptors that can intercept command operations. + + + + + Gets or sets the lifetime of a pooled connection. + + Default value is 0. + + + + Gets or sets a boolean value indicating if connection pooling is enabled. + + Default value is true. + + + + Gets the minimum connection pool size. + + Default value is 0. + + + + Gets or sets the maximum connection pool setting. + + Default value is 100. + + + + Gets or sets a boolean value that indicates if the connection should be reset when retrieved + from the pool. + + Default value is false. + + + + Gets or sets a boolean value that indicates whether the server variable settings are updated by a + SHOW VARIABLES command each time a pooled connection is returned. + + Default value is false. + + + + Indicates whether the driver should treat binary BLOBs as UTF8. + + Default value is false. + + + + Gets or sets the pattern to match for the columns that should be treated as UTF8. + + + + + Gets or sets the pattern to match for the columns that should not be treated as UTF8. + + + + + Gets or sets a connection option. + + The keyword that identifies the connection option to modify. + + + + Summary description for ClientParam. + + + + + DB Operations Code + + + + + Specifies MySQL specific data type of a field, property, for use in a . + + + + + + A fixed precision and scale numeric value between -1038 + -1 and 10 38 -1. + + + + + The signed range is -128 to 127. The unsigned + range is 0 to 255. + + + + + A 16-bit signed integer. The signed range is + -32768 to 32767. The unsigned range is 0 to 65535 + + + + + Specifies a 24 (3 byte) signed or unsigned value. + + + + + A 32-bit signed integer + + + + + A 64-bit signed integer. + + + + + A small (single-precision) floating-point + number. Allowable values are -3.402823466E+38 to -1.175494351E-38, + 0, and 1.175494351E-38 to 3.402823466E+38. + + + + + A normal-size (double-precision) + floating-point number. Allowable values are -1.7976931348623157E+308 + to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to + 1.7976931348623157E+308. + + + + + A timestamp. The range is '1970-01-01 00:00:00' to sometime in the + year 2037 + + + + + Date The supported range is '1000-01-01' to '9999-12-31'. + + + + + Time The range is '-838:59:59' to '838:59:59'. + + + + + DateTime The supported range is '1000-01-01 00:00:00' to + '9999-12-31 23:59:59'. + + + + + Datetime The supported range is '1000-01-01 00:00:00' to + '9999-12-31 23:59:59'. + + + + + A year in 2- or 4-digit format (default is 4-digit). The + allowable values are 1901 to 2155, 0000 in the 4-digit year + format, and 1970-2069 if you use the 2-digit format (70-69). + + + + + Obsolete Use Datetime or Date type + + + + + A variable-length string containing 0 to 65535 characters + + + + + Bit-field data type + + + + + JSON + + + + + New Decimal + + + + + An enumeration. A string object that can have only one value, + chosen from the list of values 'value1', 'value2', ..., NULL + or the special "" error value. An ENUM can have a maximum of + 65535 distinct values + + + + + A set. A string object that can have zero or more values, each + of which must be chosen from the list of values 'value1', 'value2', + ... A SET can have a maximum of 64 members. + + + + + A binary column with a maximum length of 255 (2^8 - 1) + characters + + + + + A binary column with a maximum length of 16777215 (2^24 - 1) bytes. + + + + + A binary column with a maximum length of 4294967295 or + 4G (2^32 - 1) bytes. + + + + + A binary column with a maximum length of 65535 (2^16 - 1) bytes. + + + + + A variable-length string containing 0 to 255 bytes. + + + + + A fixed-length string. + + + + + Geometric (GIS) data type. + + + + + Unsigned 8-bit value. + + + + + Unsigned 16-bit value. + + + + + Unsigned 24-bit value. + + + + + Unsigned 32-bit value. + + + + + Unsigned 64-bit value. + + + + + Fixed length binary string. + + + + + Variable length binary string. + + + + + A text column with a maximum length of 255 (2^8 - 1) characters. + + + + + A text column with a maximum length of 16777215 (2^24 - 1) characters. + + + + + A text column with a maximum length of 4294967295 or + 4G (2^32 - 1) characters. + + + + + A text column with a maximum length of 65535 (2^16 - 1) characters. + + + + + A guid column. + + + + + Allows the user to specify the type of connection that should + be used. + + + + + TCP/IP style connection. Works everywhere. + + + + + TCP/IP style connection. Works everywhere. + + + + + TCP/IP style connection. Works everywhere. + + + + + Named pipe connection. Works only on Windows systems. + + + + + Named pipe connection. Works only on Windows systems. + + + + + Unix domain socket connection. Works only with Unix systems. + + + + + Unix domain socket connection. Works only with Unix systems. + + + + + Shared memory connection. Currently works only with Windows systems. + + + + + Shared memory connection. Currently works only with Windows systems. + + + + + SSL options for connection. + + + + + Do not use SSL. + + + + + Use SSL, if server supports it. This option is only available for the classic protocol. + + + + + Always use SSL. Deny connection if server does not support SSL. + Do not perform server certificate validation. + This is the default SSL mode when the same isn't specified as part of the connection string. + + + + + Always use SSL. Validate server SSL certificate, but different host name mismatch. + + + + + Always use SSL and perform full certificate validation. + + + + + Specifies the connection types supported + + + + + Use TCP/IP sockets. + + + + + Use client library. + + + + + Use MySQL embedded server. + + + + + Defines the location of the certificate store. + + + + + Do not use certificate store. + + + + + Use certificate store for the current user. + + + + + User certificate store for the machine. + + + + + Specifies the authentication mechanism that should be used. + + + + + If SSL is enabled or Unix sockets are being used, sets PLAIN as the authentication mechanism; + otherwise, it tries to use MYSQL41 and then SHA256_MEMORY. + + + + + Authenticate using PLAIN. + + + + + Authenticate using MYSQL41. + + + + + Authenticate using EXTERNAL. + + + + + Authenticate using SHA256_MEMORY. + + + + + Defines waiting options that may be used with row locking options. + + + + + Waits until the blocking transaction releases the row lock. + + + + + Never waits to acquire a row lock. The query executes immediately, + failing with an error if a requested row is locked. + + + + + Never waits to acquire a row lock. The query executes immediately, + removing locked rows from the result set. + + + + + Defines the type of compression used when data is exchanged between client and server. + + + + + Uses compression if client and server are able to reach a concensus. Otherwise, compression + is not used. + + + + + Enforces the use of compression. If no concensus is reached, an error is raised. + + + + + Disables compression. + + + + + Collection of error codes that can be returned by the server + + + + + + + + + + + Error level + + + + + Error code + + + + + Error message + + + + + Provides a reference to error codes returned by MySQL. + + + + + ER_HASHCHK + + + + ER_NISAMCHK + + + + ER_NO + + + + ER_YES + + + The file couldn't be created. + ER_CANT_CREATE_FILE + + + The table couldn't be created. + ER_CANT_CREATE_TABLE + + + The database couldn't be created. + ER_CANT_CREATE_DB + + + The database couldn't be created, it already exists. + ER_DB_CREATE_EXISTS + + + The database couldn't be dropped, it doesn't exist. + ER_DB_DROP_EXISTS + + + The database couldn't be dropped, the file can't be deleted. + ER_DB_DROP_DELETE + + + The database couldn't be dropped, the directory can't be deleted. + ER_DB_DROP_RMDIR + + + The file couldn't be deleted. + ER_CANT_DELETE_FILE + + + The record couldn't be read from the system table. + ER_CANT_FIND_SYSTEM_REC + + + The status couldn't be retrieved. + ER_CANT_GET_STAT + + + The working directory couldn't be retrieved. + ER_CANT_GET_WD + + + The file couldn't be locked. + ER_CANT_LOCK + + + The file couldn't be opened. + ER_CANT_OPEN_FILE + + + The file couldn't be found. + ER_FILE_NOT_FOUND + + + The directory couldn't be read. + ER_CANT_READ_DIR + + + The working directory couldn't be entered. + ER_CANT_SET_WD + + + The record changed since it was last read. + ER_CHECKREAD + + + The disk is full. + ER_DISK_FULL + + + + There is already a key with the given values. + + + + An error occurred when closing the file. + ER_ERROR_ON_CLOSE + + + An error occurred when reading from the file. + ER_ERROR_ON_READ + + + An error occurred when renaming then file. + ER_ERROR_ON_RENAME + + + An error occurred when writing to the file. + ER_ERROR_ON_WRITE + + + The file is in use. + ER_FILE_USED + + + Sorting has been aborted. + ER_FILSORT_ABORT + + + The view doesn't exist. + ER_FORM_NOT_FOUND + + + Got the specified error from the table storage engine. + ER_GET_ERRNO + + + The table storage engine doesn't support the specified option. + ER_ILLEGAL_HA + + + + The specified key was not found. + + + + The file contains incorrect information. + ER_NOT_FORM_FILE + + + The key file is incorrect for the table, it should be repaired. + ER_NOT_KEYFILE + + + The key file is old for the table, it should be repaired. + ER_OLD_KEYFILE + + + The table is read-only + ER_OPEN_AS_READONLY + + + The server is out of memory, it should be restarted. + ER_OUTOFMEMORY + + + The server is out of sort-memory, the sort buffer size should be increased. + ER_OUT_OF_SORTMEMORY + + + An unexpected EOF was found when reading from the file. + ER_UNEXPECTED_EOF + + + Too many connections are open. + ER_CON_COUNT_ERROR + + + The server is out of resources, check if MySql or some other process is using all available memory. + ER_OUT_OF_RESOURCES + + + + Given when the connection is unable to successfully connect to host. + + + + The handshake was invalid. + ER_HANDSHAKE_ERROR + + + Access was denied for the specified user using the specified database. + ER_DBACCESS_DENIED_ERROR + + + + Normally returned when an incorrect password is given + + + + No database has been selected. + ER_NO_DB_ERROR + + + The command is unknown. + ER_UNKNOWN_COM_ERROR + + + The specified column cannot be NULL. + ER_BAD_NULL_ERROR + + + The specified database is not known. + + + The specified table already exists. + ER_TABLE_EXISTS_ERROR + + + The specified table is unknown. + ER_BAD_TABLE_ERROR + + + The specified column is ambiguous. + ER_NON_UNIQ_ERROR + + + The server is currently being shutdown. + ER_SERVER_SHUTDOWN + + + The specified columns is unknown. + ER_BAD_FIELD_ERROR + + + The specified column isn't in GROUP BY. + ER_WRONG_FIELD_WITH_GROUP + + + The specified columns cannot be grouped on. + ER_WRONG_GROUP_FIELD + + + There are sum functions and columns in the same statement. + ER_WRONG_SUM_SELECT + + + The column count doesn't match the value count. + ER_WRONG_VALUE_COUNT + + + The identifier name is too long. + ER_TOO_LONG_IDENT + + + The column name is duplicated. + ER_DUP_FIELDNAME + + + + Duplicate Key Name + + + + + Duplicate Key Entry + + + + The column specifier is incorrect. + ER_WRONG_FIELD_SPEC + + + An error occurred when parsing the statement. + ER_PARSE_ERROR + + + The statement is empty. + ER_EMPTY_QUERY + + + The table alias isn't unique. + ER_NONUNIQ_TABLE + + + The default value is invalid for the specified field. + ER_INVALID_DEFAULT + + + The table has multiple primary keys defined. + ER_MULTIPLE_PRI_KEY + + + Too many keys were defined for the table. + ER_TOO_MANY_KEYS + + + Too many parts to the keys were defined for the table. + ER_TOO_MANY_KEY_PARTS + + + The specified key is too long + ER_TOO_LONG_KEY + + + The specified key column doesn't exist in the table. + ER_KEY_COLUMN_DOES_NOT_EXITS + + + The BLOB column was used as a key, this can't be done. + ER_BLOB_USED_AS_KEY + + + The column length is too big for the specified column type. + ER_TOO_BIG_FIELDLENGTH + + + There can only be one auto-column, and it must be defined as a PK. + ER_WRONG_AUTO_KEY + + + The server is ready to accept connections. + ER_READY + + + + ER_NORMAL_SHUTDOWN + + + The server received the specified signal and is aborting. + ER_GOT_SIGNAL + + + The server shutdown is complete. + ER_SHUTDOWN_COMPLETE + + + The server is forcing close of the specified thread. + ER_FORCING_CLOSE + + + An error occurred when creating the IP socket. + ER_IPSOCK_ERROR + + + The table has no index like the one used in CREATE INDEX. + ER_NO_SUCH_INDEX + + + The field separator argument is not what is expected, check the manual. + ER_WRONG_FIELD_TERMINATORS + + + The BLOB columns must terminated, fixed row lengths cannot be used. + ER_BLOBS_AND_NO_TERMINATED + + + The text file cannot be read. + ER_TEXTFILE_NOT_READABLE + + + The specified file already exists. + ER_FILE_EXISTS_ERROR + + + Information returned by the LOAD statement. + ER_LOAD_INFO + + + Information returned by an UPDATE statement. + ER_ALTER_INFO + + + The prefix key is incorrect. + ER_WRONG_SUB_KEY + + + All columns cannot be removed from a table, use DROP TABLE instead. + ER_CANT_REMOVE_ALL_FIELDS + + + Cannot DROP, check that the column or key exists. + ER_CANT_DROP_FIELD_OR_KEY + + + Information returned by an INSERT statement. + ER_INSERT_INFO + + + The target table cannot be specified for update in FROM clause. + ER_UPDATE_TABLE_USED + + + The specified thread ID is unknown. + ER_NO_SUCH_THREAD + + + The thread cannot be killed, the current user is not the owner. + ER_KILL_DENIED_ERROR + + + No tables used in the statement. + ER_NO_TABLES_USED + + + Too many string have been used for the specified column and SET. + ER_TOO_BIG_SET + + + A unique filename couldn't be generated. + ER_NO_UNIQUE_LOGFILE + + + The specified table was locked with a READ lock, and can't be updated. + ER_TABLE_NOT_LOCKED_FOR_WRITE + + + The specified table was not locked with LOCK TABLES. + ER_TABLE_NOT_LOCKED + + + BLOB and Text columns cannot have a default value. + ER_BLOB_CANT_HAVE_DEFAULT + + + The specified database name is incorrect. + ER_WRONG_DB_NAME + + + The specified table name is incorrect. + ER_WRONG_TABLE_NAME + + + The SELECT command would examine more than MAX_JOIN_SIZE rows, check the WHERE clause and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok. + ER_TOO_BIG_SELECT + + + An unknown error occurred. + ER_UNKNOWN_ERROR + + + The specified procedure is unknown. + ER_UNKNOWN_PROCEDURE + + + The number of parameters provided for the specified procedure is incorrect. + ER_WRONG_PARAMCOUNT_TO_PROCEDURE + + + The parameters provided for the specified procedure are incorrect. + ER_WRONG_PARAMETERS_TO_PROCEDURE + + + The specified table is unknown. + ER_UNKNOWN_TABLE + + + The specified column has been specified twice. + ER_FIELD_SPECIFIED_TWICE + + + The group function has been incorrectly used. + ER_INVALID_GROUP_FUNC_USE + + + The specified table uses an extension that doesn't exist in this MySQL version. + ER_UNSUPPORTED_EXTENSION + + + The table must have at least one column. + ER_TABLE_MUST_HAVE_COLUMNS + + + The specified table is full. + ER_RECORD_FILE_FULL + + + The specified character set is unknown. + ER_UNKNOWN_CHARACTER_SET + + + Too many tables, MySQL can only use the specified number of tables in a JOIN. + ER_TOO_MANY_TABLES + + + Too many columns + ER_TOO_MANY_FIELDS + + + The row size is too large, the maximum row size for the used tables (not counting BLOBS) is specified, change some columns or BLOBS. + ER_TOO_BIG_ROWSIZE + + + A thread stack overrun occurred. Stack statistics are specified. + ER_STACK_OVERRUN + + + A cross dependency was found in the OUTER JOIN, examine the ON conditions. + ER_WRONG_OUTER_JOIN + + + The table handler doesn't support NULL in the given index, change specified column to be NOT NULL or use another handler. + ER_NULL_COLUMN_IN_INDEX + + + The specified user defined function cannot be loaded. + ER_CANT_FIND_UDF + + + The specified user defined function cannot be initialised. + ER_CANT_INITIALIZE_UDF + + + No paths are allowed for the shared library. + ER_UDF_NO_PATHS + + + The specified user defined function already exists. + ER_UDF_EXISTS + + + The specified shared library cannot be opened. + ER_CANT_OPEN_LIBRARY + + + The specified symbol cannot be found in the library. + ER_CANT_FIND_DL_ENTRY + + + The specified function is not defined. + ER_FUNCTION_NOT_DEFINED + + + The specified host is blocked because of too many connection errors, unblock with 'mysqladmin flush-hosts'. + ER_HOST_IS_BLOCKED + + + + The given host is not allowed to connect + + + + + The anonymous user is not allowed to connect + + + + + The given password is not allowed + + + + + The given password does not match + + + + Information returned by an UPDATE statement. + ER_UPDATE_INFO + + + A new thread couldn't be created. + ER_CANT_CREATE_THREAD + + + The column count doesn't match the value count. + ER_WRONG_VALUE_COUNT_ON_ROW + + + The specified table can't be re-opened. + ER_CANT_REOPEN_TABLE + + + The NULL value has been used incorrectly. + ER_INVALID_USE_OF_NULL + + + The regular expression contains an error. + ER_REGEXP_ERROR + + + GROUP columns (MIN(), MAX(), COUNT(), ...) cannot be mixes with no GROUP columns if there is not GROUP BY clause. + ER_MIX_OF_GROUP_FUNC_AND_FIELDS + + + + ER_NONEXISTING_GRANT + + + + ER_TABLEACCESS_DENIED_ERROR + + + + ER_COLUMNACCESS_DENIED_ERROR + + + + ER_ILLEGAL_GRANT_FOR_TABLE + + + + ER_GRANT_WRONG_HOST_OR_USER + + + + ER_NO_SUCH_TABLE + + + + ER_NONEXISTING_TABLE_GRANT + + + + ER_NOT_ALLOWED_COMMAND + + + + ER_SYNTAX_ERROR + + + + ER_DELAYED_CANT_CHANGE_LOCK + + + + ER_TOO_MANY_DELAYED_THREADS + + + + ER_ABORTING_CONNECTION + + + + An attempt was made to send or receive a packet larger than + max_allowed_packet_size + + + + + ER_NET_READ_ERROR_FROM_PIPE + + + + ER_NET_FCNTL_ERROR + + + + ER_NET_PACKETS_OUT_OF_ORDER + + + + ER_NET_UNCOMPRESS_ERROR + + + + ER_NET_READ_ERROR + + + + ER_NET_READ_INTERRUPTED + + + + ER_NET_ERROR_ON_WRITE + + + + ER_NET_WRITE_INTERRUPTED + + + + ER_TOO_LONG_STRING + + + + ER_TABLE_CANT_HANDLE_BLOB + + + + ER_TABLE_CANT_HANDLE_AUTO_INCREMENT + + + + ER_DELAYED_INSERT_TABLE_LOCKED + + + + ER_WRONG_COLUMN_NAME + + + + ER_WRONG_KEY_COLUMN + + + + ER_WRONG_MRG_TABLE + + + + ER_DUP_UNIQUE + + + + ER_BLOB_KEY_WITHOUT_LENGTH + + + + ER_PRIMARY_CANT_HAVE_NULL + + + + ER_TOO_MANY_ROWS + + + + ER_REQUIRES_PRIMARY_KEY + + + + ER_NO_RAID_COMPILED + + + + ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE + + + + ER_KEY_DOES_NOT_EXITS + + + + ER_CHECK_NO_SUCH_TABLE + + + + ER_CHECK_NOT_IMPLEMENTED + + + + ER_CANT_DO_THIS_DURING_AN_TRANSACTION + + + + ER_ERROR_DURING_COMMIT + + + + ER_ERROR_DURING_ROLLBACK + + + + ER_ERROR_DURING_FLUSH_LOGS + + + + ER_ERROR_DURING_CHECKPOINT + + + + ER_NEW_ABORTING_CONNECTION + + + + ER_DUMP_NOT_IMPLEMENTED + + + + ER_FLUSH_MASTER_BINLOG_CLOSED + + + + ER_INDEX_REBUILD + + + + ER_MASTER + + + + ER_MASTER_NET_READ + + + + ER_MASTER_NET_WRITE + + + + ER_FT_MATCHING_KEY_NOT_FOUND + + + + ER_LOCK_OR_ACTIVE_TRANSACTION + + + + ER_UNKNOWN_SYSTEM_VARIABLE + + + + ER_CRASHED_ON_USAGE + + + + ER_CRASHED_ON_REPAIR + + + + ER_WARNING_NOT_COMPLETE_ROLLBACK + + + + ER_TRANS_CACHE_FULL + + + + ER_SLAVE_MUST_STOP + + + + ER_SLAVE_NOT_RUNNING + + + + ER_BAD_SLAVE + + + + ER_MASTER_INFO + + + + ER_SLAVE_THREAD + + + + ER_TOO_MANY_USER_CONNECTIONS + + + + ER_SET_CONSTANTS_ONLY + + + + ER_LOCK_WAIT_TIMEOUT + + + + ER_LOCK_TABLE_FULL + + + + ER_READ_ONLY_TRANSACTION + + + + ER_DROP_DB_WITH_READ_LOCK + + + + ER_CREATE_DB_WITH_READ_LOCK + + + + ER_WRONG_ARGUMENTS + + + + ER_NO_PERMISSION_TO_CREATE_USER + + + + ER_UNION_TABLES_IN_DIFFERENT_DIR + + + + ER_LOCK_DEADLOCK + + + + ER_TABLE_CANT_HANDLE_FT + + + + ER_CANNOT_ADD_FOREIGN + + + + ER_NO_REFERENCED_ROW + + + + ER_ROW_IS_REFERENCED + + + + ER_CONNECT_TO_MASTER + + + + ER_QUERY_ON_MASTER + + + + ER_ERROR_WHEN_EXECUTING_COMMAND + + + + ER_WRONG_USAGE + + + + ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT + + + + ER_CANT_UPDATE_WITH_READLOCK + + + + ER_MIXING_NOT_ALLOWED + + + + ER_DUP_ARGUMENT + + + + ER_USER_LIMIT_REACHED + + + + ER_SPECIFIC_ACCESS_DENIED_ERROR + + + + ER_LOCAL_VARIABLE + + + + ER_GLOBAL_VARIABLE + + + + ER_NO_DEFAULT + + + + ER_WRONG_VALUE_FOR_VAR + + + + ER_WRONG_TYPE_FOR_VAR + + + + ER_VAR_CANT_BE_READ + + + + ER_CANT_USE_OPTION_HERE + + + + ER_NOT_SUPPORTED_YET + + + + ER_MASTER_FATAL_ERROR_READING_BINLOG + + + + ER_SLAVE_IGNORED_TABLE + + + + ER_INCORRECT_GLOBAL_LOCAL_VAR + + + + ER_WRONG_FK_DEF + + + + ER_KEY_REF_DO_NOT_MATCH_TABLE_REF + + + + ER_OPERAND_COLUMNS + + + + ER_SUBQUERY_NO_1_ROW + + + + ER_UNKNOWN_STMT_HANDLER + + + + ER_CORRUPT_HELP_DB + + + + ER_CYCLIC_REFERENCE + + + + ER_AUTO_CONVERT + + + + ER_ILLEGAL_REFERENCE + + + + ER_DERIVED_MUST_HAVE_ALIAS + + + + ER_SELECT_REDUCED + + + + ER_TABLENAME_NOT_ALLOWED_HERE + + + + ER_NOT_SUPPORTED_AUTH_MODE + + + + ER_SPATIAL_CANT_HAVE_NULL + + + + ER_COLLATION_CHARSET_MISMATCH + + + + ER_SLAVE_WAS_RUNNING + + + + ER_SLAVE_WAS_NOT_RUNNING + + + + ER_TOO_BIG_FOR_UNCOMPRESS + + + + ER_ZLIB_Z_MEM_ERROR + + + + ER_ZLIB_Z_BUF_ERROR + + + + ER_ZLIB_Z_DATA_ERROR + + + + ER_CUT_VALUE_GROUP_CONCAT + + + + ER_WARN_TOO_FEW_RECORDS + + + + ER_WARN_TOO_MANY_RECORDS + + + + ER_WARN_NULL_TO_NOTNULL + + + + ER_WARN_DATA_OUT_OF_RANGE + + + + WARN_DATA_TRUNCATED + + + + ER_WARN_USING_OTHER_HANDLER + + + + ER_CANT_AGGREGATE_2COLLATIONS + + + + ER_DROP_USER + + + + ER_REVOKE_GRANTS + + + + ER_CANT_AGGREGATE_3COLLATIONS + + + + ER_CANT_AGGREGATE_NCOLLATIONS + + + + ER_VARIABLE_IS_NOT_STRUCT + + + + ER_UNKNOWN_COLLATION + + + + ER_SLAVE_IGNORED_SSL_PARAMS + + + + ER_SERVER_IS_IN_SECURE_AUTH_MODE + + + + ER_WARN_FIELD_RESOLVED + + + + ER_BAD_SLAVE_UNTIL_COND + + + + ER_MISSING_SKIP_SLAVE + + + + ER_UNTIL_COND_IGNORED + + + + ER_WRONG_NAME_FOR_INDEX + + + + ER_WRONG_NAME_FOR_CATALOG + + + + ER_WARN_QC_RESIZE + + + + ER_BAD_FT_COLUMN + + + + ER_UNKNOWN_KEY_CACHE + + + + ER_WARN_HOSTNAME_WONT_WORK + + + + ER_UNKNOWN_STORAGE_ENGINE + + + + ER_WARN_DEPRECATED_SYNTAX + + + + ER_NON_UPDATABLE_TABLE + + + + ER_FEATURE_DISABLED + + + + ER_OPTION_PREVENTS_STATEMENT + + + + ER_DUPLICATED_VALUE_IN_TYPE + + + + ER_TRUNCATED_WRONG_VALUE + + + + ER_TOO_MUCH_AUTO_TIMESTAMP_COLS + + + + ER_INVALID_ON_UPDATE + + + + ER_UNSUPPORTED_PS + + + + ER_GET_ERRMSG + + + + ER_GET_TEMPORARY_ERRMSG + + + + ER_UNKNOWN_TIME_ZONE + + + + ER_WARN_INVALID_TIMESTAMP + + + + ER_INVALID_CHARACTER_STRING + + + + ER_WARN_ALLOWED_PACKET_OVERFLOWED + + + + ER_CONFLICTING_DECLARATIONS + + + + ER_SP_NO_RECURSIVE_CREATE + + + + ER_SP_ALREADY_EXISTS + + + + ER_SP_DOES_NOT_EXIST + + + + ER_SP_DROP_FAILED + + + + ER_SP_STORE_FAILED + + + + ER_SP_LILABEL_MISMATCH + + + + ER_SP_LABEL_REDEFINE + + + + ER_SP_LABEL_MISMATCH + + + + ER_SP_UNINIT_VAR + + + + ER_SP_BADSELECT + + + + ER_SP_BADRETURN + + + + ER_SP_BADSTATEMENT + + + + ER_UPDATE_LOG_DEPRECATED_IGNORED + + + + ER_UPDATE_LOG_DEPRECATED_TRANSLATED + + + + ER_QUERY_INTERRUPTED + + + + ER_SP_WRONG_NO_OF_ARGS + + + + ER_SP_COND_MISMATCH + + + + ER_SP_NORETURN + + + + ER_SP_NORETURNEND + + + + ER_SP_BAD_CURSOR_QUERY + + + + ER_SP_BAD_CURSOR_SELECT + + + + ER_SP_CURSOR_MISMATCH + + + + ER_SP_CURSOR_ALREADY_OPEN + + + + ER_SP_CURSOR_NOT_OPEN + + + + ER_SP_UNDECLARED_VAR + + + + ER_SP_WRONG_NO_OF_FETCH_ARGS + + + + ER_SP_FETCH_NO_DATA + + + + ER_SP_DUP_PARAM + + + + ER_SP_DUP_VAR + + + + ER_SP_DUP_COND + + + + ER_SP_DUP_CURS + + + + ER_SP_CANT_ALTER + + + + ER_SP_SUBSELECT_NYI + + + + ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG + + + + ER_SP_VARCOND_AFTER_CURSHNDLR + + + + ER_SP_CURSOR_AFTER_HANDLER + + + + ER_SP_CASE_NOT_FOUND + + + + ER_FPARSER_TOO_BIG_FILE + + + + ER_FPARSER_BAD_HEADER + + + + ER_FPARSER_EOF_IN_COMMENT + + + + ER_FPARSER_ERROR_IN_PARAMETER + + + + ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER + + + + ER_VIEW_NO_EXPLAIN + + + + ER_FRM_UNKNOWN_TYPE + + + + ER_WRONG_OBJECT + + + + ER_NONUPDATEABLE_COLUMN + + + + ER_VIEW_SELECT_DERIVED + + + + ER_VIEW_SELECT_CLAUSE + + + + ER_VIEW_SELECT_VARIABLE + + + + ER_VIEW_SELECT_TMPTABLE + + + + ER_VIEW_WRONG_LIST + + + + ER_WARN_VIEW_MERGE + + + + ER_WARN_VIEW_WITHOUT_KEY + + + + ER_VIEW_INVALID + + + + ER_SP_NO_DROP_SP + + + + ER_SP_GOTO_IN_HNDLR + + + + ER_TRG_ALREADY_EXISTS + + + + ER_TRG_DOES_NOT_EXIST + + + + ER_TRG_ON_VIEW_OR_TEMP_TABLE + + + + ER_TRG_CANT_CHANGE_ROW + + + + ER_TRG_NO_SUCH_ROW_IN_TRG + + + + ER_NO_DEFAULT_FOR_FIELD + + + + ER_DIVISION_BY_ZERO + + + + ER_TRUNCATED_WRONG_VALUE_FOR_FIELD + + + + ER_ILLEGAL_VALUE_FOR_TYPE + + + + ER_VIEW_NONUPD_CHECK + + + + ER_VIEW_CHECK_FAILED + + + + ER_PROCACCESS_DENIED_ERROR + + + + ER_RELAY_LOG_FAIL + + + + ER_PASSWD_LENGTH + + + + ER_UNKNOWN_TARGET_BINLOG + + + + ER_IO_ERR_LOG_INDEX_READ + + + + ER_BINLOG_PURGE_PROHIBITED + + + + ER_FSEEK_FAIL + + + + ER_BINLOG_PURGE_FATAL_ERR + + + + ER_LOG_IN_USE + + + + ER_LOG_PURGE_UNKNOWN_ERR + + + + ER_RELAY_LOG_INIT + + + + ER_NO_BINARY_LOGGING + + + + ER_RESERVED_SYNTAX + + + + ER_WSAS_FAILED + + + + ER_DIFF_GROUPS_PROC + + + + ER_NO_GROUP_FOR_PROC + + + + ER_ORDER_WITH_PROC + + + + ER_LOGGING_PROHIBIT_CHANGING_OF + + + + ER_NO_FILE_MAPPING + + + + ER_WRONG_MAGIC + + + + ER_PS_MANY_PARAM + + + + ER_KEY_PART_0 + + + + ER_VIEW_CHECKSUM + + + + ER_VIEW_MULTIUPDATE + + + + ER_VIEW_NO_INSERT_FIELD_LIST + + + + ER_VIEW_DELETE_MERGE_VIEW + + + + ER_CANNOT_USER + + + + ER_XAER_NOTA + + + + ER_XAER_INVAL + + + + ER_XAER_RMFAIL + + + + ER_XAER_OUTSIDE + + + + ER_XAER_RMERR + + + + ER_XA_RBROLLBACK + + + + ER_NONEXISTING_PROC_GRANT + + + + ER_PROC_AUTO_GRANT_FAIL + + + + ER_PROC_AUTO_REVOKE_FAIL + + + + ER_DATA_TOO_LONG + + + + ER_SP_BAD_SQLSTATE + + + + ER_STARTUP + + + + ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR + + + + ER_CANT_CREATE_USER_WITH_GRANT + + + + ER_WRONG_VALUE_FOR_TYPE + + + + ER_TABLE_DEF_CHANGED + + + + ER_SP_DUP_HANDLER + + + + ER_SP_NOT_VAR_ARG + + + + ER_SP_NO_RETSET + + + + ER_CANT_CREATE_GEOMETRY_OBJECT + + + + ER_FAILED_ROUTINE_BREAK_BINLOG + + + + ER_BINLOG_UNSAFE_ROUTINE + + + + ER_BINLOG_CREATE_ROUTINE_NEED_SUPER + + + + ER_EXEC_STMT_WITH_OPEN_CURSOR + + + + ER_STMT_HAS_NO_OPEN_CURSOR + + + + ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG + + + + ER_NO_DEFAULT_FOR_VIEW_FIELD + + + + ER_SP_NO_RECURSION + + + + ER_TOO_BIG_SCALE + + + + ER_TOO_BIG_PRECISION + + + + ER_M_BIGGER_THAN_D + + + + ER_WRONG_LOCK_OF_SYSTEM_TABLE + + + + ER_CONNECT_TO_FOREIGN_DATA_SOURCE + + + + ER_QUERY_ON_FOREIGN_DATA_SOURCE + + + + ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST + + + + ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE + + + + ER_FOREIGN_DATA_STRING_INVALID + + + + ER_CANT_CREATE_FEDERATED_TABLE + + + + ER_TRG_IN_WRONG_SCHEMA + + + + ER_STACK_OVERRUN_NEED_MORE + + + + ER_TOO_LONG_BODY + + + + ER_WARN_CANT_DROP_DEFAULT_KEYCACHE + + + + ER_TOO_BIG_DISPLAYWIDTH + + + + ER_XAER_DUPID + + + + ER_DATETIME_FUNCTION_OVERFLOW + + + + ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG + + + + ER_VIEW_PREVENT_UPDATE + + + + ER_PS_NO_RECURSION + + + + ER_SP_CANT_SET_AUTOCOMMIT + + + + ER_MALFORMED_DEFINER + + + + ER_VIEW_FRM_NO_USER + + + + ER_VIEW_OTHER_USER + + + + ER_NO_SUCH_USER + + + + ER_FORBID_SCHEMA_CHANGE + + + + ER_ROW_IS_REFERENCED_2 + + + + ER_NO_REFERENCED_ROW_2 + + + + ER_SP_BAD_VAR_SHADOW + + + + ER_TRG_NO_DEFINER + + + + ER_OLD_FILE_FORMAT + + + + ER_SP_RECURSION_LIMIT + + + + ER_SP_PROC_TABLE_CORRUPT + + + + ER_SP_WRONG_NAME + + + + ER_TABLE_NEEDS_UPGRADE + + + + ER_SP_NO_AGGREGATE + + + + ER_MAX_PREPARED_STMT_COUNT_REACHED + + + + ER_VIEW_RECURSIVE + + + + ER_NON_GROUPING_FIELD_USED + + + + ER_TABLE_CANT_HANDLE_SPKEYS + + + + ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA + + + + ER_REMOVED_SPACES + + + + ER_AUTOINC_READ_FAILED + + + + ER_USERNAME + + + + ER_HOSTNAME + + + + ER_WRONG_STRING_LENGTH + + + + ER_NON_INSERTABLE_TABLE + + + + ER_ADMIN_WRONG_MRG_TABLE + + + + ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT + + + + ER_NAME_BECOMES_EMPTY + + + + ER_AMBIGUOUS_FIELD_TERM + + + + ER_FOREIGN_SERVER_EXISTS + + + + ER_FOREIGN_SERVER_DOESNT_EXIST + + + + ER_ILLEGAL_HA_CREATE_OPTION + + + + ER_PARTITION_REQUIRES_VALUES_ERROR + + + + ER_PARTITION_WRONG_VALUES_ERROR + + + + ER_PARTITION_MAXVALUE_ERROR + + + + ER_PARTITION_SUBPARTITION_ERROR + + + + ER_PARTITION_SUBPART_MIX_ERROR + + + + ER_PARTITION_WRONG_NO_PART_ERROR + + + + ER_PARTITION_WRONG_NO_SUBPART_ERROR + + + + ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR + + + + ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR + + + + ER_FIELD_NOT_FOUND_PART_ERROR + + + + ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR + + + + ER_INCONSISTENT_PARTITION_INFO_ERROR + + + + ER_PARTITION_FUNC_NOT_ALLOWED_ERROR + + + + ER_PARTITIONS_MUST_BE_DEFINED_ERROR + + + + ER_RANGE_NOT_INCREASING_ERROR + + + + ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR + + + + ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR + + + + ER_PARTITION_ENTRY_ERROR + + + + ER_MIX_HANDLER_ERROR + + + + ER_PARTITION_NOT_DEFINED_ERROR + + + + ER_TOO_MANY_PARTITIONS_ERROR + + + + ER_SUBPARTITION_ERROR + + + + ER_CANT_CREATE_HANDLER_FILE + + + + ER_BLOB_FIELD_IN_PART_FUNC_ERROR + + + + ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF + + + + ER_NO_PARTS_ERROR + + + + ER_PARTITION_MGMT_ON_NONPARTITIONED + + + + ER_FOREIGN_KEY_ON_PARTITIONED + + + + ER_DROP_PARTITION_NON_EXISTENT + + + + ER_DROP_LAST_PARTITION + + + + ER_COALESCE_ONLY_ON_HASH_PARTITION + + + + ER_REORG_HASH_ONLY_ON_SAME_NO + + + + ER_REORG_NO_PARAM_ERROR + + + + ER_ONLY_ON_RANGE_LIST_PARTITION + + + + ER_ADD_PARTITION_SUBPART_ERROR + + + + ER_ADD_PARTITION_NO_NEW_PARTITION + + + + ER_COALESCE_PARTITION_NO_PARTITION + + + + ER_REORG_PARTITION_NOT_EXIST + + + + ER_SAME_NAME_PARTITION + + + + ER_NO_BINLOG_ERROR + + + + ER_CONSECUTIVE_REORG_PARTITIONS + + + + ER_REORG_OUTSIDE_RANGE + + + + ER_PARTITION_FUNCTION_FAILURE + + + + ER_PART_STATE_ERROR + + + + ER_LIMITED_PART_RANGE + + + + ER_PLUGIN_IS_NOT_LOADED + + + + ER_WRONG_VALUE + + + + ER_NO_PARTITION_FOR_GIVEN_VALUE + + + + ER_FILEGROUP_OPTION_ONLY_ONCE + + + + ER_CREATE_FILEGROUP_FAILED + + + + ER_DROP_FILEGROUP_FAILED + + + + ER_TABLESPACE_AUTO_EXTEND_ERROR + + + + ER_WRONG_SIZE_NUMBER + + + + ER_SIZE_OVERFLOW_ERROR + + + + ER_ALTER_FILEGROUP_FAILED + + + + ER_BINLOG_ROW_LOGGING_FAILED + + + + ER_BINLOG_ROW_WRONG_TABLE_DEF + + + + ER_BINLOG_ROW_RBR_TO_SBR + + + + ER_EVENT_ALREADY_EXISTS + + + + ER_EVENT_STORE_FAILED + + + + ER_EVENT_DOES_NOT_EXIST + + + + ER_EVENT_CANT_ALTER + + + + ER_EVENT_DROP_FAILED + + + + ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG + + + + ER_EVENT_ENDS_BEFORE_STARTS + + + + ER_EVENT_EXEC_TIME_IN_THE_PAST + + + + ER_EVENT_OPEN_TABLE_FAILED + + + + ER_EVENT_NEITHER_M_EXPR_NOR_M_AT + + + + ER_COL_COUNT_DOESNT_MATCH_CORRUPTED + + + + ER_CANNOT_LOAD_FROM_TABLE + + + + ER_EVENT_CANNOT_DELETE + + + + ER_EVENT_COMPILE_ERROR + + + + ER_EVENT_SAME_NAME + + + + ER_EVENT_DATA_TOO_LONG + + + + ER_DROP_INDEX_FK + + + + ER_WARN_DEPRECATED_SYNTAX_WITH_VER + + + + ER_CANT_WRITE_LOCK_LOG_TABLE + + + + ER_CANT_LOCK_LOG_TABLE + + + + ER_FOREIGN_DUPLICATE_KEY + + + + ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE + + + + ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR + + + + ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT + + + + ER_NDB_CANT_SWITCH_BINLOG_FORMAT + + + + ER_PARTITION_NO_TEMPORARY + + + + ER_PARTITION_CONST_DOMAIN_ERROR + + + + ER_PARTITION_FUNCTION_IS_NOT_ALLOWED + + + + ER_DDL_LOG_ERROR + + + + ER_NULL_IN_VALUES_LESS_THAN + + + + ER_WRONG_PARTITION_NAME + + + + ER_CANT_CHANGE_TRANSACTION_ISOLATION + + + + ER_DUP_ENTRY_AUTOINCREMENT_CASE + + + + ER_EVENT_MODIFY_QUEUE_ERROR + + + + ER_EVENT_SET_VAR_ERROR + + + + ER_PARTITION_MERGE_ERROR + + + + ER_CANT_ACTIVATE_LOG + + + + ER_RBR_NOT_AVAILABLE + + + + ER_BASE64_DECODE_ERROR + + + + ER_EVENT_RECURSION_FORBIDDEN + + + + ER_EVENTS_DB_ERROR + + + + ER_ONLY_INTEGERS_ALLOWED + + + + ER_UNSUPORTED_LOG_ENGINE + + + + ER_BAD_LOG_STATEMENT + + + + ER_CANT_RENAME_LOG_TABLE + + + + ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT + + + + ER_WRONG_PARAMETERS_TO_NATIVE_FCT + + + + ER_WRONG_PARAMETERS_TO_STORED_FCT + + + + ER_NATIVE_FCT_NAME_COLLISION + + + + ER_DUP_ENTRY_WITH_KEY_NAME + + + + ER_BINLOG_PURGE_EMFILE + + + + ER_EVENT_CANNOT_CREATE_IN_THE_PAST + + + + ER_EVENT_CANNOT_ALTER_IN_THE_PAST + + + + ER_SLAVE_INCIDENT + + + + ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT + + + + ER_BINLOG_UNSAFE_STATEMENT + + + + ER_SLAVE_FATAL_ERROR + + + + ER_SLAVE_RELAY_LOG_READ_FAILURE + + + + ER_SLAVE_RELAY_LOG_WRITE_FAILURE + + + + ER_SLAVE_CREATE_EVENT_FAILURE + + + + ER_SLAVE_MASTER_COM_FAILURE + + + + ER_BINLOG_LOGGING_IMPOSSIBLE + + + + ER_VIEW_NO_CREATION_CTX + + + + ER_VIEW_INVALID_CREATION_CTX + + + + ER_SR_INVALID_CREATION_CTX + + + + ER_TRG_CORRUPTED_FILE + + + + ER_TRG_NO_CREATION_CTX + + + + ER_TRG_INVALID_CREATION_CTX + + + + ER_EVENT_INVALID_CREATION_CTX + + + + ER_TRG_CANT_OPEN_TABLE + + + + ER_CANT_CREATE_SROUTINE + + + + ER_SLAVE_AMBIGOUS_EXEC_MODE + + + + ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT + + + + ER_SLAVE_CORRUPT_EVENT + + + + ER_LOAD_DATA_INVALID_COLUMN + + + + ER_LOG_PURGE_NO_FILE + + + + ER_XA_RBTIMEOUT + + + + ER_XA_RBDEADLOCK + + + + ER_NEED_REPREPARE + + + + ER_DELAYED_NOT_SUPPORTED + + + + WARN_NO_MASTER_INFO + + + + WARN_OPTION_IGNORED + + + + WARN_PLUGIN_DELETE_BUILTIN + + + + WARN_PLUGIN_BUSY + + + + ER_VARIABLE_IS_READONLY + + + + ER_WARN_ENGINE_TRANSACTION_ROLLBACK + + + + ER_SLAVE_HEARTBEAT_FAILURE + + + + ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE + + + + ER_NDB_REPLICATION_SCHEMA_ERROR + + + + ER_CONFLICT_FN_PARSE_ERROR + + + + ER_EXCEPTIONS_WRITE_ERROR + + + + ER_TOO_LONG_TABLE_COMMENT + + + + ER_TOO_LONG_FIELD_COMMENT + + + + ER_FUNC_INEXISTENT_NAME_COLLISION + + + + ER_DATABASE_NAME + + + + ER_TABLE_NAME + + + + ER_PARTITION_NAME + + + + ER_SUBPARTITION_NAME + + + + ER_TEMPORARY_NAME + + + + ER_RENAMED_NAME + + + + ER_TOO_MANY_CONCURRENT_TRXS + + + + WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED + + + + ER_DEBUG_SYNC_TIMEOUT + + + + ER_DEBUG_SYNC_HIT_LIMIT + + + + ER_ERROR_LAST + + + + WriteInteger + + + + + + + Summary description for MySqlPool. + + + + + It is assumed that this property will only be used from inside an active + lock. + + + + + Indicates whether this pool is being cleared. + + + + + It is assumed that this method is only called from inside an active lock. + + + + + It is assumed that this method is only called from inside an active lock. + + + + + Removes a connection from the in use pool. The only situations where this method + would be called are when a connection that is in use gets some type of fatal exception + or when the connection is being returned to the pool and it's too old to be + returned. + + + + + + Clears this pool of all idle connections and marks this pool and being cleared + so all other connections are closed when they are returned. + + + + + Remove expired drivers from the idle pool + + + + Closing driver is a potentially lengthy operation involving network + IO. Therefore we do not close expired drivers while holding + idlePool.SyncRoot lock. We just remove the old drivers from the idle + queue and return them to the caller. The caller will need to close + them (or let GC close them) + + + + + Summary description for MySqlPoolManager. + + + + + Queue of demoted hosts. + + + + + List of hosts that will be attempted to connect to. + + + + + Timer to be used when a host have been demoted. + + + + + Remove drivers that have been idle for too long. + + + + + Remove hosts that have been on the demoted list for more + than 120,000 milliseconds and add them to the available hosts list. + + + + + Provides a class capable of executing a SQL script containing + multiple SQL statements including CREATE PROCEDURE statements + that require changing the delimiter + + + + + Handles the event raised whenever a statement is executed. + + + + + Handles the event raised whenever an error is raised by the execution of a script. + + + + + Handles the event raised whenever a script execution is finished. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + The connection. + + + + Initializes a new instance of the + class. + + The query. + + + + Initializes a new instance of the + class. + + The connection. + The query. + + + + Gets or sets the connection. + + The connection. + + + + Gets or sets the query. + + The query. + + + + Gets or sets the delimiter. + + The delimiter. + + + + Executes this instance. + + The number of statements executed as part of the script. + + + + Initiates the asynchronous execution of SQL statements. + + The number of statements executed as part of the script inside. + + + + Initiates the asynchronous execution of SQL statements. + + The cancellation token. + The number of statements executed as part of the script inside. + + + + Represents the method that will handle errors when executing MySQL statements. + + + + + Represents the method that will handle errors when executing MySQL scripts. + + + + + Sets the arguments associated to MySQL scripts. + + + + + Gets the statement text. + + The statement text. + + + + Gets the line. + + The line. + + + + Gets the position. + + The position. + + + + Sets the arguments associated to MySQL script errors. + + + + + Initializes a new instance of the class. + + The exception. + + + + Gets the exception. + + The exception. + + + + Gets or sets a value indicating whether this is ignored. + + true if ignore; otherwise, false. + + + + Summary description for MySqlStream. + + + + + ReadPacket is called by NativeDriver to start reading the next + packet on the stream. + + + + + Reads the specified number of bytes from the stream and stores them at given + offset in the buffer. + Throws EndOfStreamException if not all bytes can be read. + + Stream to read from + Array to store bytes read from the stream + The offset in buffer at which to begin storing the data read from the current stream. + Number of bytes to read + + + + LoadPacket loads up and decodes the header of the incoming packet. + + + + + Traces information about the client execution. + + + + + Gets the list of trace listeners. + + + + + Gets or sets the switch to control tracing and debugging. + + + + + Gets or sets a flag indicating if query analysis is enabled. + + + + + Enables query analysis. + + The host on which to enable query analysis. + The interval of time for logging trace information. + + + + Disables query analysis. + + + + + Specifies the types of warning flags. + + + + + No index exists. + + + + + Bad index exists. + + + + + Rows have been excluded from the result. + + + + + Columns have been excluded from the result. + + + + + Type conversions took place. + + + + + Specifies the event that triggered the trace. + + + + + A connection has been opened. + + + + + A connection has been closed. + + + + + A query has been executed. + + + + + Data has been retrieved from the resultset. + + + + + Data retrieval has ended. + + + + + Query execution has ended. + + + + + The statement to be executed has been created. + + + + + The statement has been executed. + + + + + The statement is no longer required. + + + + + The query provided is of a nonquery type. + + + + + Usage advisor warnings have been requested. + + + + + Noncritical problem. + + + + + An error has been raised during data retrieval. + + + + + The query has been normalized. + + + + + Summary description for Driver. + + + + + Sets the current database for the this connection + + + + + + Return the appropriate set of connection flags for our + server capabilities and our user requested options. + + + + + Query is the method that is called to send all queries to the server + + + + + Sends the specified file to the server. + This supports the LOAD DATA LOCAL INFILE + + + + + + FetchDataRow is the method that the data reader calls to see if there is another + row to fetch. In the non-prepared mode, it will simply read the next data packet. + In the prepared mode (statementId > 0), it will + + + + + Execution timeout, in milliseconds. When the accumulated time for network IO exceeds this value + TimeoutException is thrown. This timeout needs to be reset for every new command + + + + + + Summary description for PreparedStatement. + + + + + Prepares CommandText for use with the Prepare method + + Command text stripped of all paramter names + + Takes the output of TokenizeSql and creates a single string of SQL + that only contains '?' markers for each parameter. It also creates + the parameterMap array list that includes all the paramter names in the + order they appeared in the SQL + + + + + Defines a replication configurarion element in the configuration file. + + + + + Gets a collection of objects representing the server groups. + + + + + Defines a replication server group in the configuration file. + + + + + Gets or sets the name of the replication server group configuration. + + + + + Gets or sets the group type of the replication server group configuration. + + + + + Gets or sets the number of seconds to wait for retry. + + + + + Gets a collection of objects representing the + server configurations associated to this group configuration. + + + + + Defines a replication server in configuration file. + + + + + Gets or sets the name of the replication server configuration. + + + + + Gets or sets whether the replication server is configured as master. + + + + + Gets or sets the connection string associated to this replication server. + + + + + Manager for Replication and Load Balancing features + + + + + Returns Replication Server Group List + + + + + Adds a Default Server Group to the list + + Group name + Time between reconnections for failed servers + Replication Server Group added + + + + Adds a Server Group to the list + + Group name + ServerGroup type reference + Time between reconnections for failed servers + Server Group added + + + + Gets the next server from a replication group + + Group name + True if the server to return must be a master + Replication Server defined by the Load Balancing plugin + + + + Gets a Server Group by name + + Group name + Server Group if found, otherwise throws an MySqlException + + + + Validates if the replication group name exists + + Group name to validate + true if the replication group name is found; otherwise, false + + + + Assigns a new server driver to the connection object + + Group name + True if the server connection to assign must be a master + MySqlConnection object where the new driver will be assigned + + + + Class that implements Round Robing Load Balancing technique. + + + + + Gets an available server based on Round Robin load balancing. + + Flag indicating if the server to return must be a master. + A object representing the next available server. + + + + Represents a server in a Replication environment. + + + + + Gets the server name. + + + + + Gets a value indicating whether the server is master or slave. + + + + + Gets the connection string used to connect to the server. + + + + + Gets a flag indicating if the server is available to be considered in load balancing. + + + + + Base class used to implement load balancing features. + + + + + List of servers available for replication. + + + + The group name. + The number of seconds to perform a retry. + + + + Gets the group name. + + + + + Gets the retry time between connections to failed servers. + + + + + Gets the server list in the group. + + + + + Adds a server into the group. + + The server name. + A flag indicating if the server to add is master or slave. + The connection string used by this server. + A object representing the recently added object. + + + + Removes a server from the group. + + The server name. + + + + Gets a server by name. + + The server name. + The replication server. + + + + Must be implemented. Defines the next server for a custom load balancing implementation. + + Defines if the server to return is a master or any. + The next server based on the load balancing implementation. + Null if no available server is found. + + + + + Defines the next server for a custom load balancing implementation. + + Defines if the server to return is a master or any. + Currently not being used. + The next server based on the load balancing implementation. + Null if no available server is found. + + + + + Handles a failed connection to a server. + + The failed server. + This method can be overrided to implement a custom failover handling. + + + + Handles a failed connection to a server. + + The failed server. + The exception that caused the failover. + + + + return the ordinal for the given column name + + + + + + + Retrieve the value as the given column index + + The column value to retrieve + The value as the given column + + + + Closes the current resultset, dumping any data still on the wire + + + + + Loads the column metadata for the current resultset + + + + + Represents a schema and its contents. + + + + + Gets or sets the name of the schema. + + + + + Gets the list of columns in the schema. + + + + + Gets the list of rows in the schema. + + + + + Represents a row within a schema. + + + + + Represents a column within a schema. + + + + + The name of the column. + + + + + The type of the column. + + + + + GetForeignKeysOnTable retrieves the foreign keys on the given table. + Since MySQL supports foreign keys on versions prior to 5.0, we can't use + information schema. MySQL also does not include any type of SHOW command + for foreign keys so we have to resort to use SHOW CREATE TABLE and parsing + the output. + + The table to store the key info in. + The table to get the foeign key info for. + Only get foreign keys that match this name. + Should column information be included in the table. + + + + Serializes the given parameter to the given memory stream + + + This method is called by PrepareSqlBuffers to convert the given + parameter to bytes and write those bytes to the given memory stream. + + + True if the parameter was successfully serialized, false otherwise. + + + + Summary description for StoredProcedure. + + + + + Defines the basic operations to be performed on the table cache. + + + + + The maximum age allowed for cache entries. + + + + + Adds the given command and result set to the cache. + + The command to store in the cache. + The resultset associated to the stored command. + + + + Retrieves the specified command from the cache. + + The command to retrieve. + The allowed age for the cache entry. + + + + + Removes the specified command from the cache. + + The command to remove from the cache. + + + + Clears the cache. + + + + + Removes cache entries older than the value defined by . + + + + + Stream that supports timeout of IO operations. + This class is used is used to support timeouts for SQL command, where a + typical operation involves several network reads/writes. + Timeout here is defined as the accumulated duration of all IO operations. + + + + + Construct a TimedStream + + Undelying stream + + + + Figure out whether it is necessary to reset timeout on stream. + We track the current value of timeout and try to avoid + changing it too often, because setting Read/WriteTimeout property + on network stream maybe a slow operation that involves a system call + (setsockopt). Therefore, we allow a small difference, and do not + reset timeout if current value is slightly greater than the requested + one (within 0.1 second). + + + + + Common handler for IO exceptions. + Resets timeout to infinity if timeout exception is + detected and stops the times. + + original exception + + + + Represents a SQL transaction to be made in a MySQL database. This class cannot be inherited. + + The application creates a MySqlTransaction object by calling + on the object. All subsequent operations associated with the + transaction (for example, committing or aborting the transaction), are performed on the + MySqlTransaction object. + + The following example creates a and a MySqlTransaction. + It also demonstrates how to use the , + , and methods. + + Public Sub RunTransaction(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + + Dim myCommand As MySqlCommand = myConnection.CreateCommand() + Dim myTrans As MySqlTransaction + + ' Start a local transaction + myTrans = myConnection.BeginTransaction() + ' Must assign both transaction object and connection + ' to Command object for a pending local transaction + myCommand.Connection = myConnection + myCommand.Transaction = myTrans + + Try + myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')" + myCommand.ExecuteNonQuery() + myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')" + myCommand.ExecuteNonQuery() + myTrans.Commit() + Console.WriteLine("Both records are written to database.") + Catch e As Exception + Try + myTrans.Rollback() + Catch ex As MySqlException + If Not myTrans.Connection Is Nothing Then + Console.WriteLine("An exception of type " & ex.GetType().ToString() & _ + " was encountered while attempting to roll back the transaction.") + End If + End Try + + Console.WriteLine("An exception of type " & e.GetType().ToString() & _ + "was encountered while inserting the data.") + Console.WriteLine("Neither record was written to database.") + Finally + myConnection.Close() + End Try + End Sub 'RunTransaction + + + public void RunTransaction(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + + MySqlCommand myCommand = myConnection.CreateCommand(); + MySqlTransaction myTrans; + + // Start a local transaction + myTrans = myConnection.BeginTransaction(); + // Must assign both transaction object and connection + // to Command object for a pending local transaction + myCommand.Connection = myConnection; + myCommand.Transaction = myTrans; + + try + { + myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')"; + myCommand.ExecuteNonQuery(); + myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')"; + myCommand.ExecuteNonQuery(); + myTrans.Commit(); + Console.WriteLine("Both records are written to database."); + } + catch(Exception e) + { + try + { + myTrans.Rollback(); + } + catch (MySqlException ex) + { + if (myTrans.Connection != null) + { + Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to roll back the transaction."); + } + } + + Console.WriteLine("An exception of type " + e.GetType() + + " was encountered while inserting the data."); + Console.WriteLine("Neither record was written to database."); + } + finally + { + myConnection.Close(); + } + } + + + + + + Gets the object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid. + + The object associated with this transaction. + + A single application may have multiple database connections, each + with zero or more transactions. This property enables you to + determine the connection object associated with a particular + transaction created by . + + + + + Specifies the for this transaction. + + + The for this transaction. The default is ReadCommitted. + + + Parallel transactions are not supported. Therefore, the IsolationLevel + applies to the entire transaction. + + + + + Commits the database transaction. + + The Commit method is equivalent to the MySQL SQL statement + COMMIT. + + The following example creates a and a + . It also demonstrates how to use the + , , and Rollback + methods. + + Public Sub RunSqlTransaction(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + + Dim myCommand As MySqlCommand = myConnection.CreateCommand() + Dim myTrans As MySqlTransaction + + ' Start a local transaction + myTrans = myConnection.BeginTransaction() + + ' Must assign both transaction object and connection + ' to Command object for a pending local transaction + myCommand.Connection = myConnection + myCommand.Transaction = myTrans + + Try + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (100, 'Description')" + myCommand.ExecuteNonQuery() + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (101, 'Description')" + myCommand.ExecuteNonQuery() + myTrans.Commit() + Console.WriteLine("Success.") + Catch e As Exception + Try + myTrans.Rollback() + Catch ex As MySqlException + If Not myTrans.Connection Is Nothing Then + Console.WriteLine("An exception of type " & ex.GetType().ToString() & _ + " was encountered while attempting to roll back the transaction.") + End If + End Try + + Console.WriteLine("An exception of type " & e.GetType().ToString() & _ + "was encountered while inserting the data.") + Console.WriteLine("Neither record was written to database.") + Finally + myConnection.Close() + End Try + End Sub + + + public void RunSqlTransaction(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + + MySqlCommand myCommand = myConnection.CreateCommand(); + MySqlTransaction myTrans; + + // Start a local transaction + myTrans = myConnection.BeginTransaction(); + // Must assign both transaction object and connection + // to Command object for a pending local transaction + myCommand.Connection = myConnection; + myCommand.Transaction = myTrans; + + try + { + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (100, 'Description')"; + myCommand.ExecuteNonQuery(); + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (101, 'Description')"; + myCommand.ExecuteNonQuery(); + myTrans.Commit(); + Console.WriteLine("Both records are written to database."); + } + catch(Exception e) + { + try + { + myTrans.Rollback(); + } + catch (MySqlException ex) + { + if (myTrans.Connection != null) + { + Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to roll back the transaction."); + } + } + + Console.WriteLine("An exception of type " + e.GetType() + + " was encountered while inserting the data."); + Console.WriteLine("Neither record was written to database."); + } + finally + { + myConnection.Close(); + } + } + + + + + + Rolls back a transaction from a pending state. + + The Rollback method is equivalent to the MySQL statement ROLLBACK. + The transaction can only be rolled back from a pending state + (after BeginTransaction has been called, but before Commit is + called). + + The following example creates a and a + . It also demonstrates how to use the + , , and Rollback + methods. + + Public Sub RunSqlTransaction(myConnString As String) + Dim myConnection As New MySqlConnection(myConnString) + myConnection.Open() + + Dim myCommand As MySqlCommand = myConnection.CreateCommand() + Dim myTrans As MySqlTransaction + + ' Start a local transaction + myTrans = myConnection.BeginTransaction() + + ' Must assign both transaction object and connection + ' to Command object for a pending local transaction + myCommand.Connection = myConnection + myCommand.Transaction = myTrans + + Try + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (100, 'Description')" + myCommand.ExecuteNonQuery() + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (101, 'Description')" + myCommand.ExecuteNonQuery() + myTrans.Commit() + Console.WriteLine("Success.") + Catch e As Exception + Try + myTrans.Rollback() + Catch ex As MySqlException + If Not myTrans.Connection Is Nothing Then + Console.WriteLine("An exception of type " & ex.GetType().ToString() & _ + " was encountered while attempting to roll back the transaction.") + End If + End Try + + Console.WriteLine("An exception of type " & e.GetType().ToString() & _ + "was encountered while inserting the data.") + Console.WriteLine("Neither record was written to database.") + Finally + myConnection.Close() + End Try + End Sub + + + public void RunSqlTransaction(string myConnString) + { + MySqlConnection myConnection = new MySqlConnection(myConnString); + myConnection.Open(); + + MySqlCommand myCommand = myConnection.CreateCommand(); + MySqlTransaction myTrans; + + // Start a local transaction + myTrans = myConnection.BeginTransaction(); + // Must assign both transaction object and connection + // to Command object for a pending local transaction + myCommand.Connection = myConnection; + myCommand.Transaction = myTrans; + + try + { + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (100, 'Description')"; + myCommand.ExecuteNonQuery(); + myCommand.CommandText = "Insert into mytable (id, desc) VALUES (101, 'Description')"; + myCommand.ExecuteNonQuery(); + myTrans.Commit(); + Console.WriteLine("Both records are written to database."); + } + catch(Exception e) + { + try + { + myTrans.Rollback(); + } + catch (MySqlException ex) + { + if (myTrans.Connection != null) + { + Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to roll back the transaction."); + } + } + + Console.WriteLine("An exception of type " + e.GetType() + + " was encountered while inserting the data."); + Console.WriteLine("Neither record was written to database."); + } + finally + { + myConnection.Close(); + } + } + + + + + + DNS resolver that runs queries against a server. + + + + + Initializes a new instance of the class. + + + + + Gets the DNS SVR records of the service name that is provided. + + A list of s sorted as described in RFC2782. + + + + Sorts a list of DNS SRV records according to the sorting rules described in RFC2782. + + List of s to sort. + A new list of sorted s. + + + + Resets the DnsSrvResolver + + + + + Class that represents a DNS SRV record. + RFC 2782 (https://tools.ietf.org/html/rfc2782) + + + + + Gets the port. + + + + + Gets the priority. + + + + + Gets the target domain name. + + + + + Gets the weight. + + + + + Initializes a new instance of class. + + The port. + The priority. + The target. + The weight. + + + + Initializes a new instance of class. + + The DNS SRV record. + + + + Compare two objects. First, using their priority and + if both have the same, then using their weights. + + A to compare. + A to compare. + + + + + Initializes a new instance of the class from a . + + The DNS SRV record. + + + + This class is modeled after .NET Stopwatch. It provides better + performance (no system calls).It is however less precise than + .NET Stopwatch, measuring in milliseconds. It is adequate to use + when high-precision is not required (e.g for measuring IO timeouts), + but not for other tasks. + + + + + Wrapper around NetworkStream. + + MyNetworkStream is equivalent to NetworkStream, except + 1. It throws TimeoutException if read or write timeout occurs, instead + of IOException, to match behavior of other streams (named pipe and + shared memory). This property comes handy in TimedStream. + + 2. It implements workarounds for WSAEWOULDBLOCK errors, that can start + occuring after stream has times out. For a discussion about the CLR bug, + refer to http://tinyurl.com/lhgpyf. This error should never occur, as + we're not using asynchronous operations, but apparerntly it does occur + directly after timeout has expired. + The workaround is hinted in the URL above and implemented like this: + For each IO operation, if it throws WSAEWOULDBLOCK, we explicitely set + the socket to Blocking and retry the operation once again. + + + + + Set keepalive + timeout on socket. + + socket + keepalive timeout, in seconds + + + + Static class to manage SSH connections created with SSH .NET. + + + + + Gets or sets the SSH client initialized when calling the method. + + + + + Stores a list of SSH clients having different connection settings. + + + + + Removes the MySQL unsupported encryptions (SSH Ciphers), MACs and key exchange algorithms. + + The instance containing the list of supported elements. + See https://confluence.oraclecorp.com/confluence/display/GPS/Approved+Security+Technologies%3A+Standards+-+SSH+Ciphers+and+Versions for an updated list. + + + + Initializes an instance if no SSH client with similar connection options has already been initialized. + + The SSH host name. + The SSH user name. + The SSH password. + The SSH key file. + The SSH pass phrase. + The SSH port. + The local host name. + The local port number. + Flag to indicate if the connection will be created for the classic or X Protocol. + + + + + Raises warning messages if the SSH client is using a deprecated encryption, MAC or key exchanged algorithm. + + The instance containing the + encryption, MAC algorithm and key exchange algorithm currently being used. + + + + Read a single quoted identifier from the stream + + + + + + + Helper class to encapsulate shared memory functionality + Also cares of proper cleanup of file mapping object and cew + + + + + Summary description for SharedMemoryStream. + + + + + By creating a private ctor, we keep the compiler from creating a default ctor + + + + + Mark - or + signs that are unary ops as no output + + + + + + Wrapper class used for handling SSH connections. + + + + + Starts the SSH client. + + + + + Stops the SSH client. + + + + + Handles SSL connections for the Classic and X protocols. + + + + + Contains the connection options provided by the user. + + + + + A flag to establish how certificates are to be treated and validated. + + + + + Defines the supported TLS protocols. + + + + + Retrieves a collection containing the client SSL PFX certificates. + + Dependent on connection string settings. + Either file or store based certificates are used. + + + + Initiates the SSL connection. + + The base stream. + The encoding used in the SSL connection. + The connection string used to establish the connection. + A instance ready to initiate an SSL connection. + + + + Verifies the SSL certificates used for authentication. + + An object that contains state information for this validation. + The MySQL server certificate used to authenticate the remote party. + The chain of certificate authorities associated with the remote certificate. + One or more errors associated with the remote certificate. + true if no errors were found based on the selected SSL mode; false, otherwise. + + + + Gets the extension of the specified file. + + The path of the file. + Flag to indicate if the result should be converted to lower case. + The . character is ommited from the result. + + + + + Summary description for StreamCreator. + + + + + Set the keepalive timeout on the socket. + + The socket object. + The keepalive timeout, in seconds. + + + + Summary description for Version. + + + + + Provides functionality to read SSL PEM certificates and to perform multiple validations via Bouncy Castle. + + + + + Raises an exception if the specified connection option is null, empty or whitespace. + + The connection option to verify. + + + + Reads the specified file as a byte array. + + The path of the file to read. + A byte array representing the read file. + + + + Reads the SSL certificate file. + + The path to the certificate file. + A instance representing the SSL certificate file. + + + + Reads the SSL certificate key file. + + The path to the certificate key file. + A instance representing the SSL certificate key file. + + + + Verifies that the certificate has not yet expired. + + The certificate to verify. + + + + Verifies a certificate CA status. + + The certificate to validate. + A flag indicating the expected CA status. + + + + Verifies that the certificate was signed using the private key that corresponds to the specified public key + + The client side certificate containing the public key. + The server certificate. + + + + Verifies that no SSL policy errors regarding the identitfy of the host were raised. + + A instance set with the raised SSL errors. + + + + Verifies that the issuer matches the CA by comparing the CA certificate issuer and the server certificate issuer. + + The CA certificate. + The server certificate. + + + + + Gets and sets the host list. + + + + + Gets the active host. + + + + + Active host. + + + + + Sets the initial active host. + + + + + Determines the next host. + + object that represents the next available host. + + + + Implements common elements that allow to manage the hosts available for client side failover. + + + + + Gets and sets the failover group which consists of a host list. + + + + + Resets the manager. + + + + + Sets the host list to be used during failover operations. + + The host list. + The failover method. + + + + Attempts to establish a connection to a host specified from the list. + + The original connection string set by the user. + An out parameter that stores the updated connection string. + A object in case this is a pooling scenario. + An instance if the connection was succesfully established, a exception is thrown otherwise. + + + + + Creates a if more than one host is found. + + A string containing an unparsed list of hosts. + true if the connection is X Protocol; otherwise false. + true if the connection data is a URI; otherwise false. + The number of hosts found, -1 if an error was raised during parsing. + + + + Creates a object based on the provided parameters. + + The host string that can be a simple host name or a host name and port. + The priority of the host. + The port number of the host. + true if the connection data is a URI; otherwise false. + + + + + Attempts the next host in the list. Moves to the first element if the end of the list is reached. + + + + + Determines the next host on which to attempt a connection by checking the value of the Priority property in descending order. + + + + + Determines the next host on which to attempt a connection randomly. + + + + + Depicts a host which can be failed over to. + + + + + Gets and sets the name or address of the host. + + + + + Gets and sets the port number. + + + + + Gets a value between 0 and 100 which represents the priority of the host. + + + + + Flag to indicate if this host is currently being used. + + + + + Flag to indicate if this host has been attempted to connection. + + + + + Time since the host has been demoted. + + + + + Initializes a object. + + The host. + The port. + The priority. + + + + Compares two objects of type . + + FailoverServer object to compare. + True if host properties are the same. Otherwise, false. + + + + Manages the hosts available for client side failover using the Random Failover method. + The Random Failover method attempts to connect to the hosts specified in the list randomly until all the hosts have been attempted. + + + + + The initial host taken from the list. + + + + + The host for the current connection attempt. + + + + + Random object to get the next host. + + + + + Sets the initial active host. + + + + + Determines the next host. + + A object that represents the next available host. + + + + Manages the hosts available for client side failover using the Sequential Failover method. + The Sequential Failover method attempts to connect to the hosts specified in the list one after another until the initial host is reached. + + + + + The initial host taken from the list. + + + + + The index of the current host. + + + + + The host for the current connection attempt. + + + + + Sets the initial active host. + + + + + Determines the next host. + + A object that represents the next available host. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Improper MySqlCommandBuilder state: adapter is null. + + + + + Looks up a localized string similar to Improper MySqlCommandBuilder state: adapter's SelectCommand is null. + + + + + Looks up a localized string similar to Invalid attempt to access a field before calling Read(). + + + + + Looks up a localized string similar to Authentication to host '{0}' for user '{1}' using method '{2}' failed with message: {3}. + + + + + Looks up a localized string similar to Authentication method '{0}' not supported by any of the available plugins.. + + + + + Looks up a localized string similar to Version string not in acceptable format. + + + + + Looks up a localized string similar to The buffer cannot be null. + + + + + Looks up a localized string similar to Buffer is not large enough. + + + + + Looks up a localized string similar to Canceling an executing query requires MySQL 5.0 or higher.. + + + + + Looks up a localized string similar to Canceling an active query is only supported on MySQL 5.0.0 and above. . + + + + + Looks up a localized string similar to Parameters can only be derived for commands using the StoredProcedure command type.. + + + + + Looks up a localized string similar to MySqlCommandBuilder does not support multi-table statements. + + + + + Looks up a localized string similar to MySqlCommandBuilder cannot operate on tables with no unique or key columns. + + + + + Looks up a localized string similar to Chaos isolation level is not supported . + + + + + Looks up a localized string similar to The CommandText property has not been properly initialized.. + + + + + Looks up a localized string similar to Compression is not supported.. + + + + + Looks up a localized string similar to The connection is already open.. + + + + + Looks up a localized string similar to Connection unexpectedly terminated.. + + + + + Looks up a localized string similar to Connection must be valid and open. + + + + + Looks up a localized string similar to The connection is not open.. + + + + + Looks up a localized string similar to The connection property has not been set or is null.. + + + + + Looks up a localized string similar to Could not find specified column in results: {0}. + + + + + Looks up a localized string similar to Count cannot be negative. + + + + + Looks up a localized string similar to SetLength is not a valid operation on CompressedStream. + + + + + Looks up a localized string similar to The given value was not in a supported format.. + + + + + Looks up a localized string similar to There is already an open DataReader associated with this Connection which must be closed first.. + + + + + Looks up a localized string similar to The default connection encoding was not found. Please report this as a bug along with your connection string and system details.. + + + + + Looks up a localized string similar to The {0} algorithm being used by the server({1}) has been deprecated and will be removed in a future version. It is recommended that you configure the server to use a non-deprecated {0} algorithm.. + + + + + Looks up a localized string similar to MySQL Connector/NET does not currently support distributed transactions.. + + + + + Looks up a localized string similar to Specifying multiple host names with DNS SRV lookup is not permitted.. + + + + + Looks up a localized string similar to Specifying a port number with DNS SRV lookup is not permitted.. + + + + + Looks up a localized string similar to Using Unix domain sockets with DNS SRV lookup is not permitted.. + + + + + Looks up a localized string similar to Unable to locate any hosts for {0}.. + + + + + Looks up a localized string similar to Connection option '{0}' is duplicated.. + + + + + Looks up a localized string similar to SSL connection option '{0}' is duplicated.. + + + + + Looks up a localized string similar to Encoding error during validation.. + + + + + Looks up a localized string similar to Error creating socket connection. + + + + + Looks up a localized string similar to Verify that user '{0}'@'{1}' has enough privileges to execute.. + + + + + Looks up a localized string similar to Fatal error encountered during command execution.. + + + + + Looks up a localized string similar to Fatal error encountered during data read.. + + + + + Looks up a localized string similar to Fatal error encountered attempting to read the resultset.. + + + + + Looks up a localized string similar to File based certificates are only supported when connecting to MySQL Server 5.1 or greater.. + + + + + Looks up a localized string similar to The specified file cannot be converted to a certificate.. + + + + + Looks up a localized string similar to The specified file cannot be converted to a key.. + + + + + Looks up a localized string similar to Failed to read file at the specified location.. + + + + + Looks up a localized string similar to No file path has been provided for the connection option {0}.. + + + + + Looks up a localized string similar to From index and length use more bytes than from contains. + + + + + Looks up a localized string similar to From index must be a valid index inside the from buffer. + + + + + Looks up a localized string similar to Call to GetHostEntry failed after {0} while querying for hostname '{1}': SocketErrorCode={2}, ErrorCode={3}, NativeErrorCode={4}.. + + + + + Looks up a localized string similar to Retrieving procedure metadata for {0} from server.. + + + + + Looks up a localized string similar to Value has an unsupported format.. + + + + + Looks up a localized string similar to An incorrect response was received from the server.. + + + + + Looks up a localized string similar to Index and length use more bytes than to has room for. + + + + + Looks up a localized string similar to Index must be a valid position in the buffer. + + + + + Looks up a localized string similar to The provided key is invalid.. + + + + + Looks up a localized string similar to You have specified an invalid column ordinal.. + + + + + Looks up a localized string similar to The requested value '{0}' is invalid for the given keyword '{1}'.. + + + + + Looks up a localized string similar to The host name or IP address is invalid.. + + + + + Looks up a localized string similar to Microsecond must be a value between 0 and 999999.. + + + + + Looks up a localized string similar to Millisecond must be a value between 0 and 999. For more precision use Microsecond.. + + + + + Looks up a localized string similar to No other SSL options are accepted when SSL Mode is set to None.. + + + + + Looks up a localized string similar to Procedure or function '{0}' cannot be found in database '{1}'.. + + + + + Looks up a localized string similar to The certificate is invalid.. + + + + + Looks up a localized string similar to Unable to validate the signature.. + + + + + Looks up a localized string similar to Unable to verify the signature.. + + + + + Looks up a localized string similar to Value '{0}' is not of the correct type.. + + + + + Looks up a localized string similar to Option "tls-version" can not be specified when SSL connections are disabled.. + + + + + Looks up a localized string similar to '{0}' not recognized as a valid TLS protocol version (should be one of TLSv1, TLSv1.1, TLSv1.2{1}).. + + + + + Looks up a localized string similar to '{0}' is an illegal value for a boolean option.. + + + + + Looks up a localized string similar to Keyword does not allow null values.. + + + + + Looks up a localized string similar to Option not supported.. + + + + + Looks up a localized string similar to ACCESSIBLE + ADD + ALL + ALTER + ANALYZE + AND + AS + ASC + ASENSITIVE + BEFORE + BEGIN + BETWEEN + BIGINT + BINARY + BLOB + BOTH + BY + CALL + CASCADE + CASE + CHANGE + CHAR + CHARACTER + CHECK + COLLATE + COLUMN + COMMIT + CONDITION + CONNECTION + CONSTRAINT + CONTINUE + CONVERT + CREATE + CROSS + CURRENT_DATE + CURRENT_TIME + CURRENT_TIMESTAMP + CURRENT_USER + CURSOR + DATABASE + DATABASES + DAY_HOUR + DAY_MICROSECOND + DAY_MINUTE + DAY_SECOND + DEC + DECIMAL + DECLARE + DEFAULT + DELAYED + DELETE + DESC + DESCRIBE + DETERMINISTIC + DISTINCT + DISTINCTROW + DIV + DO + DOUBLE + DROP + DUAL + EACH + ELSE + ELSEIF + ENCLOSED + END + ESC [rest of string was truncated]";. + + + + + Looks up a localized string similar to Server asked for stream in response to LOAD DATA LOCAL INFILE, but the functionality is disabled by the client setting 'allowlocalinfile' to 'false'.. + + + + + Looks up a localized string similar to Mixing named and unnamed parameters is not allowed.. + + + + + Looks up a localized string similar to INTERNAL ERROR: More than one output parameter row detected.. + + + + + Looks up a localized string similar to Multiple simultaneous connections or connections with different connection strings inside the same transaction are not currently supported.. + + + + + Looks up a localized string similar to NamedPipeStream does not support seeking. + + + + + Looks up a localized string similar to NamedPipeStream doesn't support SetLength. + + + + + Looks up a localized string similar to The new value must be a MySqlParameter object.. + + + + + Looks up a localized string similar to Invalid attempt to call NextResult when the reader is closed.. + + + + + Looks up a localized string similar to When calling stored procedures and 'Use Procedure Bodies' is false, all parameters must have their type explicitly set.. + + + + + Looks up a localized string similar to Nested transactions are not supported.. + + + + + Looks up a localized string similar to The host {0} does not support SSL connections.. + + + + + Looks up a localized string similar to Unix sockets are not supported on Windows.. + + + + + Looks up a localized string similar to Cannot retrieve Windows identity for current user. Connections that use IntegratedSecurity cannot be pooled. Use either 'ConnectionReset=true' or 'Pooling=false' in the connection string to fix.. + + + + + Looks up a localized string similar to The object is not open or has been disposed.. + + + + + Looks up a localized string similar to Offset cannot be negative. + + + + + Looks up a localized string similar to Offset must be a valid position in buffer. + + + + + Looks up a localized string similar to Authentication with old password no longer supported, use 4.1 style passwords.. + + + + + Looks up a localized string similar to The option '{0}' is not currently supported.. + + + + + Looks up a localized string similar to Parameter '{0}' has already been defined.. + + + + + Looks up a localized string similar to Parameter cannot have a negative value. + + + + + Looks up a localized string similar to Parameter cannot be null. + + + + + Looks up a localized string similar to Parameter '{0}' can't be null or empty.. + + + + + Looks up a localized string similar to Parameter index was not found in Parameter Collection.. + + + + + Looks up a localized string similar to Parameter is invalid.. + + + + + Looks up a localized string similar to Parameter '{0}' must be defined.. + + + + + Looks up a localized string similar to Parameter '{0}' was not found during prepare.. + + + + + Looks up a localized string similar to Parameter can't be null or empty.. + + + + + Looks up a localized string similar to Password must be valid and contain length characters. + + + + + Looks up a localized string similar to This category includes a series of counters for MySQL. + + + + + Looks up a localized string similar to .NET Data Provider for MySQL. + + + + + Looks up a localized string similar to The number of times a procedures metadata had to be queried from the server.. + + + + + Looks up a localized string similar to Hard Procedure Queries. + + + + + Looks up a localized string similar to The number of times a procedures metadata was retrieved from the client-side cache.. + + + + + Looks up a localized string similar to Soft Procedure Queries. + + + + + Looks up a localized string similar to same name are not supported.. + + + + + Looks up a localized string similar to Packets larger than max_allowed_packet are not allowed.. + + + + + Looks up a localized string similar to Reading from the stream has failed.. + + + + + Looks up a localized string similar to Invalid attempt to read a prior column using SequentialAccess. + + + + + Looks up a localized string similar to Replicated connections allow only readonly statements.. + + + + + Looks up a localized string similar to Attempt to connect to '{0}' server failed.. + + + + + Looks up a localized string similar to No available server found.. + + + + + Looks up a localized string similar to Replication group '{0}' not found.. + + + + + Looks up a localized string similar to Replicated server not found: '{0}'. + + + + + Looks up a localized string similar to Routine '{0}' cannot be found. Either check the spelling or make sure you have sufficient rights to execute the routine.. + + + + + Looks up a localized string similar to Attempt to call stored function '{0}' without specifying a return parameter. + + + + + Looks up a localized string similar to Retrieval of the RSA public key is not enabled for insecure connections.. + + + + + Looks up a localized string similar to Connector/NET no longer supports server versions prior to 5.0. + + + + + Looks up a localized string similar to Snapshot isolation level is not supported.. + + + + + Looks up a localized string similar to Socket streams do not support seeking. + + + + + Looks up a localized string similar to Retrieving procedure metadata for {0} from procedure cache.. + + + + + Looks up a localized string similar to Stored procedures are not supported on this version of MySQL. + + + + + Looks up a localized string similar to The SSH Key File and/or SSH Password must be provided.. + + + + + Looks up a localized string similar to The provided passphrase is invalid.. + + + + + Looks up a localized string similar to The certificate authority (CA) does not match.. + + + + + Looks up a localized string similar to The host name does not match the name on the certificate.. + + + + + Looks up a localized string similar to The certificate is not a certificate authority (CA).. + + + + + Looks up a localized string similar to SSL Connection error.. + + + + + Looks up a localized string similar to The stream has already been closed. + + + + + Looks up a localized string similar to The stream does not support reading. + + + + + Looks up a localized string similar to The stream does not support writing. + + + + + Looks up a localized string similar to String can't be empty.. + + + + + Looks up a localized string similar to Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.. + + + + + Looks up a localized string similar to error connecting: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.. + + + + + Looks up a localized string similar to All server connection attempts were aborted. Timeout of {0} seconds was exceeded for each selected server.. + + + + + Looks up a localized string similar to TLSv1.3 is supported in .NET Framework 4.8 or .NET Core 3.0.. + + + + + Looks up a localized string similar to No supported TLS protocol version found in the 'tls-versions' list.. + + + + + Looks up a localized string similar to {0}: Connection Closed. + + + + + Looks up a localized string similar to Unable to trace. There are more than Int32.MaxValue connections in use.. + + + + + Looks up a localized string similar to {0}: Error encountered during row fetch. Number = {1}, Message={2}. + + + + + Looks up a localized string similar to {0}: Connection Opened: connection string = '{1}'. + + + + + Looks up a localized string similar to {0}: Error encountered attempting to open result: Number={1}, Message={2}. + + + + + Looks up a localized string similar to {0}: Query Closed. + + + + + Looks up a localized string similar to {0}: Query Normalized: {2}. + + + + + Looks up a localized string similar to {0}: Query Opened: {2}. + + + + + Looks up a localized string similar to {0}: Resultset Opened: field(s) = {1}, affected rows = {2}, inserted id = {3}. + + + + + Looks up a localized string similar to {0}: Resultset Closed. Total rows={1}, skipped rows={2}, size (bytes)={3}. + + + + + Looks up a localized string similar to {0}: Set Database: {1}. + + + + + Looks up a localized string similar to {0}: Statement closed: statement id = {1}. + + + + + Looks up a localized string similar to {0}: Statement executed: statement id = {1}. + + + + + Looks up a localized string similar to {0}: Statement prepared: sql='{1}', statement id={2}. + + + + + Looks up a localized string similar to {0}: Usage Advisor Warning: Query is using a bad index. + + + + + Looks up a localized string similar to {0}: Usage Advisor Warning: The field '{2}' was converted to the following types: {3}. + + + + + Looks up a localized string similar to {0}: Usage Advisor Warning: Query does not use an index. + + + + + Looks up a localized string similar to {0}: Usage Advisor Warning: The following columns were not accessed: {2}. + + + + + Looks up a localized string similar to {0}: Usage Advisor Warning: Skipped {2} rows. Consider a more focused query.. + + + + + Looks up a localized string similar to {0}: MySql Warning: Level={1}, Code={2}, Message={3}. + + + + + Looks up a localized string similar to Type '{0}' is not derived from BaseCommandInterceptor. + + + + + Looks up a localized string similar to Type '{0}' is not derived from BaseExceptionInterceptor. + + + + + Looks up a localized string similar to Unable to connect to any of the specified MySQL hosts.. + + + + + Looks up a localized string similar to Unable to create plugin for authentication method '{0}'. Please see inner exception for details.. + + + + + Looks up a localized string similar to Unable to derive stored routine parameters. The 'Parameters' information schema table is not available and access to the stored procedure body has been disabled.. + + + + + Looks up a localized string similar to Unable to enable query analysis. Be sure the MySql.Data.EMTrace assembly is properly located and registered.. + + + + + Looks up a localized string similar to An error occured attempting to enumerate the user-defined functions. Do you have SELECT privileges on the mysql.func table?. + + + + + Looks up a localized string similar to Unable to execute stored procedure '{0}'.. + + + + + Looks up a localized string similar to There was an error parsing the foreign key definition.. + + + + + Looks up a localized string similar to Error encountered reading the RSA public key.. + + + + + Looks up a localized string similar to Unable to retrieve stored procedure metadata for routine '{0}'. Either grant SELECT privilege to mysql.proc for this user or use "check parameters=false" with your connection string.. + + + + + Looks up a localized string similar to Unable to start a second async operation while one is running.. + + + + + Looks up a localized string similar to Unix sockets are not supported on Windows. + + + + + Looks up a localized string similar to Unknown authentication method '{0}' was requested.. + + + + + Looks up a localized string similar to Unknown connection protocol. + + + + + Looks up a localized string similar to Value '{0}' is not of the correct type.. + + + + + Looks up a localized string similar to The requested column value could not be treated as or conveted to a Guid.. + + + + + Looks up a localized string similar to Windows authentication connections are not supported on {0}. + + + + + Looks up a localized string similar to Writing to the stream failed.. + + + + + Looks up a localized string similar to Parameter '{0}' is not found but a parameter with the name '{1}' is found. Parameter names must include the leading parameter marker.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Appdata path is not defined.. + + + + + Looks up a localized string similar to Authentication failed using MYSQL41 and SHA256_MEMORY. Check the user name and password or try using a secure connection.. + + + + + Looks up a localized string similar to You can't get more sessions because Client is closed.. + + + + + Looks up a localized string similar to Client option '{0}' does not support value '{1}'.. + + + + + Looks up a localized string similar to Client option '{0}' is not recognized as valid.. + + + + + Looks up a localized string similar to {0} '{1}' does not exist in schema '{2}'.. + + + + + Looks up a localized string similar to '{0}' cannot be set to false with DNS SRV lookup enabled.. + + + + + Looks up a localized string similar to Scheme '{0}' is not valid.. + + + + + + Looks up a localized string similar to Compression using {0} is not supported.. + + + + + Looks up a localized string similar to Failed to load libzstd.dll. Removing zstd_stream from the client supported compression algorithms.. + + + + + Looks up a localized string similar to Compression using {0} is not supported in .NET Framework.. + + + + + Looks up a localized string similar to The connection property 'compression' acceptable values are: 'preferred', 'required' or 'disabled'. The value '{0}' is not acceptable.. + + + + + Looks up a localized string similar to Compression is not enabled.. + + + + + Looks up a localized string similar to Compression requested but the server does not support it.. + + + + + Looks up a localized string similar to There are still decompressed messages pending to be processed.. + + + + + Looks up a localized string similar to Duplicate key '{0}' used in "connection-attributes".. + + + + + Looks up a localized string similar to Key name in connection attribute cannot be an empty string.. + + + + + Looks up a localized string similar to At least one option must be specified.. + + + + + Looks up a localized string similar to This feature is currently not supported.. + + + + + Looks up a localized string similar to This functionality is only supported in MySQL {0} and higher.. + + + + + Looks up a localized string similar to Collation with id '{0}' not found.. + + + + + Looks up a localized string similar to The value of "connection-attributes" must be either a boolean or a list of key-value pairs.. + + + + + Looks up a localized string similar to Connection Data is incorrect.. + + + + + Looks up a localized string similar to The connection string is invalid.. + + + + + Looks up a localized string similar to '{0}' is not a valid connection string attribute.. + + + + + Looks up a localized string similar to The connection timeout value must be a positive integer (including 0).. + + + + + Looks up a localized string similar to Decimal (BCD) format is invalid.. + + + + + Looks up a localized string similar to Field type with name '{0}' not found.. + + + + + Looks up a localized string similar to Index type with name '{0}' not found.. + + + + + Looks up a localized string similar to The value provided is not a valid JSON document. {0}. + + + + + Looks up a localized string similar to {0} is not a valid column name in the row.. + + + + + Looks up a localized string similar to {0} is not a valid index for the row.. + + + + + Looks up a localized string similar to Session state is not valid.. + + + + + Looks up a localized string similar to Invalid Uri . + + + + + Looks up a localized string similar to Invalid uri query value. + + + + + Looks up a localized string similar to Key names in "connection-attributes" cannot start with "_".. + + + + + Looks up a localized string similar to Json configuration must contain 'uri' or 'host' but not both.. + + + + + Looks up a localized string similar to Keyword '{0}' not found.. + + + + + Looks up a localized string similar to Keyword not supported.. + + + + + Looks up a localized string similar to Field '{0}' is mandatory.. + + + + + Looks up a localized string similar to Missed required 'schema' option.. + + + + + Looks up a localized string similar to More than one document id was generated. Please use the DocumentIds property instead.. + + + + + Looks up a localized string similar to There is no data at index {0}. + + + + + Looks up a localized string similar to No 'host' has been specified.. + + + + + Looks up a localized string similar to No more data in resultset.. + + + + + Looks up a localized string similar to Object '{0}' not found. + + + + + Looks up a localized string similar to No placeholders.. + + + + + Looks up a localized string similar to {0} must be a value greater than 0.. + + + + + Looks up a localized string similar to Path not found '{0}'.. + + + + + Looks up a localized string similar to Queue timeout expired. The timeout period elapsed prior to getting a session from the pool.. + + + + + Looks up a localized string similar to Providing a port number as part of the host address isn't supported when using connection strings in basic format or anonymous objects. Use URI format instead.. + + + + + Looks up a localized string similar to You must either assign no priority to any of the hosts or give a priority for every host.. + + + + + Looks up a localized string similar to The priority must be between 0 and 100.. + + + + + Looks up a localized string similar to ProgramData path is not defined.. + + + + + Looks up a localized string similar to The server doesn't support the requested operation. Please update the MySQL Server and/or Client library. + + + + + Looks up a localized string similar to The process of closing the resultset and resulted in results being lost.. + + + + + Looks up a localized string similar to All server connection attempts were aborted. Timeout of {0} milliseconds was exceeded for each selected server.. + + + + + Looks up a localized string similar to All server connection attempts were aborted. Timeout was exceeded for each selected server.. + + + + + Looks up a localized string similar to Connection attempt to the server was aborted. Timeout of {0} milliseconds was exceeded.. + + + + + Looks up a localized string similar to Connection attempt to the server was aborted. Timeout was exceeded.. + + + + + Looks up a localized string similar to Unable to connect to any specified host.. + + + + + Looks up a localized string similar to Unable to read or decode data value.. + + + + + Looks up a localized string similar to Unable to open a session.. + + + + + Looks up a localized string similar to Unexpected end of packet found while reading data values. + + + + + Looks up a localized string similar to Field name '{0}' is not allowed.. + + + + + Looks up a localized string similar to Unknown placeholder :{0}. + + + + + Looks up a localized string similar to Value '{0}' is not of the correct type.. + + + + + Summary description for MySqlUInt64. + + + + + An exception thrown by MySQL when a type conversion does not succeed. + + + + Initializes a new instance of the class with a specified error message. + Message describing the error. + + + + Represents a datetime data type object in a MySql database. + + + + + Defines whether the UTF or local timezone will be used. + + + + + Constructs a new MySqlDateTime object by setting the individual time properties to + the given values. + + The year to use. + The month to use. + The day to use. + The hour to use. + The minute to use. + The second to use. + The microsecond to use. + + + + Constructs a new MySqlDateTime object by using values from the given object. + + The object to copy. + + + + Constructs a new MySqlDateTime object by copying the current value of the given object. + + The MySqlDateTime object to copy. + + + + Enables the contruction of a MySqlDateTime object by parsing a string. + + + + + Indicates if this object contains a value that can be represented as a DateTime + + + + Returns the year portion of this datetime + + + Returns the month portion of this datetime + + + Returns the day portion of this datetime + + + Returns the hour portion of this datetime + + + Returns the minute portion of this datetime + + + Returns the second portion of this datetime + + + + Returns the milliseconds portion of this datetime + expressed as a value between 0 and 999 + + + + + Returns the microseconds portion of this datetime (6 digit precision) + + + + + Returns true if this datetime object has a null value + + + + + Retrieves the value of this as a DateTime object. + + + + Returns this value as a DateTime + + + Returns a MySQL specific string representation of this value + + + + + + + + + Represents a decimal data type object in a MySql database. + + + + + Gets a boolean value signaling if the type is null. + + + + + Gets or sets the decimal precision of the type. + + + + + Gets or sets the scale of the type. + + + + + Gets the decimal value associated to this type. + + + + + Converts this decimal value to a double value. + + The value of this type converted to a dobule value. + + + + Represents a geometry data type object in a MySql database. + + + + + Gets the x coordinate. + + + + + Gets the y coordinate. + + + + + Gets the SRID value. + + + + + Gets a boolean value that signals if the type is null. + + + + + Gets the value associated to this type. + + + + + Gets the value associated to this type. + + + + Returns the Well-Known Text representation of this value + POINT({0} {1})", longitude, latitude + http://dev.mysql.com/doc/refman/4.1/en/gis-wkt-format.html + + + + Get value from WKT format + SRID=0;POINT (x y) or POINT (x y) + + WKT string format + + + + Try to get value from WKT format + SRID=0;POINT (x y) or POINT (x y) + + WKT string format + Out mysqlGeometryValue + + + + Sets the DSInfo when GetSchema is called for the DataSourceInformation collection. + + + + + Gets the well-known text representation of the geomtry object. + + A string representation of the WKT. + + + + Provides functionality for loading unmanaged libraries. + + + + + Loads the specified unmanaged library from the embedded resources. + + The application name. + The library name. + + + + Provides support for configuring X Protocol compressed messages. + + + + + The capabilities sub-key used to specify the compression algorithm. + + + + + The capabilities key used to specify the compression capability. + + + + + Messages with a value lower than this threshold will not be compressed. + + + + + Default value for enabling or disabling combined compressed messages. + + + + + Default value for the maximum number of combined compressed messages contained in a compression message. + + + + + deflate_stream compression algorithm. + + + + + lz4_message compression algorithm. + + + + + The capabilities sub-key used to specify if combining compressed messages is permitted. + + + + + The capabilities sub-key used to specify the maximum number of compressed messages contained in a compression message. + + + + + zstd_stream compression algorithm. + + + + + Buffer used to store the data received from the server. + + + + + Deflate stream used for compressing data. + + + + + Deflate stream used for decompressing data. + + + + + Flag indicating if the initialization is for compression or decompression. + + + + + Stores the communication packet generated the last time ReadNextBufferedMessage method was called. + + + + + Indicates if the libzstd.dll has been loaded. + + + + + Stream used to store multiple X Protocol messages. + + + + + ZStandard stream used for decompressing data. + + + + + Static constructor used to initialize the client supported compression algorithms. + + + + + Main constructor used to set the compression algorithm and initialize the list of messages to + be compressed by the client. + + The compression algorithm to use. + Flag indicating if the initialization is for compression or decompression. + + + + Gets or sets the list of messages that should be compressed by the client when compression is enabled. + + + + + Gets or sets an array containing the compression algorithms supported by the client. + + + + + Gets or sets the compression algorithm. + + + + + Flag indicating if compression is enabled. + + + + + Flag indicating if the last decompressed message contains multiple messages. + + + + + General method used to compress data using the compression algorithm defined in the constructor. + + The data to compress. + A compressed byte array. + + + + Compresses data using the deflate_stream algorithm. + + The data to compress. + A compressed byte array. + + + + Compresses data using the lz4_message algorithm. + + The data to compress. + A compressed byte array. + + + + Compresses data using the zstd_stream algorithm. + + The data to compress. + A compressed byte array. + + + + General method used to decompress data using the compression algorithm defined in the constructor. + + The data to decompress. + The expected length of the decompressed data. + A decompressed byte array. + + + + Decompresses data using the deflate_stream compression algorithm. + + The data to decompress. + The expected length of the decompressed data. + A decompressed byte array. + + + + Decompresses data using the lz4_message compression algorithm. + + The data to decompress. + The expected length of the decompressed data. + A decompressed byte array. + + + + Decompresses data using the zstd_stream compression algorithm. + + The data to decompress. + The expected length of the decompressed data. + A decompressed byte array. + + + + Closes and disposes of any open streams. + + + + + Gets the byte array representing the next X Protocol frame that is stored in cache. + + A byte array representing an X Protocol frame. + + + + Gets a representing the next X Protocol frame that is stored in cache. + + A with the next X Protocol frame. + + + + Loads the libzstd.dll assembly. + + + + + This object store the required parameters to create a Collection with schema validation. + + If false, throws an exception if the collection exists. + Object which hold the Level and Schema parameters + + + + + This object store the required parameters to Modify a Collection with schema validation. + + Object which hold the Level and Schema parameters + + + + + This object store the required parameters to create a Collection with schema validation. + + It can be STRICT to enable schema validation or OFF to disable + The JSON which define the rules to be validated in the collection + + + + The possible values for parameter Level in Validation object. + + Enforce schema validation. + Schema validation disabled. + + + + Implementation of EXTERNAL authentication type. + + + + + Implementation of MySQL41 authentication type. + + + + + Implementation of PLAIN authentication type. + + + + + Compares two Guids in string format. + + The first string to compare. + The first string to compare. + An integer that indicates the lexical relationship between the two comparands, similar to + + + + Compares two objects. + + The first to compare. + The second to compare. + An integer that indicates the lexical relationship between the two comparands, similar to + + + + Constructor that sets the stream used to read or write data. + + The stream used to read or write data. + + + + Constructor that sets the stream used to read or write data and the compression controller. + + The stream used to read or write data. + The compression controller. + + + + Gets or sets the compression controller uses to manage compression operations. + + + + + Writes X Protocol frames to the X Plugin. + + The integer representation of the client message identifier used for the message. + The message to include in the X Protocol frame. + + + + Writes X Protocol frames to the X Plugin. + + The client message identifier used for the message. + The message to include in the X Protocol frame. + + + + Reads X Protocol frames incoming from the X Plugin. + + A instance representing the X Protocol frame that was read. + + + + Abstract class for the protocol base operations in client/server communication. + + + + + Expression parser for MySQL-X protocol. + + + string being parsed. + + + Token stream produced by lexer. + + + Parser's position in token stream. + + + Mapping of names to positions for named placeholders. Used for both string values ":arg" and numeric values ":2". + + + Number of positional placeholders. + + + Are relational columns identifiers allowed? + + + Token types used by the lexer. + + + Token. Includes type and string value of the token. + + + Mapping of reserved words to token types. + + + Does the next character equal the given character? (respects bounds) + + + Helper function to match integer or floating point numbers. This function should be called when the position is on the first character of the number (a + digit or '.'). + + @param i The current position in the string + @return the next position in the string after the number. + + + Lexer for MySQL-X expression language. + + + Assert that the token at pos is of type type. + + + Does the current token have type `t'? + + + Does the next token have type `t'? + + + Does the token at position `pos' have type `t'? + + + Consume token. + + @return the string value of the consumed token + + + Parse a paren-enclosed expression list. This is used for function params or IN params. + + @return a List of expressions + + + Parse a function call of the form: IDENTIFIER PAREN_EXPR_LIST. + + @return an Expr representing the function call. + + + Parse an identifier for a function call: [schema.]name + + + Parse a document path member. + + + Parse a document path array index. + + + Parse a JSON-style document path, like WL#7909, but prefix by @. instead of $. + + + Parse a document field. + + + Parse a column identifier (which may optionally include a JSON document path). + + + Build a unary operator expression. + + + Parse an atomic expression. (c.f. grammar at top) + + + Parse a left-associated binary operator. + + @param types + The token types that denote this operator. + @param innerParser + The inner parser that should be called to parse operands. + @return an expression tree of the binary operator or a single operand + + + Parse the entire string as an expression. + + @return an X-protocol expression tree + + + + Parse an ORDER BY specification which is a comma-separated list of expressions, each may be optionally suffixed by ASC/DESC. + + + Parse a SELECT projection which is a comma-separated list of expressions, each optionally suffixed with a target alias. + + + Parse an INSERT field name. + @todo unit test + + + Parse an UPDATE field which can include can document paths. + + + Parse a document projection which is similar to SELECT but with document paths as the target alias. + + + Parse a list of expressions used for GROUP BY. + + + @return the number of positional placeholders in the expression. + + + @return a mapping of parameter names to positions. + + + Proto-buf helper to build a LITERAL Expr with a Scalar NULL type. + + + Proto-buf helper to build a LITERAL Expr with a Scalar DOUBLE type (wrapped in Any). + + + Proto-buf helper to build a LITERAL Expr with a Scalar SINT (signed int) type (wrapped in Any). + + + Proto-buf helper to build a LITERAL Expr with a Scalar UINT (unsigned int) type (wrapped in Any). + + + Proto-buf helper to build a LITERAL Expr with a Scalar STRING type (wrapped in Any). + + + Proto-buf helper to build a LITERAL Expr with a Scalar OCTETS type (wrapped in Any). + + + Proto-buf helper to build a LITERAL Expr with a Scalar BOOL type (wrapped in Any). + + + Wrap an Any value in a LITERAL expression. + + + Build an Any with a string value. + + + + Parses an anonymous object into a dictionary. + + The object to parse. + A dictionary if the provided object is an anonymous object; otherwise, null. + + + List of operators which will be serialized as infix operators. + + + Scalar to string. + + + JSON document path to string. + + + Column identifier (or JSON path) to string. + + + Function call to string. + + + Create a string from a list of (already stringified) parameters. Surround by parens and separate by commas. + + + Convert an operator to a string. Includes special cases for chosen infix operators (AND, OR) and special forms such as LIKE and BETWEEN. + + + Escape a string literal. + + + Quote a named identifer. + + + Serialize an expression to a string. + + + + Build the message to be sent to MySQL Server to execute statement "Create" or "Modify" collection with schema options + + The namespace + The name of the command to be executed on MySql Server + Array of KeyValuePairs with the parameters required to build the message + void. + + + + Sends the delete documents message + + + + + Sends the CRUD modify message + + + + + Class implementation for a default communication kind. + + + + + Constructor method for the communication routing service + + A MySqlXConnectionStringBuilder setted with the information to use in the connection + + + + Gets the current connection base on the connection mode + + One of the values of ConnectionMode Offline, ReadOnly, WriteOnly, ReadWrite + + + + + Abstract class used to define the kind of server in environments with multiple types of distributed systems. + + + + + Main class for parsing json strings. + + + + + Initializes a new instance of the JsonParser class. + + + + + Parses the received string into a dictionary. + + The string to parse. + A object that represents the parsed string. + + + + Abstract class to manage and encapsulate one or more actual connections. + + + + + Creates a new session object with the values of the settings parameter. + + Settings to be used in the session object + + + + Sets the connection's charset default collation. + + The opened session. + The character set. + + + + Gets the version of the server. + + An instance of containing the server version. + + + + Gets the thread Id of the connection. + + Thread Id + + + + Implementation class for object that manages low-level work of queuing tasks onto threads. + + + + + Implementation class of InternalSession to manage connections using the Xprotocol type object. + + + + + Defines the compression controller that will be passed on the instance when + compression is enabled. + + + + + Defines the compression controller that will be passed on the instance when + compression is enabled. + + + + + The used client to handle SSH connections. + + + + + Negotiates compression capabilities with the server. + + An array containing the compression algorithms supported by the server. + + + + Prepare the dictionary of arguments required to create a MySQL message. + + The name of the MySQL schema. + The name of the collection. + This object hold the parameters required to create the collection. + + Collection referente. + + + + Prepare the dictionary of arguments required to Modify a MySQL message. + + The name of the MySQL schema. + The name of the collection. + This object hold the parameters required to Modify the collection. + + Collection referente. + + + + Gets the compression algorithm being used to compress or decompress data. + + Flag to indicate if the compression algorithm should be + retrieved from the reader or writer controller. + The name of the compression algorithm being used if any. + null if no compression algorithm is being used. + + + + Represents a base class for a Session. + + + + + Flag to set if prepared statements are supported. + + + + + Gets the connection settings for this session. + + + + + Gets the currently active schema. + + + + + Gets the default schema provided when creating the session. + + + + + Gets the connection uri representation of the connection options provided during the creation of the session. + + + + + Initializes a new instance of the BaseSession class based on the specified connection string. + + The connection used to create the session. + is null. + Unable to parse the when + in URI format. + + When using Unix sockets the protocol=unix or protocol=unixsocket connection option is required. + This will enable elements passed in the server connection option to be treated as Unix sockets. The user is also required + to explicitly set sslmode to none since X Plugin does not support SSL when using Unix sockets. Note that + protocol=unix and protocol=unixsocket are synonyms. +   + Multiple hosts can be specified as part of the , + which enables client-side failover when trying to establish a connection. +   + Connection URI examples: + - mysqlx://test:test@[192.1.10.10,localhost] + - mysqlx://test:test@[192.1.10.10,127.0.0.1] + - mysqlx://root:@[../tmp/mysqlx.sock,/tmp/mysqld.sock]?protocol=unix&sslmode=none + - mysqlx://test:test@[192.1.10.10:33060,127.0.0.1:33060] + - mysqlx://test:test@[192.1.10.10,120.0.0.2:22000,[::1]:33060]/test?connectiontimeout=10 + - mysqlx://test:test@[(address=server.example,priority=20),(address=127.0.0.1,priority=100)] + - mysqlx://test:test@[(address=server.example,priority=100),(address=127.0.0.1,priority=75),(address=192.0.10.56,priority=25)] + +   + Connection string examples: + - server=10.10.10.10,localhost;port=33060;uid=test;password=test; + - host=10.10.10.10,192.101.10.2,localhost;port=5202;uid=test;password=test; + - host=./tmp/mysqld.sock,/var/run/mysqldx.sock;port=5202;uid=root;protocol=unix;sslmode=none; + - server=(address=server.example,priority=20),(address=127.0.0.1,priority=100);port=33060;uid=test;password=test; + - server=(address=server.example,priority=100),(address=127.0.0.1,priority=75),(address=192.0.10.56,priority=25);port=33060;uid=test;password=test; + +   + Failover methods + - Sequential: Connection attempts will be performed in a sequential order, that is, one after another until + a connection is successful or all the elements from the list have been tried. + + - Priority based: If a priority is provided, the connection attemps will be performed in descending order, starting + with the host with the highest priority. Priority must be a value between 0 and 100. Additionally, it is required to either + give a priority for every host or no priority to any host. + + + + + + Initializes a new instance of the BaseSession class based on the specified anonymous type object. + + The connection data as an anonymous type used to create the session. + is null. + + Multiple hosts can be specified as part of the , which enables client-side failover when trying to + establish a connection. +   + To assign multiple hosts, create a property similar to the connection string examples shown in + . Note that the value of the property must be a string. + + + + + + Drops the database/schema with the given name. + + The name of the schema. + is null. + + + + Creates a schema/database with the given name. + + The name of the schema/database. + A object that matches the recently created schema/database. + + + + Gets the schema with the given name. + + The name of the schema. + A object set with the provided schema name. + + + + Gets a list of schemas (or databases) in this session. + + A list containing all existing schemas (or databases). + + + + Starts a new transaction. + + + + + Commits the current transaction. + + A object containing the results of the commit operation. + + + + Rolls back the current transaction. + + + + + Closes this session or releases it to the pool. + + + + + Closes this session + + + + + Sets a transaction savepoint with an autogenerated name. + + The autogenerated name of the transaction savepoint. + + + + Sets a named transaction savepoint. + + The name of the transaction savepoint. + The name of the transaction savepoint. + + + + Removes the named savepoint from the set of savepoints within the current transaction. + + The name of the transaction savepoint. + + + + Rolls back a transaction to the named savepoint without terminating the transaction. + + The name of the transaction savepoint. + + + + Parses the connection data. + + The connection string or connection URI. + An updated connection string representation of the provided connection string or connection URI. + + + + Parses a connection URI. + + The connection URI to parse. + The connection string representation of the provided . + + + + Validates if the string provided is a Unix socket file. + + The Unix socket to evaluate. + true if is a valid Unix socket; otherwise, false. + + + + Converts the URI object into a connection string. + + An instance with the values for the provided connection options. + The path of the Unix socket file. + If true the replaces the value for the server connection option; otherwise, false + A connection string. + + + + Parses a connection string. + + The connection string to parse. + The parsed connection string. + + + + Normalizes the Unix socket by removing leading and ending parenthesis as well as removing special characters. + + The Unix socket to normalize. + A normalized Unix socket. + + + + Disposes the current object. Disposes of the managed state if the flag is set to true. + + Flag to indicate if the managed state is to be disposed. + + + + Disposes the current object. Code added to correctly implement the disposable pattern. + + + + + Describes the state of the session. + + + + + The session is closed. + + + + + The session is open. + + + + + The session object is connecting to the data source. + + + + + The session object is executing a command. + + + + + Class encapsulating a session pooling functionality. + + + + + Queue of demoted hosts. + + + + + List of hosts that will be attempted to connect to. + + + + + Timer to be used when a host have been demoted. + + + + + Remove hosts from the demoted list that have already been there for more + than 120,000 milliseconds and add them to the available hosts list. + + + + + Get a session from pool or create a new one. + + + + + + Closes all sessions the Client object created and destroys the managed pool. + + + + + Represents a collection of documents. + + + + + Creates an containing the provided objects that can be used to add + one or more items to a collection. + + The objects to add. + An object containing the objects to add. + is null. + This method can take anonymous objects, domain objects, or just plain JSON strings. + The statement can be further modified before execution. + + + + Creates a with the given condition that can be used to remove + one or more documents from a collection.The statement can then be further modified before execution. + + The condition to match documents. + A object set with the given condition. + is null or white space. + The statement can then be further modified before execution. + + + + Removes the document with the given identifier. + + The unique identifier of the document to replace. + A object containing the results of the execution. + is null or white space. + This is a direct execution method. + + + + Creates a with the given condition that can be used to modify one or more + documents from a collection. + + The condition to match documents. + A object set with the given condition. + is null or white space. + The statement can then be further modified before execution. + + + + Replaces the document matching the given identifier. + + The unique identifier of the document to replace. + The document to replace the matching document. + A object containing the results of the execution. + is null or whitespace. + is null. + This is a direct execution method. Operation succeeds even if no matching document was found; + in which case, the Result.RecordsAffected property is zero. If the new document contains an identifier, the value + is ignored. + + + + Adds the given document to the collection unless the identifier or any other field that has a unique index + already exists, in which case it will update the matching document. + + The unique identifier of the document to replace. + The document to replace the matching document. + A object containing the results of the execution. + The server version is lower than 8.0.3. + is null or white space. + is null. + The is different from the one in . + This is a direct execution method. + + + + Returns the number of documents in this collection on the server. + + The number of documents found. + + + + Creates a with the given condition which can be used to find documents in a + collection. + + An optional condition to match documents. + A object set with the given condition. + The statement can then be further modified before execution. + + + + Creates an index based on the properties provided in the JSON document. + + The index name. + JSON document describing the index to be created. + + is a JSON document with the following fields: + + - fields: array of IndexField objects, each describing a single document member to be + included in the index (see below). + - type: string, (optional) the type of index. One of INDEX or SPATIAL. Default is INDEX and may + be omitted. + +   + A single IndexField description consists of the following fields: + + - field: string, the full document path to the document member or field to be indexed. + - type: string, one of the supported SQL column types to map the field into (see the following list). + For numeric types, the optional UNSIGNED keyword may follow. For the TEXT type, the length to consider for + indexing may be added. + - required: bool, (optional) true if the field is required to exist in the document. defaults to + false, except for GEOJSON where it defaults to true. + - options: int, (optional) special option flags for use when decoding GEOJSON data. + - srid: int, (optional) srid value for use when decoding GEOJSON data. + +   + Supported SQL column types: + + - INT [UNSIGNED] + - TINYINT [UNSIGNED] + - SMALLINT [UNSIGNED] + - MEDIUMINT [UNSIGNED] + - INTEGER [UNSIGNED] + - BIGINT [UNSIGNED] + - REAL [UNSIGNED] + - FLOAT [UNSIGNED] + - DOUBLE [UNSIGNED] + - DECIMAL [UNSIGNED] + - NUMERIC [UNSIGNED] + - DATE + - TIME + - TIMESTAMP + - DATETIME + - TEXT[(length)] + - CHAR[(lenght)] + - GEOJSON (extra options: options, srid) + + + + + + Drops a collection index. + + The index name. + is null or white space. + + + + Verifies if the current collection exists in the server schema. + + true if the collection exists; otherwise, false. + + + + Returns the document with the given identifier. + + The unique identifier of the document to replace. + A object if a document matching given identifier exists; otherwise, null. + is null or white space. + This is a direct execution method. + + + + Base abstract class that defines elements inherited by all result types. + + + + + Gets the number of records affected by the statement that generated this result. + + + + + Gets the object of the session. + + + + + Gets a read-only collection of objects derived from statement execution. + + + + + Gets the number of warnings in the collection derived from statement execution. + + + + + No action is performed by this method. It is intended to be overriden by child classes if required. + + + + + Base abstract class for API statement. + + + + + + Initializes a new instance of the BaseStatement class based on the specified session. + + The session where the statement will be executed. + + + + Gets the that owns the statement. + + + + + Executes the base statements. This method is intended to be defined by child classes. + + A result object containing the details of the execution. + + + + Executes a statement asynchronously. + + A result object containing the details of the execution. + + + + Validates if the session is open and valid. + + + + + Sets the status as Changed for prepared statement validation. + + + + + Converts a statement to prepared statement for a second execution + without any change but Bind, Limit, or Offset. + + + + + Abstract class for buffered results. + + Generic result type. + + + + Index of the current item. + + + + + List of generic items in this buffered result. + + + + + Flag that indicates if all items have been read. + + + + + Gets a dictionary containing the column names and their index. + + + + + Gets the page size set for this buffered result. + + + + + Loads the column data into the field. + + + + + Retrieves a read-only list of the generic items associated to this buffered result. + + A generic list representing items in this buffered result. + + + + Retrieves one element from the generic items associated to this buffered result. + + A generic object that corresponds to the current or default item. + + + + Determines if all items have already been read. + + True if all items have been retrived, false otherwise. + + + + Gets the current item. + + All items have already been read. + + + + Determines if all items have already been read. + + True if all items have been retrived, false otherwise. + + + + Resets the value of the field to zero. + + + + + Gets an representation of this object. + + An representation of this object. + + + + Gets an representation of this object. + + An representation of this object. + + + + Retrieves a read-only list of the generic items associated to this buffered result. + + A generic list representing items in this buffered result. + + + + No body has been defined for this method. + + + + + Class to represent an error in this result. + + + + + Numeric code. + + + + + Return code indicating the outcome of the executed SQL statement. + + + + + Error message. + + + + + Initializes a new instance of the ErrorInfo class. + + + + + Abstract class for filterable statements. + + The filterable statement. + The database object. + The type of result. + + + + Initializes a new instance of the FiltarableStatement class based on the target and condition. + + The database object. + The optional filter condition. + + + + Enables the setting of Where condition for this operation. + + The Where condition. + The implementing statement type. + + + + Sets the number of items to be returned by the operation. + + The number of items to be returned. + The implementing statement type. + is equal or lower than 0. + + + + Sets the number of items to be skipped before including them into the result. + + The number of items to be skipped. + The implementing statement type. + + + + Binds the parameter values in filter expression. + + The parameter name. + The value of the parameter. + A generic object representing the implementing statement type. + + + + Binds the parameter values in filter expression. + + The parameters as a DbDoc object. + A generic object representing the implementing statement type. + + + + Binds the parameter values in filter expression. + + The parameters as a JSON string. + The implementing statement type. + + + + Binds the parameter values in filter expression. + + The parameters as an anonymous object: new { param1 = value1, param2 = value2, ... }. + The implementing statement type. + + + + Executes the statement. + + The function to execute. + The generic object to use. + A generic result object containing the results of the execution. + + + + Clones the filterable data but Session and Target remain the + same. + + A clone of this filterable statement. + + + + Represents a general statement result. + + + + + Gets the last inserted identifier (if there is one) by the statement that generated this result. + + + + + Gets the list of generated identifiers in the order of the Add() calls. + + + + + Abstract class to select a database object target. + + The database object. + The execution result. + + + + Initializes a new instance of the TargetedBaseStatement class based on the provided target. + + The database object. + + + + Gets the database target. + + + + + Represents a warning in this result. + + + + + Numeric value associated to the warning message. + + + + + Error message. + + + + + Strict level for the warning. + + + + + Initializes a new instance of the WarningInfo class based on the code and msg. + + The code for the warning. + The error message for the warning. + + + + Represents a chaining collection insert statement. + + + + + Adds documents to the collection. + + The documents to add. + This object. + The array is null. + + + + Executes the Add statement. + + A object containing the results of the execution. + + + + Implementation class for CRUD statements with collections using an index. + + + + + Executes this statement. + + A object containing the results of the execution. + + + + Represents a collection statement. + + + + + + Converts base s into objects. + + Array of objects to be converted to objects. + An enumerable collection of objects. + + + + Represents the result of an operation that includes a collection of documents. + + + + + Represents a chaining collection find statement. + + + + + List of column projections that shall be returned. + + List of columns. + This object set with the specified columns or fields. + + + + Executes the Find statement. + + A object containing the results of execution and data. + + + + Locks matching rows against updates. + + Optional row lock option to use. + This same object set with the lock shared option. + The server version is lower than 8.0.3. + + + + Locks matching rows so no other transaction can read or write to it. + + Optional row lock option to use. + This same object set with the lock exclusive option. + The server version is lower than 8.0.3. + + + + Sets the collection aggregation. + + The field list for aggregation. + This same object set with the specified group-by criteria. + + + + Filters criteria for aggregated groups. + + The filter criteria for aggregated groups. + This same object set with the specified filter criteria. + + + + Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object representing the implementing statement type. + + + + Enables the setting of Where condition for this operation. + + The Where condition. + The implementing statement type. + + + + Represents a chaining collection modify statement. + + + + + Sets key and value. + + The document path key. + The new value. + This object. + + + + Changes value for a key. + + The document path key. + The new value. + This object. + + + + Removes keys or values from a document. + + An array of document paths representing the keys to be removed. + This object. + + + + Creates a object set with the changes to be applied to all matching documents. + + The JSON-formatted object describing the set of changes. + A object set with the changes described in . + can be a object, an anonymous object, or a JSON string. + is null. + is null or white space. + + + + Inserts an item into the specified array. + + The document path key including the index on which the item will be inserted. + The value to insert into the array. + A object containing the updated array. + + + + Appends an item to the specified array. + + The document path key. + The value to append to the array. + A object containing the updated array. + + + + Allows the user to set the sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object representing the implementing statement type. + + + + Enables the setting of Where condition for this operation. + + The Where condition. + The implementing statement type. + + + + Executes the modify statement. + + A object containing the results of the execution. + + + + Represents a chaining collection remove statement. + + + + + Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object representing the implementing statement type. + + + + Enables the setting of Where condition for this operation. + + The Where condition. + The implementing statement type. + + + + Executes the remove statement. + + A object containing the results of the execution. + + + + Represents a database object. + + + + + Gets the session that owns the database object. + + + + + Gets the schema that owns the database object. + + + + + Gets the database object name. + + + + + Verifies that the database object exists in the database. + + True if the object exists in database, false otherwise. + + + + Represents a generic document in JSON format. + + + + + Initializes a new instance of the DbDoc class based on the object provided. The value can be a domain object, anonymous object, or JSON string. + + The value for this DbDoc. + + + + Gets the value of a document property. + + The key path for the property. + + + + + Gets the identifier of the document. + + + + + Gets a value indicating if this document has an identifier (property named _id with a value). + + + + + Sets a property on this document. + + The key of the property. + The new property value. + + + + Returns this document in Json format. + + A Json formatted string. + + + + Compares this DbDoc with another one. + + The DbDoc to compare to. + True if they are equal, false otherwise. + + + + Gets a value that serves as a hash function for a particular type. + + A hash code for the current object. + + + + Represents a collection of documents with a generic type. + + + + + Initializes a new instance of the generic Collection class based on the specified schema + and name. + + The object associated to this collection. + The name of the collection. + + + + Creates an containing the provided generic object. The add + statement can be further modified before execution. + + The generic object to add. + An object containing the object to add. + + + + Defines elements that allow to iterate through the contents of various items. + + + + + Initializes a new instance of the Iterator class. + + + + + This method is not yet implemented. + + + + Exception is always thrown since the body of the method is not yet implemented. + + + + Main class for session operations related to Connector/NET implementation of the X DevAPI. + + + + + Opens a session to the server given or to the first available server if multiple servers were specified. + + The connection string or URI string format. + A object representing the established session. + Multiple hosts can be specified as part of the which + will enable client side failover when trying to establish a connection. For additional details and syntax + examples refer to the remarks section. + + + + Opens a session to the server given. + + The connection data for the server. + A object representing the established session. + + + + Creates a new instance. + + The connection string or URI string format. + The connection options in JSON string format. + A object representing a session pool. + + + + Creates a new instance. + + The connection string or URI string format. + The connection options in object format. + + + new { pooling = new + { + enabled = true, + maxSize = 15, + maxIdleTime = 60000, + queueTimeout = 60000 + } + } + + + + A object representing a session pool. + + + + Creates a new instance. + + The connection data. + The connection options in JSON string format. + A object representing a session pool. + + + + Creates a new instance. + + The connection data. + The connection options in object format. + + + new { pooling = new + { + enabled = true, + maxSize = 15, + maxIdleTime = 60000, + queueTimeout = 60000 + } + } + + + + A object representing a session pool. + + + + Enables the creation of connection strings by exposing the connection options as properties. + Contains connection options specific to the X protocol. + + + + + Main constructor. + + + + + Constructor accepting a connection string. + + The connection string. + + + + Readonly field containing a collection of classic protocol and protocol shared connection options. + + + + + Gets or sets the connection timeout. + + + + + Gets or sets the connection attributes. + + + + + Path to a local file containing certificate revocation lists. + + + + + Gets or sets the compression type between client and server. + + + + + Gets or sets a connection option. + + The keyword that identifies the connection option to modify. + + + + Represents a table column. + + + + + Gets the original column name. + + + + + Gets the alias of the column name. + + + + + Gets the table name the column orginates from. + + + + + Gets the alias of the table name . + + + + + Gets the schema name the column originates from. + + + + + Gets the catalog the schema originates from. + In MySQL protocol this is `def` by default. + + + + + Gets the collation used for this column. + + + + + Gets the character set used for this column. + + + + + Gets the column length. + + + + + Gets the fractional decimal digits for floating point and fixed point numbers. + + + + + Gets the Mysql data type. + + + + + Gets the .NET Clr data type. + + + + + True if it's a signed number. + + + + + True if column is UINT zerofill or BYTES rightpad. + + + + + Initializes a new instance of the Column class. + + + + + Represents a resultset that contains rows of data. + + + + + Gets the columns in this resultset. + + + + + Gets the number of columns in this resultset. + + + + + Gets a list containing the column names in this resultset. + + + + + Gets the rows of this resultset. This collection will be incomplete unless all the rows have been read + either by using the Next method or the Buffer method. + + + + + Gets the value of the column value at the current index. + + The column index. + The CLR value at the column index. + + + + Allows getting the value of the column value at the current index. + + The column index. + The CLR value at the column index. + + + + Returns the index of the given column name. + + The name of the column to find. + The numeric index of column. + + + + Represents a single row of data in a table. + + + + + Gets the value of the row at the given index. + + The column index to retrieve the value. + The value at the index. + + + + Gets the value of the column as a string. + + The name of the column. + The value of the column as a string. + + + + Gets a string based indexer into the row. Returns the value as a CLR type. + + The column index to get. + The CLR value for the column. + + + + Inherits from . Creates a resultset that contains rows of data. + + + + + Represents a resultset that contains rows of data for relational operations. + + + + + Gets a boolean value indicating if this result has data. + + + + + Moves to next resultset. + + True if there is a new resultset, false otherwise. + + + + Represents a sql statement. + + + + + Initializes a new instance of the SqlStament class bassed on the session and sql statement. + + The session the Sql statement belongs to. + The Sql statement. + + + + Gets the current Sql statement. + + + + + Gets the list of parameters associated to this Sql statement. + + + + + Executes the current Sql statement. + + A object with the resultset and execution status. + + + + Binds the parameters values by position. + + The parameter values. + This set with the binded parameters. + + + + Represents a server Table or View. + + + + + Gets a value indicating whether the object is + a View (True) or a Table (False). + + + + + Creates a set with the columns to select. The table select + statement can be further modified before execution. This method is intended to select a set + of table rows. + + The optional column names to select. + A object for select chain operations. + + + + Creates a set with the fileds to insert to. The table + insert statement can be further modified before exeuction. This method is intended to + insert one or multiple rows into a table. + + The list of fields to insert. + A object for insert chain operations. + + + + Creates a . This method is intended to update table rows + values. + + A object for update chain operations. + + + + Creates a . This method is intended to delete rows from a + table. + + A object for delete chain operations. + + + + Returns the number of rows in the table on the server. + + The number of rows. + + + + Verifies if the table exists in the database. + + true if the table exists; otherwise, false. + + + + Represents a chaining table delete statement. + + + + + Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object representing the implementing statement type. + + + + Executes the delete statement. + + A object containing the results of the delete execution. + + + + Represents a chaining table insert statement. + + + + + Executes the insert statement. + + A object containing the results of the insert statement. + + + + Values to be inserted. + Multiple rows supported. + + The values to be inserted. + This same object. + + + + Represents a chaining table select statement. + + + + + Executes the select statement. + + A object containing the results of the execution and data. + + + + Locks matching rows against updates. + + Optional row lock option to use. + This same object set with lock shared option. + The server version is lower than 8.0.3. + + + + Locks matching rows so no other transaction can read or write to it. + + Optional row lock option to use. + This same object set with the lock exclusive option. + The server version is lower than 8.0.3. + + + + Sets the table aggregation. + + The column list for aggregation. + This same object set with the specified group-by criteria. + + + + Filters criteria for aggregated groups. + + The filter criteria for aggregated groups. + This same object set with the specified filter criteria. + + + + Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object that represents the implementing statement type. + + + + Represents a chaining table update statement. + + + + + Executes the update statement. + + A object ocntaining the results of the update statement execution. + + + + Column and value to be updated. + + Column name. + Value to be updated. + This same object. + + + + Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like + "order ASC" or "pages DESC, age ASC". + + The order criteria. + A generic object that represents the implementing statement type. + + + + Represents a schema or database. + + + + + Session related to current schema. + + + + + Returns a list of all collections in this schema. + + A list representing all found collections. + + + + Returns a list of all tables in this schema. + + A list representing all found tables. + + + + Gets a collection by name. + + The name of the collection to get. + Ensures the collection exists in the schema. + A object matching the given name. + + + + Gets a typed collection object. This is useful for using domain objects. + + The type of collection returned. + The name of collection to get. + A generic object set with the given name. + + + + Gets the given collection as a table. + + The name of the collection. + A object set with the given name. + + + + Gets a table object. Upon return the object may or may not be valid. + + The name of the table object. + A object set with the given name. + + + + Creates a collection. + + The name of the collection to create. + If false, throws an exception if the collection exists. + Collection referente. + + + + Creates a collection including a schema validation. + + The name of the collection to create. + This object hold the parameters required to create the collection. + + Collection referente. + + + + Modify a collection adding or removing schema validation parameters. + + The name of the collection to create. + This object encapsulate the Validation parameters level and schema. + Collection referente. + + + + Drops the given collection. + + The name of the collection to drop. + is null. + + + + Determines if this schema actually exists. + + True if exists, false otherwise. + + + + Represents a single server session. + + + + + Returns a object that can be used to execute the given SQL. + + The SQL to execute. + A object set with the provided SQL. + + + + Sets the schema in the database. + + The schema name to be set. + + + + Executes a query in the database to get the current schema. + + Current database object or null if no schema is selected. + + + Holder for reflection information generated from mysqlx.proto + + + File descriptor for mysqlx.proto + + + + IDs of messages that can be sent from client to the server + + .. note:: + this message is never sent on the wire. It is only used to let ``protoc`` + + * generate constants + * check for uniqueness + + + + Container for nested types declared in the ClientMessages message type. + + + + IDs of messages that can be sent from server to client + + .. note:: + this message is never sent on the wire. It is only used to let ``protoc`` + + * generate constants + * check for uniqueness + + + + Container for nested types declared in the ServerMessages message type. + + + + NOTICE has to stay at 11 forever + + + + + generic Ok message + + + + Field number for the "msg" field. + + + + generic Error message + + A ``severity`` of ``ERROR`` indicates the current message sequence is + aborted for the given error and the session is ready for more. + + In case of a ``FATAL`` error message the client should not expect + the server to continue handling any further messages and should + close the connection. + + :param severity: severity of the error message + :param code: error-code + :param sql_state: SQL state + :param msg: human readable error message + + + + Field number for the "severity" field. + + + Field number for the "code" field. + + + Field number for the "sql_state" field. + + + Field number for the "msg" field. + + + Container for nested types declared in the Error message type. + + + Holder for reflection information generated from mysqlx_connection.proto + + + File descriptor for mysqlx_connection.proto + + + + a Capability + + a tuple of a ``name`` and a :protobuf:msg:`Mysqlx.Datatypes::Any` + + + + Field number for the "name" field. + + + Field number for the "value" field. + + + + Capabilities + + + + Field number for the "capabilities" field. + + + + get supported connection capabilities and their current state + + :returns: :protobuf:msg:`Mysqlx.Connection::Capabilities` or :protobuf:msg:`Mysqlx::Error` + + + + + sets connection capabilities atomically + + only provided values are changed, other values are left unchanged. + If any of the changes fails, all changes are discarded. + + :precond: active sessions == 0 + :returns: :protobuf:msg:`Mysqlx::Ok` or :protobuf:msg:`Mysqlx::Error` + + + + Field number for the "capabilities" field. + + + + announce to the server that the client wants to close the connection + + it discards any session state of the server + + :Returns: :protobuf:msg:`Mysqlx::Ok` + + + + Field number for the "uncompressed_size" field. + + + Field number for the "server_messages" field. + + + Field number for the "client_messages" field. + + + Field number for the "payload" field. + + + Holder for reflection information generated from mysqlx_crud.proto + + + File descriptor for mysqlx_crud.proto + + + + DataModel to use for filters, names, ... + + + + + ViewAlgorithm defines how MySQL Server processes the view + + + + + MySQL chooses which algorithm to use + + + + + the text of a statement that refers to the view and the view definition are merged + + + + + the view are retrieved into a temporary table + + + + + ViewSqlSecurity defines the security context in which the view is going to be + executed, this means that VIEW can be executed with current user permissions or + with permissions of the uses who defined the VIEW + + + + + ViewCheckOption limits the write operations done on a `VIEW` + (`INSERT`, `UPDATE`, `DELETE`) to rows in which the `WHERE` clause is `TRUE` + + + + + the view WHERE clause is checked, but no underlying views are checked + + + + + the view WHERE clause is checked, then checking recurses to underlying views + + + + + column definition + + + + Field number for the "name" field. + + + + optional + + + + Field number for the "alias" field. + + + + optional + + + + Field number for the "document_path" field. + + + + a projection + + :param source: the expression identifying an element from the source data + which can include a column identifier or any expression + :param alias: optional alias. Required for DOCUMENTs (clients may use + the source string as default) + + + + Field number for the "source" field. + + + + required + + + + Field number for the "alias" field. + + + + optional + + + + + collection + + + + Field number for the "name" field. + + + + required + + + + Field number for the "schema" field. + + + + optional + + + + + limit + + :param row_count: maximum rows to filter + :param offset: maximum rows to skip before applying the row_count + + + + Field number for the "row_count" field. + + + + required + + + + Field number for the "offset" field. + + + + optional + + + + + limit expression + + LimitExpr in comparison to Limit, is able to specify that row_count and + offset are placeholders. + This message support expressions of following types Expr/literal/UINT, + Expr/PLACEHOLDER. + + :param row_count: maximum rows to filter + :param offset: maximum rows to skip before applying the row_count + + + + Field number for the "row_count" field. + + + + required + + + + Field number for the "offset" field. + + + + optional + + + + + sort order + + + + Field number for the "expr" field. + + + + required + + + + Field number for the "direction" field. + + + + optional//[ default=ASC ] + + + + Container for nested types declared in the Order message type. + + + + update operations + + :param source: specification of the value to be updated + if data_model is TABLE, a column name may be specified and also a document path, if the column has type JSON + if data_model is DOCUMENT, only document paths are allowed + in both cases, schema and table must be not set + :param operation: the type of operation to be performed + :param value: an expression to be computed as the new value for the operation + + + + Field number for the "source" field. + + + + required + + + + Field number for the "operation" field. + + + + required + + + + Field number for the "value" field. + + + + optional + + + + Container for nested types declared in the UpdateOperation message type. + + + + only allowed for TABLE + + + + + no value (removes the identified path from a object or array) + + + + + sets the new value on the identified path + + + + + replaces a value if the path exists + + + + + source and value must be documents + + + + + insert the value in the array at the index identified in the source path + + + + + append the value on the array at the identified path + + + + + merge JSON object value with the provided patch expression + + + + + Find Documents/Rows in a Collection/Table + + .. uml:: + + client -> server: Find + ... one or more Resultset ... + + :param collection: collection to insert into + :param data_model: datamodel that the operations refer to + :param projection: list of column projections that shall be returned + :param args: values for parameters used in filter expression + :param criteria: filter criteria + :param limit: numbers of rows that shall be skipped and returned (user can set one of: limit, limit_expr) + :param order: sort-order in which the rows/document shall be returned in + :param grouping: column expression list for aggregation (GROUP BY) + :param grouping_criteria: filter criteria for aggregated groups + :param locking: perform row locking on matches + :param locking_options: additional options how to handle locked rows + :param limit_expr: numbers of rows that shall be skipped and returned (user can set one of: limit, limit_expr) + :Returns: :protobuf:msg:`Mysqlx.Resultset::` + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "data_model" field. + + + + optional + + + + Field number for the "projection" field. + + + Field number for the "criteria" field. + + + + optional + + + + Field number for the "args" field. + + + Field number for the "order" field. + + + Field number for the "grouping" field. + + + Field number for the "grouping_criteria" field. + + + + optional + + + + Field number for the "locking" field. + + + + optional + + + + Field number for the "locking_options" field. + + + + optional + + + + Field number for the "limit" field. + + + + optional + + + + Field number for the "limit_expr" field. + + + + optional + + + + Container for nested types declared in the Find message type. + + + + Lock matching rows against updates + + + + + Lock matching rows so no other transaction can read or write to it + + + + + Do not wait to acquire row lock, fail with an error if a requested row is locked + + + + + Do not wait to acquire a row lock, remove locked rows from the result set + + + + + Insert documents/rows into a collection/table + + :param collection: collection to insert into + :param data_model: datamodel that the operations refer to + :param projection: name of the columns to insert data into (empty if data_model is DOCUMENT) + :param row: set of rows to insert into the collection/table (a single expression with a JSON document literal or an OBJECT expression) + :param args: values for parameters used in row expressions + :param upsert: true if this should be treated as an Upsert (that is, update on duplicate key) + :Returns: :protobuf:msg:`Mysqlx.Resultset::` + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "data_model" field. + + + + optional + + + + Field number for the "projection" field. + + + Field number for the "row" field. + + + Field number for the "args" field. + + + Field number for the "upsert" field. + + + + optional//[default = false] + + + + Container for nested types declared in the Insert message type. + + + Field number for the "field" field. + + + + Update documents/rows in a collection/table + + :param collection: collection to change + :param data_model: datamodel that the operations refer to + :param criteria: filter expression to match rows that the operations will apply on + :param args: values for parameters used in filter expression + :param limit: limits the number of rows to match (user can set one of: limit, limit_expr) + :param order: specifies order of matched rows + :param operation: list of operations to be applied. Valid operations will depend on the data_model. + :param limit_expr: limits the number of rows to match (user can set one of: limit, limit_expr) + :Returns: :protobuf:msg:`Mysqlx.Resultset::` + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "data_model" field. + + + + optional + + + + Field number for the "criteria" field. + + + + optional + + + + Field number for the "args" field. + + + Field number for the "order" field. + + + Field number for the "operation" field. + + + Field number for the "limit" field. + + + + optional + + + + Field number for the "limit_expr" field. + + + + optional + + + + + Delete documents/rows from a Collection/Table + + :param collection: collection to change + :param data_model: datamodel that the operations refer to + :param criteria: filter expression to match rows that the operations will apply on + :param args: values for parameters used in filter expression + :param limit: limits the number of rows to match (user can set one of: limit, limit_expr) + :param order: specifies order of matched rows + :param limit_expr: limits the number of rows to match (user can set one of: limit, limit_expr) + :Returns: :protobuf:msg:`Mysqlx.Resultset::` + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "data_model" field. + + + + optional + + + + Field number for the "criteria" field. + + + + optional + + + + Field number for the "args" field. + + + Field number for the "order" field. + + + Field number for the "limit" field. + + + + optional + + + + Field number for the "limit_expr" field. + + + + optional + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "definer" field. + + + + optional + + + + Field number for the "algorithm" field. + + + + optional//[default = UNDEFINED] + + + + Field number for the "security" field. + + + + optional//[default = DEFINER] + + + + Field number for the "check" field. + + + + optional + + + + Field number for the "column" field. + + + Field number for the "stmt" field. + + + + required + + + + Field number for the "replace_existing" field. + + + + optional//[default = false] + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "definer" field. + + + + optional + + + + Field number for the "algorithm" field. + + + + optional + + + + Field number for the "security" field. + + + + optional + + + + Field number for the "check" field. + + + + optional + + + + Field number for the "column" field. + + + Field number for the "stmt" field. + + + + optional + + + + Field number for the "collection" field. + + + + required + + + + Field number for the "if_exists" field. + + + + optional//[ default = false ] + + + + Holder for reflection information generated from mysqlx_cursor.proto + + + File descriptor for mysqlx_cursor.proto + + + + Open a cursor + + .. uml:: + + client -> server: Open + alt Success + ... none or partial Resultsets or full Resultsets ... + client <- server: StmtExecuteOk + else Failure + client <- server: Error + end + + :param cursor_id: client side assigned cursor id, the ID is going to represent new cursor and assigned to it statement + :param stmt: statement which resultset is going to be iterated through the cursor + :param fetch_rows: number of rows which should be retrieved from sequential cursor + :Returns: :protobuf:msg:`Mysqlx.Ok::` + + + + Field number for the "cursor_id" field. + + + + required + + + + Field number for the "stmt" field. + + + + required + + + + Field number for the "fetch_rows" field. + + + + optional + + + + Container for nested types declared in the Open message type. + + + Field number for the "type" field. + + + + required + + + + Field number for the "prepare_execute" field. + + + + optional + + + + Container for nested types declared in the OneOfMessage message type. + + + + Fetch next portion of data from a cursor + + .. uml:: + + client -> server: Fetch + alt Success + ... none or partial Resultsets or full Resultsets ... + client <- server: StmtExecuteOk + else + client <- server: Error + end + + :param cursor_id: client side assigned cursor id, must be already open + :param fetch_rows: number of rows which should be retrieved from sequential cursor + + + + Field number for the "cursor_id" field. + + + + required + + + + Field number for the "fetch_rows" field. + + + + optional + + + + + Close cursor + + .. uml:: + + client -> server: Close + alt Success + client <- server: Ok + else Failure + client <- server: Error + end + + :param cursor_id: client side assigned cursor id, must be allocated/open + :Returns: :protobuf:msg:`Mysqlx.Ok|Mysqlx.Error` + + + + Field number for the "cursor_id" field. + + + + required + + + + Holder for reflection information generated from mysqlx_datatypes.proto + + + File descriptor for mysqlx_datatypes.proto + + + + a scalar + + + + Field number for the "type" field. + + + + required + + + + Field number for the "v_signed_int" field. + + + Field number for the "v_unsigned_int" field. + + + Field number for the "v_octets" field. + + + + 4 is unused, was Null which doesn't have a storage anymore + + + + Field number for the "v_double" field. + + + Field number for the "v_float" field. + + + Field number for the "v_bool" field. + + + Field number for the "v_string" field. + + + Enum of possible cases for the "DefaultOneOf" oneof. + + + Container for nested types declared in the Scalar message type. + + + + a string with a charset/collation + + + + Field number for the "value" field. + + + + required + + + + Field number for the "collation" field. + + + Enum of possible cases for the "String_present" oneof. + + + + an opaque octet sequence, with an optional content_type + See ``Mysqlx.Resultset.ColumnMetadata`` for list of known values. + + + + Field number for the "value" field. + + + + required + + + + Field number for the "content_type" field. + + + + a object + + + + Field number for the "fld" field. + + + Container for nested types declared in the Object message type. + + + Field number for the "key" field. + + + + required + + + + Field number for the "value" field. + + + + required + + + + + a Array + + + + Field number for the "value" field. + + + + a helper to allow all field types + + + + Field number for the "type" field. + + + + required + + + + Field number for the "scalar" field. + + + Field number for the "obj" field. + + + Field number for the "array" field. + + + Container for nested types declared in the Any message type. + + + Holder for reflection information generated from mysqlx_expect.proto + + + File descriptor for mysqlx_expect.proto + + + + open an Expect block and set/unset the conditions that have to be fulfilled + + if any of the conditions fail, all enclosed messages will fail with + a Mysqlx.Error message. + + :returns: :protobuf:msg:`Mysqlx::Ok` on success, :protobuf:msg:`Mysqlx::Error` on error + + + + Field number for the "op" field. + + + + [ default = EXPECT_CTX_COPY_PREV ];//optional + + + + Field number for the "cond" field. + + + Container for nested types declared in the Open message type. + + + + copy the operations from the parent Expect-block + + + + + start with a empty set of operations + + + + Field number for the "condition_key" field. + + + + required + + + + Field number for the "condition_value" field. + + + + optional + + + + Field number for the "op" field. + + + + [ default = EXPECT_OP_SET ];//optional + + + + Container for nested types declared in the Condition message type. + + + + Change error propagation behaviour + + + + + Check if X Protocol field exists + + + + + Check if X Protocol support document _id generation + + + + + set the condition + + set, if not set + overwrite, if set + + + + + unset the condition + + + + + close a Expect block + + closing a Expect block restores the state of the previous Expect block + for the following messages + + :returns: :protobuf:msg:`Mysqlx::Ok` on success, :protobuf:msg:`Mysqlx::Error` on error + + + + Holder for reflection information generated from mysqlx_expr.proto + + + File descriptor for mysqlx_expr.proto + + + + Expressions + + the "root" of the expression tree + + .. productionlist:: + expr: `operator` | + : `identifier` | + : `function_call` | + : variable | + : `literal` | + : placeholder + + If expression type is PLACEHOLDER then it refers to the value of a parameter + specified when executing a statement (see `args` field of `StmtExecute` command). + Field `position` (which must be present for such an expression) gives 0-based + position of the parameter in the parameter list. + + + + Field number for the "type" field. + + + + required + + + + Field number for the "identifier" field. + + + Field number for the "variable" field. + + + Field number for the "literal" field. + + + Field number for the "function_call" field. + + + Field number for the "operator" field. + + + Field number for the "position" field. + + + Field number for the "object" field. + + + Field number for the "array" field. + + + Container for nested types declared in the Expr message type. + + + + identifier: name, schame.name + + .. productionlist:: + identifier: string "." string | + : string + + + + Field number for the "name" field. + + + + required + + + + Field number for the "schema_name" field. + + + + DocumentPathItem + + .. productionlist:: + document_path: path_item | path_item document_path + path_item : member | array_index | "**" + member : "." string | "." "*" + array_index : "[" number "]" | "[" "*" "]" + + + + Field number for the "type" field. + + + + required + + + + Field number for the "value" field. + + + Field number for the "index" field. + + + Container for nested types declared in the DocumentPathItem message type. + + + + .member + + + + + .* + + + + + [index] + + + + + [*] + + + + + ** + + + + + col_identifier (table): col@doc_path, tbl.col@doc_path col, tbl.col, schema.tbl.col + col_identifier (document): doc_path + + .. productionlist:: + col_identifier: string "." string "." string | + : string "." string | + : string | + : string "." string "." string "@" document_path | + : string "." string "@" document_path | + : string "@" document_path | + : document_path + document_path: member | arrayLocation | doubleAsterisk + member = "." string | "." "*" + arrayLocation = "[" index "]" | "[" "*" "]" + doubleAsterisk = "**" + + + + Field number for the "document_path" field. + + + Field number for the "name" field. + + + Field number for the "table_name" field. + + + Field number for the "schema_name" field. + + + + function call: ``func(a, b, "1", 3)`` + + .. productionlist:: + function_call: `identifier` "(" [ `expr` ["," `expr` ]* ] ")" + + + + Field number for the "name" field. + + + + required + + + + Field number for the "param" field. + + + + operator: ``<<(a, b)`` + + .. note:: + + Non-authoritative list of operators implemented (case sensitive): + + Nullary + * ``*`` + * ``default`` + + Unary + * ``!`` + * ``sign_plus`` + * ``sign_minus`` + * ``~`` + + Binary + * ``&&`` + * ``||`` + * ``xor`` + * ``==`` + * ``!=`` + * ``>`` + * ``>=`` + * ``<`` + * ``<=`` + * ``&`` + * ``|`` + * ``^`` + * ``<<`` + * ``>>`` + * ``+`` + * ``-`` + * ``*`` + * ``/`` + * ``div`` + * ``%`` + * ``is`` + * ``is_not`` + * ``regexp`` + * ``not_regexp`` + * ``like`` + * ``not_like`` + * ``cast`` + * ``cont_in`` + * ``not_cont_in`` + + Using special representation, with more than 2 params + * ``in`` (param[0] IN (param[1], param[2], ...)) + * ``not_in`` (param[0] NOT IN (param[1], param[2], ...)) + + Ternary + * ``between`` + * ``between_not`` + * ``date_add`` + * ``date_sub`` + + Units for date_add/date_sub + * ``MICROSECOND`` + * ``SECOND`` + * ``MINUTE`` + * ``HOUR`` + * ``DAY`` + * ``WEEK`` + * ``MONTH`` + * ``QUARTER`` + * ``YEAR`` + * ``SECOND_MICROSECOND`` + * ``MINUTE_MICROSECOND`` + * ``MINUTE_SECOND`` + * ``HOUR_MICROSECOND`` + * ``HOUR_SECOND`` + * ``HOUR_MINUTE`` + * ``DAY_MICROSECOND`` + * ``DAY_SECOND`` + * ``DAY_MINUTE`` + * ``DAY_HOUR`` + + Types for cast + * ``BINARY[(N)]`` + * ``CHAR[(N)]`` + * ``DATE`` + * ``DATETIME`` + * ``DECIMAL[(M[,D])]`` + * ``JSON`` + * ``SIGNED [INTEGER]`` + * ``TIME`` + * ``UNSIGNED [INTEGER]`` + + .. productionlist:: + operator: `name` "(" [ `expr` ["," `expr` ]* ] ")" + + + + Field number for the "name" field. + + + + required + + + + Field number for the "param" field. + + + + an object (with expression values) + + + + Field number for the "fld" field. + + + Container for nested types declared in the Object message type. + + + Field number for the "key" field. + + + + required + + + + Field number for the "value" field. + + + + required + + + + + a Array of expressions + + + + Field number for the "value" field. + + + Holder for reflection information generated from mysqlx_notice.proto + + + File descriptor for mysqlx_notice.proto + + + + Common Frame for all Notices + + ===================================================== ===== + .type value + ===================================================== ===== + :protobuf:msg:`Mysqlx.Notice::Warning` 1 + :protobuf:msg:`Mysqlx.Notice::SessionVariableChanged` 2 + :protobuf:msg:`Mysqlx.Notice::SessionStateChanged` 3 + ===================================================== ===== + + :param type: the type of the payload + :param payload: the payload of the notification + :param scope: global or local notification + + + + Field number for the "type" field. + + + + required + + + + Field number for the "scope" field. + + + + [ default = GLOBAL ];//optional + + + + Field number for the "payload" field. + + + + optional + + + + Container for nested types declared in the Frame message type. + + + + Server-side warnings and notes + + ``.scope`` == ``local`` + ``.level``, ``.code`` and ``.msg`` map the content of + + .. code-block:: sql + + SHOW WARNINGS + + ``.scope`` == ``global`` + (undefined) will be used for global, unstructured messages like: + + * server is shutting down + * a node disconnected from group + * schema or table dropped + + ========================================== ======================= + :protobuf:msg:`Mysqlx.Notice::Frame` field value + ========================================== ======================= + ``.type`` 1 + ``.scope`` ``local`` or ``global`` + ========================================== ======================= + + :param level: warning level: Note or Warning + :param code: warning code + :param msg: warning message + + + + Field number for the "level" field. + + + + [ default = WARNING ];//optional + + + + Field number for the "code" field. + + + + required + + + + Field number for the "msg" field. + + + + required + + + + Container for nested types declared in the Warning message type. + + + + Notify clients about changes to the current session variables + + Every change to a variable that is accessible through: + + .. code-block:: sql + + SHOW SESSION VARIABLES + + ========================================== ========= + :protobuf:msg:`Mysqlx.Notice::Frame` field value + ========================================== ========= + ``.type`` 2 + ``.scope`` ``local`` + ========================================== ========= + + :param namespace: namespace that param belongs to + :param param: name of the variable + :param value: the changed value of param + + + + Field number for the "param" field. + + + + required + + + + Field number for the "value" field. + + + + optional + + + + + Notify clients about changes to the internal session state + + ========================================== ========= + :protobuf:msg:`Mysqlx.Notice::Frame` field value + ========================================== ========= + ``.type`` 3 + ``.scope`` ``local`` + ========================================== ========= + + :param param: parameter key + :param value: updated value + + + + Field number for the "param" field. + + + + required + + + + Field number for the "value" field. + + + Container for nested types declared in the SessionStateChanged message type. + + + + .. more to be added + + + + Holder for reflection information generated from mysqlx_prepare.proto + + + File descriptor for mysqlx_prepare.proto + + + + Prepare a new statement + + .. uml:: + + client -> server: Prepare + alt Success + client <- server: Ok + else Failure + client <- server: Error + end + + :param stmt_id: client side assigned statement id, which is going to identify the result of preparation + :param stmt: defines one of following messages to be prepared - Crud.Find, Crud.Insert, Crud.Delete, Crud.Upsert, Sql.StmtExecute + :Returns: :protobuf:msg:`Mysqlx.Ok|Mysqlx.Error` + + + + Field number for the "stmt_id" field. + + + + required + + + + Field number for the "stmt" field. + + + + required + + + + Container for nested types declared in the Prepare message type. + + + Field number for the "type" field. + + + + required + + + + Field number for the "find" field. + + + + optional + + + + Field number for the "insert" field. + + + + optional + + + + Field number for the "update" field. + + + + optional + + + + Field number for the "delete" field. + + + + optional + + + + Field number for the "stmt_execute" field. + + + + optional + + + + Enum of possible cases for the "Type_present" oneof. + + + Container for nested types declared in the OneOfMessage message type. + + + + Determine which of optional fields was set by the client + (Workaround for missing "oneof" keyword in pb2.5) + + + + + Execute already prepared statement + + .. uml:: + + client -> server: Execute + alt Success + ... Resultsets... + client <- server: StmtExecuteOk + else Failure + client <- server: Error + end + + :param stmt_id: client side assigned statement id, must be already prepared + :param args_list: Arguments to bind to the prepared statement + :param compact_metadata: send only type information for :protobuf:msg:`Mysqlx.Resultset::ColumnMetadata`, skipping names and others + :Returns: :protobuf:msg:`Mysqlx.Ok::` + + + + Field number for the "stmt_id" field. + + + + required + + + + Field number for the "args" field. + + + Field number for the "compact_metadata" field. + + + + [ default = false ]; optional + + + + + Deallocate already prepared statement + + Deallocating the statement. + + .. uml:: + + client -> server: Deallocate + alt Success + client <- server: Ok + else Failure + client <- server: Error + end + + :param stmt_id: client side assigned statement id, must be already prepared + :Returns: :protobuf:msg:`Mysqlx.Ok|Mysqlx.Error` + + + + Field number for the "stmt_id" field. + + + + required + + + + Holder for reflection information generated from mysqlx_resultset.proto + + + File descriptor for mysqlx_resultset.proto + + + + a hint about the higher-level encoding of a BYTES field + + ====== ====== =========== + type value description + ====== ====== =========== + BYTES 0x0001 GEOMETRY (WKB encoding) + BYTES 0x0002 JSON (text encoding) + BYTES 0x0003 XML (text encoding) + ====== ====== =========== + + .. note:: + this list isn't comprehensive. As guideline: the field's value is expected + to pass a validator check on client and server if this field is set. + If the server adds more internal datatypes that rely on BLOB storage + like image manipulation, seeking into complex types in BLOBs, ... more + types will be added. + + + + + a hint about the higher-level encoding of a DATETIME field + + ====== ====== =========== + type value description + ======== ====== =========== + DATE 0x0001 DATETIME contains only date part + DATETIME 0x0002 DATETIME contains both date and time parts + ====== ====== =========== + + + + + resultsets are finished, OUT paramset is next + + + + + resultset and out-params are finished, but more resultsets available + + + + + all resultsets are finished + + + + + cursor is opened still the execution of PrepFetch or PrepExecute ended + + + + + meta data of a Column + + .. note:: the encoding used for the different ``bytes`` fields in the meta data is externally + controlled. + .. seealso:: https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html + + .. note:: + The server may not set the ``original_{table|name}`` fields if they are equal to the plain + ``{table|name}`` field. + + A client has to reconstruct it like:: + + if .original_name is empty and .name is not empty: + .original_name = .name + + if .original_table is empty and .table is not empty: + .original_table = .table + + .. note:: + ``compact metadata format`` can be requested by the client. In that case only ``.type`` is set and + all other fields are empty. + + :param type: + .. table:: Expected Datatype of Mysqlx.Resultset.Row per SQL Type for non NULL values + + ================= ============ ======= ========== ====== ======== + SQL Type .type .length .frac_dig .flags .charset + ================= ============ ======= ========== ====== ======== + TINY SINT x + TINY UNSIGNED UINT x x + SHORT SINT x + SHORT UNSIGNED UINT x x + INT24 SINT x + INT24 UNSIGNED UINT x x + INT SINT x + INT UNSIGNED UINT x x + LONGLONG SINT x + LONGLONG UNSIGNED UINT x x + DOUBLE DOUBLE x x x + FLOAT FLOAT x x x + DECIMAL DECIMAL x x x + VARCHAR,CHAR,... BYTES x x x + GEOMETRY BYTES + TIME TIME x + DATE DATETIME x + DATETIME DATETIME x + YEAR UINT x x + TIMESTAMP DATETIME x + SET SET x + ENUM ENUM x + NULL BYTES + BIT BIT x + ================= ============ ======= ========== ====== ======== + + .. note:: the SQL "NULL" value is sent as an empty field value in :protobuf:msg:`Mysqlx.Resultset::Row` + .. seealso:: protobuf encoding of primitive datatypes are decribed in https://developers.google.com/protocol-buffers/docs/encoding + + SINT + + ``.length`` + maximum number of displayable decimal digits (including minus sign) of the type + + .. note:: + valid range is 0-255, but usually you'll see 1-20 + + =============== == + SQL Type max digits per type + =============== == + TINY SIGNED 4 + SHORT SIGNED 6 + INT24 SIGNED 8 + INT SIGNED 11 + LONGLONG SIGNED 20 + =============== == + + .. seealso:: definition of ``M`` in https://dev.mysql.com/doc/refman/8.0/en/numeric-type-overview.html + + ``value`` + variable length encoded signed 64 integer + + UINT + + ``.flags & 1`` (zerofill) + the client has to left pad with 0's up to .length + + ``.length`` + maximum number of displayable decimal digits of the type + + .. note:: + valid range is 0-255, but usually you'll see 1-20 + + ================= == + SQL Type max digits per type + ================= == + TINY UNSIGNED 3 + SHORT UNSIGNED 5 + INT24 UNSIGNED 8 + INT UNSIGNED 10 + LONGLONG UNSIGNED 20 + ================= == + + .. seealso:: definition of ``M`` in https://dev.mysql.com/doc/refman/8.0/en/numeric-type-overview.html + + ``value`` + variable length encoded unsigned 64 integer + + BIT + + ``.length`` + maximum number of displayable binary digits + + .. note:: valid range for M of the ``BIT`` type is 1 - 64 + .. seealso:: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-overview.html + + ``value`` + variable length encoded unsigned 64 integer + + DOUBLE + + ``.length`` + maximum number of displayable decimal digits (including the decimal point and ``.fractional_digits``) + + ``.fractional_digits`` + maximum number of displayable decimal digits following the decimal point + + ``value`` + encoded as Protobuf's 'double' + + FLOAT + + ``.length`` + maximum number of displayable decimal digits (including the decimal point and ``.fractional_digits``) + + ``.fractional_digits`` + maximum number of displayable decimal digits following the decimal point + + ``value`` + encoded as Protobuf's 'float' + + BYTES, ENUM + BYTES is used for all opaque byte strings that may have a charset + + * TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB + * TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT + * VARCHAR, VARBINARY + * CHAR, BINARY + * ENUM + + ``.length`` + the maximum length of characters of the underlying type + + ``.flags & 1`` (rightpad) + if the length of the field is less than ``.length``, the receiver is + supposed to add padding characters to the right end of the string. + If the ``.charset`` is "binary", the padding character is ``0x00``, + otherwise it is a space character as defined by that character set. + + ============= ======= ======== ======= + SQL Type .length .charset .flags + ============= ======= ======== ======= + TINYBLOB 256 binary + BLOB 65535 binary + VARCHAR(32) 32 utf8 + VARBINARY(32) 32 utf8_bin + BINARY(32) 32 binary rightpad + CHAR(32) 32 utf8 rightpad + ============= ======= ======== ======= + + ``value`` + sequence of bytes with added one extra '\0' byte at the end. To obtain the + original string, the extra '\0' should be removed. + .. note:: the length of the string can be acquired with protobuf's field length() method + length of sequence-of-bytes = length-of-field - 1 + .. note:: the extra byte allows to distinguish between a NULL and empty byte sequence + + TIME + A time value. + + ``value`` + the following bytes sequence: + + ``| negate [ | hour | [ | minutes | [ | seconds | [ | useconds | ]]]]`` + + * negate - one byte, should be one of: 0x00 for "+", 0x01 for "-" + * hour - optional variable length encoded unsigned64 value for the hour + * minutes - optional variable length encoded unsigned64 value for the minutes + * seconds - optional variable length encoded unsigned64 value for the seconds + * useconds - optional variable length encoded unsigned64 value for the microseconds + + .. seealso:: protobuf encoding in https://developers.google.com/protocol-buffers/docs/encoding + .. note:: hour, minutes, seconds, useconds are optional if all the values to the right are 0 + + Example: 0x00 -> +00:00:00.000000 + + DATETIME + A date or date and time value. + + ``value`` + a sequence of variants, arranged as follows: + + ``| year | month | day | [ | hour | [ | minutes | [ | seconds | [ | useconds | ]]]]`` + + * year - variable length encoded unsigned64 value for the year + * month - variable length encoded unsigned64 value for the month + * day - variable length encoded unsigned64 value for the day + * hour - optional variable length encoded unsigned64 value for the hour + * minutes - optional variable length encoded unsigned64 value for the minutes + * seconds - optional variable length encoded unsigned64 value for the seconds + * useconds - optional variable length encoded unsigned64 value for the microseconds + + .. note:: hour, minutes, seconds, useconds are optional if all the values to the right are 0 + + ``.flags & 1`` (timestamp) + + ============= ======= + SQL Type .flags + ============= ======= + DATETIME + TIMESTAMP 1 + + DECIMAL + An arbitrary length number. The number is encoded as a single byte + indicating the position of the decimal point followed by the Packed BCD + encoded number. Packed BCD is used to simplify conversion to and + from strings and other native arbitrary precision math datatypes. + .. seealso:: packed BCD in https://en.wikipedia.org/wiki/Binary-coded_decimal + + ``.length`` + maximum number of displayable decimal digits (*excluding* the decimal point and sign, but including ``.fractional_digits``) + + .. note:: should be in the range of 1 - 65 + + ``.fractional_digits`` + is the decimal digits to display out of length + + .. note:: should be in the range of 0 - 30 + + ``value`` + the following bytes sequence: + + ``| scale | BCD | sign | [0x0] |`` + + * scale - 8bit scale value (number of decimal digit after the '.') + * BCD - BCD encoded digits (4 bits for each digit) + * sign - sign encoded on 4 bits (0xc = "+", 0xd = "-") + * 0x0 - last 4bits if length(digits) % 2 == 0 + + Example: x04 0x12 0x34 0x01 0xd0 -> -12.3401 + + SET + A list of strings representing a SET of values. + + ``value`` + A sequence of 0 or more of protobuf's bytes (length prepended octets) or one of + the special sequences with a predefined meaning listed below. + + Example (length of the bytes array shown in brackets): + * ``[0]`` - the NULL value + * ``[1] 0x00`` - a set containing a blank string '' + * ``[1] 0x01`` - this would be an invalid value, but is to be treated as the empty set + * ``[2] 0x01 0x00`` - a set with a single item, which is the '\0' character + * ``[8] 0x03 F O O 0x03 B A R`` - a set with 2 items: FOO,BAR + + :param name: name of the column + :param original_name: name of the column before an alias was applied + :param table: name of the table the column orginates from + :param original_table: name of the table the column orginates from before an alias was applied + :param schema: schema the column originates from + :param catalog: + catalog the schema originates from + + .. note:: + as there is current no support for catalogs in MySQL, don't expect this field to be set. + In the MySQL C/S protocol the field had the value ``def`` all the time. + + :param fractional_digits: displayed factional decimal digits for floating point and fixed point numbers + :param length: maximum count of displayable characters of .type + :param flags: + ``.type`` specific flags + + ======= ====== =========== + type value description + ======= ====== =========== + UINT 0x0001 zerofill + DOUBLE 0x0001 unsigned + FLOAT 0x0001 unsigned + DECIMAL 0x0001 unsigned + BYTES 0x0001 rightpad + ======= ====== =========== + + ====== ================ + value description + ====== ================ + 0x0010 NOT_NULL + 0x0020 PRIMARY_KEY + 0x0040 UNIQUE_KEY + 0x0080 MULTIPLE_KEY + 0x0100 AUTO_INCREMENT + ====== ================ + + default: 0 + :param content_type: + a hint about the higher-level encoding of a BYTES field, for more informations + please refer to Mysqlx.Resultset.ContentType_BYTES enum. + + + + Field number for the "type" field. + + + + datatype of the field in a row + + + + Field number for the "name" field. + + + Field number for the "original_name" field. + + + Field number for the "table" field. + + + Field number for the "original_table" field. + + + Field number for the "schema" field. + + + Field number for the "catalog" field. + + + Field number for the "collation" field. + + + Field number for the "fractional_digits" field. + + + Field number for the "length" field. + + + Field number for the "flags" field. + + + Field number for the "content_type" field. + + + Container for nested types declared in the ColumnMetaData message type. + + + + Row in a Resultset + + a row is represented as a list of fields encoded as byte blobs. + Blob of size 0 represents the NULL value. Otherwise, if it contains at least + one byte, it encodes a non-null value of the field using encoding appropriate for the + type of the value given by ``ColumnMetadata``, as specified + in the :protobuf:msg:`Mysqlx.Resultset::ColumnMetaData` description. + + + + Field number for the "field" field. + + + Holder for reflection information generated from mysqlx_session.proto + + + File descriptor for mysqlx_session.proto + + + + the initial message send from the client to the server to start the + authentication proccess + + :param mech_name: authentication mechanism name + :param auth_data: authentication data + :param initial_response: initial response + :Returns: :protobuf:msg:`Mysqlx.Session::AuthenticateContinue` + + + + Field number for the "mech_name" field. + + + + required + + + + Field number for the "auth_data" field. + + + Field number for the "initial_response" field. + + + + send by client or server after a :protobuf:msg:`Mysqlx.Session::AuthenticateStart` to + exchange more auth data + + :param auth_data: authentication data + :Returns: :protobuf:msg:`Mysqlx.Session::AuthenticateContinue` + + + + Field number for the "auth_data" field. + + + + required + + + + + sent by the server after successful authentication + + :param auth_data: authentication data + + + + Field number for the "auth_data" field. + + + + reset the current session + param keep_open: if is true the session will be reset, but stays authenticated. + otherwise, the session will be closed and needs to be authenticated again. + + :Returns: :protobuf:msg:`Mysqlx::Ok` + + + + Field number for the "keep_open" field. + + + + close the current session + + :Returns: :protobuf:msg:`Mysqlx::Ok` + + + + Holder for reflection information generated from mysqlx_sql.proto + + + File descriptor for mysqlx_sql.proto + + + + execute a statement in the given namespace + + .. uml:: + + client -> server: StmtExecute + ... zero or more Resultsets ... + server --> client: StmtExecuteOk + + Notices: + This message may generate a notice containing WARNINGs generated by its execution. + This message may generate a notice containing INFO messages generated by its execution. + + :param namespace: namespace of the statement to be executed + :param stmt: statement that shall be executed. + :param args: values for wildcard replacements + :param compact_metadata: send only type information for :protobuf:msg:`Mysqlx.Resultset::ColumnMetadata`, skipping names and others + :returns: + * zero or one :protobuf:msg:`Mysqlx.Resultset::` followed by :protobuf:msg:`Mysqlx.Sql::StmtExecuteOk` + + + + Field number for the "namespace" field. + + + + optional [ default = "sql" ] + + + + Field number for the "stmt" field. + + + + required + + + + Field number for the "args" field. + + + Field number for the "compact_metadata" field. + + + + optional [ default = false ] + + + + + statement executed successful + + +
+
diff --git a/DLL/NPOI.OOXML.dll b/DLL/NPOI.OOXML.dll new file mode 100644 index 0000000..031d41d Binary files /dev/null and b/DLL/NPOI.OOXML.dll differ diff --git a/DLL/NPOI.OpenXml4Net.dll b/DLL/NPOI.OpenXml4Net.dll new file mode 100644 index 0000000..8da4ac2 Binary files /dev/null and b/DLL/NPOI.OpenXml4Net.dll differ diff --git a/DLL/NPOI.OpenXmlFormats.dll b/DLL/NPOI.OpenXmlFormats.dll new file mode 100644 index 0000000..4a8f87b Binary files /dev/null and b/DLL/NPOI.OpenXmlFormats.dll differ diff --git a/DLL/NPOI.dll b/DLL/NPOI.dll new file mode 100644 index 0000000..1a500e9 Binary files /dev/null and b/DLL/NPOI.dll differ diff --git a/DLL/Nai.Communication.Robot.FanucVarProxy.dll b/DLL/Nai.Communication.Robot.FanucVarProxy.dll new file mode 100644 index 0000000..ad9e8f8 Binary files /dev/null and b/DLL/Nai.Communication.Robot.FanucVarProxy.dll differ diff --git a/DLL/Newtonsoft.Json.dll b/DLL/Newtonsoft.Json.dll new file mode 100644 index 0000000..7af125a Binary files /dev/null and b/DLL/Newtonsoft.Json.dll differ diff --git a/DLL/Opc.Ua.Client.dll b/DLL/Opc.Ua.Client.dll new file mode 100644 index 0000000..8874d8f Binary files /dev/null and b/DLL/Opc.Ua.Client.dll differ diff --git a/DLL/Opc.Ua.Configuration.dll b/DLL/Opc.Ua.Configuration.dll new file mode 100644 index 0000000..b3f3970 Binary files /dev/null and b/DLL/Opc.Ua.Configuration.dll differ diff --git a/DLL/Opc.Ua.Core.dll b/DLL/Opc.Ua.Core.dll new file mode 100644 index 0000000..ee01d0d Binary files /dev/null and b/DLL/Opc.Ua.Core.dll differ diff --git a/DLL/OpcUaHelper.dll b/DLL/OpcUaHelper.dll new file mode 100644 index 0000000..04fdeb0 Binary files /dev/null and b/DLL/OpcUaHelper.dll differ diff --git a/DLL/Rhino3dm.dll b/DLL/Rhino3dm.dll new file mode 100644 index 0000000..76d1cb8 Binary files /dev/null and b/DLL/Rhino3dm.dll differ diff --git a/DLL/Robot.Common.dll b/DLL/Robot.Common.dll new file mode 100644 index 0000000..57679fd Binary files /dev/null and b/DLL/Robot.Common.dll differ diff --git a/DLL/Robot.MessageBus.dll b/DLL/Robot.MessageBus.dll new file mode 100644 index 0000000..2bede9f Binary files /dev/null and b/DLL/Robot.MessageBus.dll differ diff --git a/DLL/RobotMapper.dll b/DLL/RobotMapper.dll new file mode 100644 index 0000000..3bf3d77 Binary files /dev/null and b/DLL/RobotMapper.dll differ diff --git a/DLL/RobotStudio.Services.RobApi.Desktop.dll b/DLL/RobotStudio.Services.RobApi.Desktop.dll new file mode 100644 index 0000000..f265f71 Binary files /dev/null and b/DLL/RobotStudio.Services.RobApi.Desktop.dll differ diff --git a/DLL/RobotStudio.Services.RobApi.dll b/DLL/RobotStudio.Services.RobApi.dll new file mode 100644 index 0000000..c06854b Binary files /dev/null and b/DLL/RobotStudio.Services.RobApi.dll differ diff --git a/DLL/Robots.dll b/DLL/Robots.dll new file mode 100644 index 0000000..ff28838 Binary files /dev/null and b/DLL/Robots.dll differ diff --git a/DLL/S7.Net.dll b/DLL/S7.Net.dll new file mode 100644 index 0000000..b4211db Binary files /dev/null and b/DLL/S7.Net.dll differ diff --git a/DLL/Serilog.Extensions.Logging.dll b/DLL/Serilog.Extensions.Logging.dll new file mode 100644 index 0000000..27dc8cf Binary files /dev/null and b/DLL/Serilog.Extensions.Logging.dll differ diff --git a/DLL/Serilog.dll b/DLL/Serilog.dll new file mode 100644 index 0000000..d13a6f4 Binary files /dev/null and b/DLL/Serilog.dll differ diff --git a/DLL/SqlCmd.dll b/DLL/SqlCmd.dll new file mode 100644 index 0000000..b6b25f9 Binary files /dev/null and b/DLL/SqlCmd.dll differ diff --git a/DLL/System.Net.Http.Formatting.dll b/DLL/System.Net.Http.Formatting.dll new file mode 100644 index 0000000..e9e80be Binary files /dev/null and b/DLL/System.Net.Http.Formatting.dll differ diff --git a/DLL/System.Net.Http.dll b/DLL/System.Net.Http.dll new file mode 100644 index 0000000..1c5c6fd Binary files /dev/null and b/DLL/System.Net.Http.dll differ diff --git a/DLL/System.Runtime.InteropServices.RuntimeInformation.dll b/DLL/System.Runtime.InteropServices.RuntimeInformation.dll new file mode 100644 index 0000000..360e92a Binary files /dev/null and b/DLL/System.Runtime.InteropServices.RuntimeInformation.dll differ diff --git a/DLL/System.Web.Cors.dll b/DLL/System.Web.Cors.dll new file mode 100644 index 0000000..6f3da24 Binary files /dev/null and b/DLL/System.Web.Cors.dll differ diff --git a/DLL/System.Web.Http.Cors.dll b/DLL/System.Web.Http.Cors.dll new file mode 100644 index 0000000..fd0b539 Binary files /dev/null and b/DLL/System.Web.Http.Cors.dll differ diff --git a/DLL/System.Web.Http.SelfHost.dll b/DLL/System.Web.Http.SelfHost.dll new file mode 100644 index 0000000..852728e Binary files /dev/null and b/DLL/System.Web.Http.SelfHost.dll differ diff --git a/DLL/System.Web.Http.dll b/DLL/System.Web.Http.dll new file mode 100644 index 0000000..7e3bd30 Binary files /dev/null and b/DLL/System.Web.Http.dll differ diff --git a/DLL/Ubiety.Dns.Core.dll b/DLL/Ubiety.Dns.Core.dll new file mode 100644 index 0000000..2f0c84e Binary files /dev/null and b/DLL/Ubiety.Dns.Core.dll differ diff --git a/DLL/WeifenLuo.WinFormsUI.Docking.dll b/DLL/WeifenLuo.WinFormsUI.Docking.dll new file mode 100644 index 0000000..52623c7 Binary files /dev/null and b/DLL/WeifenLuo.WinFormsUI.Docking.dll differ diff --git a/DLL/Zstandard.Net.dll b/DLL/Zstandard.Net.dll new file mode 100644 index 0000000..83934d1 Binary files /dev/null and b/DLL/Zstandard.Net.dll differ diff --git a/DLL/fwlibe1.dll b/DLL/fwlibe1.dll new file mode 100644 index 0000000..1ade6a9 Binary files /dev/null and b/DLL/fwlibe1.dll differ diff --git a/DLL/log4net.dll b/DLL/log4net.dll new file mode 100644 index 0000000..8646b6f Binary files /dev/null and b/DLL/log4net.dll differ diff --git a/DLL/netstandard.dll b/DLL/netstandard.dll new file mode 100644 index 0000000..1f1ab22 Binary files /dev/null and b/DLL/netstandard.dll differ diff --git a/DT_SCADA/App.config b/DT_SCADA/App.config new file mode 100644 index 0000000..7adff7f --- /dev/null +++ b/DT_SCADA/App.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DT_SCADA/BusinessCode/AppConfig.cs b/DT_SCADA/BusinessCode/AppConfig.cs new file mode 100644 index 0000000..40d6a04 --- /dev/null +++ b/DT_SCADA/BusinessCode/AppConfig.cs @@ -0,0 +1,562 @@ +using DeviceDriver_BasicData; +using ExternalDataSync; +using Newtonsoft.Json; +using NJ_ZC; +using NPOI.OpenXmlFormats.Spreadsheet; +using OpcBasic; +using Rhino.Geometry; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Security.Policy; +using System.Threading; +using System.Windows.Forms; +using SystemFramework; +using static Focas1; +using static System.Configuration.ConfigurationManager; + +namespace MesWork +{ + public partial class Temp { + public static MesWorkForm mesWorkForm = null; + } + public partial class MesWorkForm + { + /// + /// + /// + public static int IsWriteMonitorLog = Convert.ToInt32(AppSettings["IsWriteMonitorLog"]); + public static int IsDemoMesServer = Convert.ToInt32(AppSettings["IsDemoMesServer"]); + public static string BasicDataTableFile = AppSettings["BasicDataTableFile"]; + /// + /// + /// + public static int ConnectType = Convert.ToInt32(AppSettings["ConnectType"]); + + public static string IpPortSub = AppSettings["IpPortSub"]; + public static string MesServer_SendProtocol_Tag = AppSettings["MesServer_SendProtocol_Tag"]; + public static string MesServer_SendProtocol_Joint = AppSettings["MesServer_SendProtocol_Joint"]; + public static string MesServer_SendProtocol_Info_Fast = AppSettings["MesServer_SendProtocol_Info_Fast"]; + public static string MesServer_SendProtocol_Info_Slow = AppSettings["MesServer_SendProtocol_Info_Slow"]; + public static string MesServer_SendProtocol_Plc = AppSettings["MesServer_SendProtocol_Plc"]; + + public static string MesServer_SendProtocol_DeviceInfo = AppSettings["MesServer_SendProtocol_DeviceInfo"]; + + public static string ConnectionString = AppSettings["ConnectionString"]; + + public static string WebSvrUrlPort = AppSettings["WebSvrUrlPort"]; + + public static string MarkingMachine_Ip = AppSettings["MarkingMachine_Ip"]; + public static string MarkingMachine_Port = AppSettings["MarkingMachine_Port"]; + public static string Url_WebApi_Char = AppSettings["Url_WebApi_Char"]; + public static string AK = AppSettings["AK"]; + public static string SK = AppSettings["SK"]; + public static string salt = AppSettings["salt"]; + + public static int TokenSyncTime = Convert.ToInt32(AppSettings["TokenSyncTime"]); + public static int SyncTime = Convert.ToInt32(AppSettings["SyncTime"]); + public static string charDataToken = ""; + public static long charDataTokenTime = 0; + + /// + /// + /// + public static Dictionary dc_Robot = new Dictionary(); + /// + /// + /// + public static Dictionary dc_Name_Axis = new Dictionary(); + public static Dictionary dc_Name_Axis_Card = new Dictionary(); + /// + /// + /// + public static AgvRead agvRead = null; + /// + /// + /// + public static ScadaConfig scadaConfig = null; + /// + /// + /// + public static ConcurrentQueue taskSql = new ConcurrentQueue(); + /// + /// + /// + public static string StationName = "DDV_SXYJ"; + /// + /// + /// + public static bool OnLine_PLC_1 = false; + public static bool OnLine_PLC_2 = false; + /// + /// + /// + public static bool OnLine_SQL = false; + + /// + /// ݵб仯 + /// + /// + /// + public override void OPCTagData_TagDataOnChangeMIS(object sender, CustomeEvetnArgs e) + { + ThreadPool.QueueUserWorkItem(MIS_Funtion, e); + } + /// + /// ʱPLC״̬ڣ3 s + /// + /// + /// + public override void PlcStateEvent(object sender, PlcStateEvetnArgs eState) + { + var ip = eState.IP.ToString(); + var onLine = (bool)eState.OnLine; + + switch (ip) + { + case "192.168.10.40": + OnLine_PLC_1 = onLine; + break; + default: + break; + } + } + /// + /// + /// + /// + /// + /// + public override void E_WriteLog(Enum_LogType t, string location, string content) + { + WriteLog(content); + } + /// + /// + /// + [STAThread] + static void Main() + { + new System.Threading.Mutex(true, $"DT_SCADA_{IpPortSub}", out bool bCanRun); + if (!bCanRun) + { + MessageBox.Show("źż ѾУظ"); + return; + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(Temp.mesWorkForm = new MesWorkForm()); + } + + /// + /// дȡ + /// + /// + /// + private void DemoRead(string doWhat, string opOrIp) + { + try + { + string opName = "OP1010"; + object tagValue = 1; + bool result = false; + ConcurrentDictionary tagAdrListTagFormat = null; + + switch (doWhat) + { + case "TagID": + tagValue = ReadPLC("71010001"); + result = WritePLC("71010001", tagValue); + break; + case "TagTypeCodeID": + tagValue = ReadPLC(10, opName); + result = WritePLC(10, opName, tagValue); + break; + case "OpAllTag"://OPе + tagAdrListTagFormat = ReadPLC_GroupData(opOrIp); + break; + case "OpMonitorTag"://OPص + tagAdrListTagFormat = ReadPLC_GroupMonitor(opOrIp); + break; + case "IpAllTag"://IPе + tagAdrListTagFormat = ReadPLC_IpTag(opOrIp); + break; + case "IpMonitorTag"://IPص + tagAdrListTagFormat = ReadPLC_IpMonitorTag(opOrIp); + break; + case "RegionRead"://ȡʼַ + ȣ + { + string tagStartAdr = "DB411.10"; + ushort tagAdrListMaxLength = 100; + GetDbAndMaxLengthByOpName(opOrIp, out tagStartAdr, out tagAdrListMaxLength); + tagAdrListTagFormat = ReadQualityDataList(opOrIp, tagStartAdr, tagAdrListMaxLength); + } + break; + case "ReadBytes"://ȡʼַ + ȣ + { + string tagStartAdr = "DB411.10"; + ushort tagAdrListMaxLength = 100; + var bates1 = ReadByteData_Op(opOrIp, tagStartAdr, tagAdrListMaxLength); + var bates2 = ReadByteData_Ip(opOrIp, tagStartAdr, tagAdrListMaxLength); + } + break; + case "WriteBytes"://ȡʼַ + ȣ + { + string tagStartAdr = "DB411.10"; + var result1 = WritePLC_Bytes_Op(opOrIp, tagStartAdr, new byte[1024]); + var result2 = WritePLC_Bytes_Ip(opOrIp, tagStartAdr, new byte[1024]); + } + break; + default: + break; + } + //ReadByteData_Op(string opName, string startAdrr, ushort length) + foreach (System.Collections.Generic.KeyValuePair de in tagAdrListTagFormat)//õλصϣ + { + TagFormat TF = (TagFormat)de.Value; + string recResult = TF.OpName + " (" + TF.TagTypeCodeID + ")" + TF.TagValue.ToString(); ; + } + } + catch (System.Exception err) + { + ApplicationLog.WriteLog("listView_ShowQualityData_Init" + err); + } + + //var tagTypeCodeIDList = DriverCache[CacheType.Cache_OpTagTypeCodeIDList]; + } + /// + /// + /// + /// + /// + private string Hello_You_All_Never_Know(string[] args) + { + return Guid.NewGuid().ToString()+ Guid.NewGuid().ToString(); + } + + /// + /// + /// + static private void Loop() + { + while (true) + { + taskSql.TryDequeue(out ParamT tp); + if (tp != null) + { + var procedureName = tp.procedureName; + var sqlParameter = tp.sqlParameter; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref sqlParameter, out string errorMessage); + if (errorMessage.Length > 0) + { + errorMessage = errorMessage.Replace("'", "**"); + LogRecord.LogRecord.Insert_Log(LogRecord.LogRecord.Type_Log.Alarm, errorMessage); + } + } + if (taskSql.Count < 5) + { + Thread.Sleep(15); + } + } + } + + private void CommunicationCheckOnLine() + { + + new Thread(new ThreadStart(delegate () + { + while (true) + { + try + { + MesWorkForm.OnLine_SQL = DataLinkMesWork.SQLCommon.ExecuteDataTable("select getdate()", ConnectionString, out DataTable dt, out string err); + } + catch (Exception) { } + Thread.Sleep(5000); + } + })) + { IsBackground = true }.Start(); + + } + + static private void LineCount() + { + while (true) + { + try + { + foreach (var opName in MesWorkForm.opNameList) + { + var count_Total = ReadPLC(10, opName).ToString(); + var count_OK = count_Total; + var count_NG = count_Total; + + var pName = "Event_ProduceCount_Update"; + var sqlParameter = new SqlParameter[] { + new SqlParameter("@DeviceCode", opName), + new SqlParameter("@Online", true.ToString()), + new SqlParameter("@StationName", opName), + new SqlParameter("@Count_OK", count_OK), + new SqlParameter("@Count_NG", count_NG), + new SqlParameter("@Count_Total", count_Total), + }; + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = pName, + sqlParameter = sqlParameter + }); + } + + } + catch (Exception err) + { + } + Thread.Sleep(5000); + } + } + + static private void StationNameStatus_Insert() + { + while (true) + { + try + { + foreach (var opName in MesWorkForm.opNameList) + { +/* +1 +2 +*/ + var status = "-1"; + try + { + var alarm = ReadPLC(1, opName).ToString().ToLower().Replace("true","1").Replace("false", "0"); + var run = ReadPLC(2, opName).ToString().ToLower().Replace("true", "1").Replace("false", "0"); + if (Convert.ToInt32(alarm) > 0) + { + status = "2"; + } + else + { + if (Convert.ToInt32(run) > 0) + { + status = "1"; + } + else + { + status = "0"; + } + } + if (alarm == "-1" & run == "-1") + { + status = "-1"; + } + } + catch (Exception errr) + { + } + + var pName = "Event_StationStatus_Insert"; + var sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@Status", status), + new SqlParameter("@ChangeTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")), + }; + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = pName, + sqlParameter = sqlParameter + }); + + } + } + catch (Exception err) + { + } + Thread.Sleep(60_000); + } + } + static private void StationNameStatus_Update() + { + while (true) + { + try + { + foreach (var opName in MesWorkForm.opNameList) + { + /* + 1 + 2 + */ + var status = "-1"; + try + { + var alarm = ReadPLC(1, opName).ToString().ToLower().Replace("true", "1").Replace("false", "0"); + var run = ReadPLC(2, opName).ToString().ToLower().Replace("true", "1").Replace("false", "0"); + if (Convert.ToInt32(alarm) > 0) + { + status = "2"; + } + else + { + if (Convert.ToInt32(run) > 0) + { + status = "1"; + } + else + { + status = "0"; + } + } + if (alarm == "-1" & run == "-1") + { + status = "-1"; + } + } + catch (Exception errr) + { + } + + + var pName = "Event_StationStatus_Update"; + var sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@Status", status), + new SqlParameter("@ChangeTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")), + }; + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = pName, + sqlParameter = sqlParameter + }); + + } + } + catch (Exception err) + { + } + Thread.Sleep(2000); + } + } + static private void StationNameDeviceData_Insert() + { + while (true) + { + try + { + foreach (var opName in MesWorkForm.opNameList) + { + + var CreatTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + var opData = ReadPLC_GroupData(opName); + foreach (KeyValuePair item in opData) + { + var thisTagID = item.Key; + var thisTF = (TagFormat)item.Value; + var thisTagTypeCodeID = thisTF.TagTypeCodeID; + var thisItemName = thisTF.ItemName; + var thisValue = thisTF.TagValue; + + var pName = "Event_DeviceData_Insert"; + var sqlParameter = new SqlParameter[] { + new SqlParameter("@DeviceCode", opName), + new SqlParameter("@Online", true.ToString()), + new SqlParameter("@StationName", opName), + new SqlParameter("@TagTypeCodeID", thisTagTypeCodeID), + new SqlParameter("@ItemName", thisItemName), + new SqlParameter("@TagValue", thisValue), + new SqlParameter("@TagID", thisTagID), + new SqlParameter("@CreateTime", CreatTime), + }; + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = pName, + sqlParameter = sqlParameter + }); + + + } + + } + } + catch (Exception err) + { + } + Thread.Sleep(60_000); + } + } + + static private void StationNameDeviceData_Update() + { + while (true) + { + try + { + foreach (var opName in MesWorkForm.opNameList) + { + var CreatTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + var opData = ReadPLC_GroupData(opName); + foreach (KeyValuePair item in opData) + { + var thisTagID = item.Key; + var thisTF = (TagFormat)item.Value; + var thisTagTypeCodeID = thisTF.TagTypeCodeID; + var thisItemName = thisTF.ItemName; + var thisValue = thisTF.TagValue; + + var pName = "Event_DeviceData_Update"; + var sqlParameter = new SqlParameter[] { + new SqlParameter("@DeviceCode", opName), + new SqlParameter("@Online", true.ToString()), + new SqlParameter("@StationName", opName), + new SqlParameter("@TagTypeCodeID", thisTagTypeCodeID), + new SqlParameter("@ItemName", thisItemName), + new SqlParameter("@TagValue", thisValue), + new SqlParameter("@TagID", thisTagID), + new SqlParameter("@CreateTime", CreatTime), + }; + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = pName, + sqlParameter = sqlParameter + }); + + + } + } + } + catch (Exception err) + { + } + Thread.Sleep(2000); + } + } + + static private void SelectData_WritePLC_Task() + { + while (true) + { + try + { + B_DB_Opera.SelectData_WritePLC(); + } + catch (Exception err) + { + } + Thread.Sleep(5000); + } + } + + + + public static void WriteLog(string msg) + { + MW_Log.LoggerHelper.Info("Alarm", msg); + } + + + } +} diff --git a/DT_SCADA/BusinessCode/B_DB_Opera.cs b/DT_SCADA/BusinessCode/B_DB_Opera.cs new file mode 100644 index 0000000..ba0ddca --- /dev/null +++ b/DT_SCADA/BusinessCode/B_DB_Opera.cs @@ -0,0 +1,277 @@ + +using System; +using System.Data; +using System.Data.SqlClient; + +namespace MesWork +{ + /// + /// + /// + public class B_DB_Opera + { + + public static void Event_WorkStart(string opName, int tagTypeCodeID, string partType, string tagID) + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_WorkStart", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@PartType", partType), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID) + } + }); + + } + + public static void Event_WorkEnd(string opName, int tagTypeCodeID, string partType + , string barCode, int qualityMask, int outCount, int duration + , string tagID) + { + /* +@OpName nvarchar(50) = null, +@TagTypeCodeID int = 0, +@PartType int = 0, +@BarCode nvarchar(2048) = null, +@QualityMask int = 0, +@OutCount int = 0, +@Duration int = 0, +@ChangeTime datetime = null, +@TagID nvarchar(200) = null + */ + + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_WorkEnd", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@PartType", partType), + new SqlParameter("@BarCode", barCode), + new SqlParameter("@QualityMask", qualityMask), + new SqlParameter("@OutCount", outCount), + new SqlParameter("@Duration", duration), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID) + } + }); + } + + + + + + public static void Event_Signal_Log(string opName, int tagTypeCodeID, string value, string tagID) + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_Signal_Log", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@Value", value), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID) + } + }); + } + + + public static void Event_Alarm_Start(string opName, int tagTypeCodeID, string alarmText, string tagID) + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_Alarm_Start", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@AlarmText", alarmText), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID) + } + }); + + } + + + public static void Event_Alarm_End(string opName, int tagTypeCodeID, string alarmText, string tagID) + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_Alarm_End", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@AlarmText", alarmText), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID) + } + }); + + } + + public static void Event_AlarmAndTip_Start(string opName, int tagTypeCodeID, string alarmText, string tagID,int Alarm1_Tip2) + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_AlarmAndTip_Start", + sqlParameter = new SqlParameter[] { + new SqlParameter("@OpName", opName), + new SqlParameter("@TagTypeCodeID", tagTypeCodeID), + new SqlParameter("@AlarmText", alarmText), + new SqlParameter("@ChangeTime",ChangeTime), + new SqlParameter("@TagID", tagID), + new SqlParameter("@Alarm1_Tip2", Alarm1_Tip2), + } + }); + + } + + + public static void MES_StatusChange(string opName, int StatusCode, string TriggerTime) + { + SqlParameter[] thisParms = new SqlParameter[3]; + thisParms[0] = new SqlParameter("@opName", opName); + thisParms[1] = new SqlParameter("@StatusCode", StatusCode); + thisParms[2] = new SqlParameter("@TriggerTime", TriggerTime); + + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "设备管理_状态变化新增", + sqlParameter = thisParms + }); + } + + public static void ClearLog() + { + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_Delete_Station_记录_日志_运行日志", + sqlParameter = new SqlParameter[] { + new SqlParameter("@工位号", "DDV") + } + }); + } + + public static void Exec_DispatchSql() + { + MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + { + procedureName = "Event_Delete_部分历史数据", + sqlParameter = new SqlParameter[] { + } + }); + } + + + + public static void SelectData_WritePLC() + { + var procedureName = "TV_PLC写入_查询"; + var sqlParameter = new SqlParameter[] { }; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref sqlParameter,out DataTable dt, out string errorMessage); + if (dt.Rows.Count > 0) + { + //select isnull(@前悬基准时间,0) as 前悬基准时间,isnull(@后悬基准时间,0) as 后悬基准时间, + //isnull(@前悬应到人数, 0) as 前悬应到人数,isnull(@后悬应到人数, 0) as 后悬应到人数 + var 前悬基准时间_79 = dt.Rows[0]["前悬基准时间"].ToString(); + var 前悬应到人数_77 = dt.Rows[0]["前悬应到人数"].ToString(); + var 前悬抽检频率_83 = dt.Rows[0]["前悬抽检频率"].ToString(); + + var 后悬基准时间_80 = dt.Rows[0]["后悬基准时间"].ToString(); + var 后悬应到人数_78 = dt.Rows[0]["后悬应到人数"].ToString(); + var 后悬抽检频率_84 = dt.Rows[0]["后悬抽检频率"].ToString(); + + var opName_QX = "OP1010"; + MesWorkForm.WritePLC(79, opName_QX, 前悬基准时间_79); + MesWorkForm.WritePLC(77, opName_QX, 前悬应到人数_77); + MesWorkForm.WritePLC(83, opName_QX, 前悬抽检频率_83); + var opName_HX = "OP1020"; + MesWorkForm.WritePLC(80, opName_HX, 后悬基准时间_80); + MesWorkForm.WritePLC(78, opName_HX, 后悬应到人数_78); + MesWorkForm.WritePLC(84, opName_HX, 后悬抽检频率_84); + + } + } + + + public static bool BaseData_tagTable_QualityData_B5A_IndexInsert(string EngineID, string tagID, string EngineType, int EngineTypeID, string opName, int isGoodBad, string PartPalletCode, out int Id_tagCF) + { + string procedureName; + procedureName = "CATL_测量数据合格索引_增加_加注设备"; + Id_tagCF = 0; + SqlParameter[] thisParms = new SqlParameter[4]; + thisParms[0] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID); + thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName); + thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID); + thisParms[3] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF); + thisParms[3].Direction = ParameterDirection.Output; + + if (DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out string errorMessage)) + { + Id_tagCF = Convert.ToInt32(thisParms[3].Value.ToString()); + return true; + } + return false; + } + public static bool BaseData_tagTable_QualityData_B5A_Insert(string EngineID, int Id_tagCF, string opName, DataTable dt, bool IsCheck = false) + { + string procedureName; + procedureName = "CATL_测量数据合格_增加_加注设备"; + SqlParameter[] thisParms = new SqlParameter[7]; + thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF); + thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.NVarChar, 100, "TagID"); + thisParms[2] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue"); + thisParms[3] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad"); + thisParms[4] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID); + thisParms[5] = new System.Data.SqlClient.SqlParameter("@上限值", SqlDbType.NVarChar, 100, "上限值"); + thisParms[6] = new System.Data.SqlClient.SqlParameter("@下限值", SqlDbType.NVarChar, 100, "下限值"); + + return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, dt, out string errorMessage); + } + + public static bool BaseData_tagTable_CharData_Insert(string vin, string testCode, string testStatus, string testBeginTime, string testEndTime, string faultInfo, string syncTime, out string errorMessage) + { + string procedureName; + procedureName = "CATL_充电数据_增加"; + SqlParameter[] thisParms = new SqlParameter[7]; + thisParms[0] = new System.Data.SqlClient.SqlParameter("@vin", vin); + thisParms[1] = new System.Data.SqlClient.SqlParameter("@testCode", testCode); + thisParms[2] = new System.Data.SqlClient.SqlParameter("@testStatus", testStatus); + thisParms[3] = new System.Data.SqlClient.SqlParameter("@testBeginTime", testBeginTime); + thisParms[4] = new System.Data.SqlClient.SqlParameter("@testEndTime", testEndTime); + thisParms[5] = new System.Data.SqlClient.SqlParameter("@faultInfo", faultInfo); + thisParms[6] = new System.Data.SqlClient.SqlParameter("@同步时间", syncTime); + + return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out errorMessage); + } + + public static bool GetQualityDataCount(string EngineID, string opName, out DataTable dt) + { + dt = new DataTable(); + string procedureName; + procedureName = "CATL_测量数据合格_查询测试次数"; + SqlParameter[] thisParms = new SqlParameter[2]; + thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID); + thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName); + + return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out string errorMessage); + + } + + } + + + + +} diff --git a/DT_SCADA/BusinessCode/Loop_Fast.cs b/DT_SCADA/BusinessCode/Loop_Fast.cs new file mode 100644 index 0000000..b70deae --- /dev/null +++ b/DT_SCADA/BusinessCode/Loop_Fast.cs @@ -0,0 +1,65 @@ +//using OpcBasic; +//using Robot.Common; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading; +//using System.Threading.Tasks; + +//namespace MesWork +//{ +// public partial class Temp { } +// public partial class MesWorkForm +// { + +// private void Loop_Fast_Task() +// { +// new Thread(new ThreadStart(Loop_Fast_Exec)) { IsBackground = true }.Start(); +// } + +// private void Loop_Fast_Exec() +// { +// while (true) +// { +// try +// { +// var tagValue = Read_Fast(); +// S_C_B_Info_Slow(tagValue); +// } +// catch (Exception err) +// { +// } +// Thread.Sleep(2000); +// } +// } + +// private Param_Slow Read_Fast() +// { +// var param_Slow = new Param_Slow(); + +// param_Slow.produce_task_no = ReadPLC(10, "OP1000").ToString(); +// param_Slow.agv_from_loc = agvRead.from_loc; +// param_Slow.agv_to_loc = agvRead.to_loc; + + +// var lib = new List(); +// var jointArray = MesWorkForm.ReadPLC_GroupData("OP1000_L"); +// foreach (KeyValuePair item in jointArray) +// { +// var TF = (TagFormat)item.Value; +// var index = Convert.ToInt32(TF.ShaftID).ToString(); +// var value = TF.TagValue.ToString(); +// lib.Add(new Param_Lib { lib_loc_no = index, lib_content = value }); +// } + +// return param_Slow; +// } + + + +// } +//} + + + diff --git a/DT_SCADA/BusinessCode/Loop_Slow.cs b/DT_SCADA/BusinessCode/Loop_Slow.cs new file mode 100644 index 0000000..38520b5 --- /dev/null +++ b/DT_SCADA/BusinessCode/Loop_Slow.cs @@ -0,0 +1,122 @@ +using OpcBasic; +using Robot.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace MesWork +{ + public partial class Temp { } + public partial class MesWorkForm + { + + private void Loop_Slow_Task() + { + new Thread(new ThreadStart(Loop_Slow_Exec)) { IsBackground = true}.Start(); + } + + private void Loop_Slow_Exec() + { + while (true) + { + try + { + var tagValue = Read(); + S_C_B_Info_Slow(tagValue); + } + catch (Exception err) + { + } + Thread.Sleep(2000); + } + } + + private Param_Slow Read() + { + var param_Slow = new Param_Slow(); + + param_Slow.produce_task_no = ReadPLC(10, "OP1000").ToString(); + param_Slow.agv_from_loc = agvRead.from_loc; + param_Slow.agv_to_loc = agvRead.to_loc; + + + var lib = new List(); + var jointArray = MesWorkForm.ReadPLC_GroupData("OP1000_L"); + foreach (KeyValuePair item in jointArray) + { + var TF = (TagFormat)item.Value; + var index = Convert.ToInt32(TF.ShaftID).ToString(); + var value = TF.TagValue.ToString().ToLower () == "true"?"1":"0"; + lib.Add(new Param_Lib { lib_loc_no = index , lib_content = value }); + } + param_Slow.lib = lib.OrderBy(o=>Convert.ToInt32(o.lib_loc_no)).ToList(); + + return param_Slow; + } + + + + } +} + +public class Param_Slow +{ + /// + /// + /// + public string produce_task_no + { + get; + set; + } + /// + /// + /// + public string agv_from_loc + { + get; + set; + } + /// + /// + /// + public string agv_to_loc + { + get; + set; + } + /// + /// + /// + public List lib + { + get; + set; + } + + + + + + +} + + +public class Param_Lib +{ + public string lib_loc_no + { + get; + set; + } + public string lib_content + { + get; + set; + } + + +} \ No newline at end of file diff --git a/DT_SCADA/BusinessCode/MIS_Funtion.cs b/DT_SCADA/BusinessCode/MIS_Funtion.cs new file mode 100644 index 0000000..d3b0094 --- /dev/null +++ b/DT_SCADA/BusinessCode/MIS_Funtion.cs @@ -0,0 +1,219 @@ + +using ABB.Robotics.Controllers.IOSystemDomain; +using BasicData; +using DeviceDriver_BasicData; +using Newtonsoft.Json; +using OpcBasic; +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Web; + +/// +/// +/// +namespace MesWork +{ + /// + /// + /// + public partial class MesWorkForm + { + /// + /// 处理MIS逻辑 + /// + /// + private void MIS_Funtion(object e) + { + try + { + var msgEvent = (CustomeEvetnArgs)e; + if (msgEvent.TagValue == null) return; + + var tagID = msgEvent.TagID.ToString(); + var opName = msgEvent.OpName.ToString(); + var tagTypeCodeID = (int)msgEvent.TagTypeCodeID; + var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID; + var TagTypeCodeID = (EnumTagTypeCodeID)tagTypeCodeID; + var alarmMsg = msgEvent.TagName.ToString(); + var tagValue = ""; + switch (tagTypeID) + { + case EnumTagTypeID.BOOL: + tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString(); + break; + default: + tagValue = msgEvent.TagValue.ToString(); + break; + } + + switch (tagTypeCodeID) + { + case 14: + MesWorkForm.WritePLC(15, opName, tagValue); + break; + case 19: + if (tagValue == "1") + { + DataTable dt_WWW = BuildDataTables_WWW(); + SaveQualityData(opName, tagValue, tagID, out dt_WWW); + string qty = JsonConvert.SerializeObject(dt_WWW); + string SendMessage = "MES|ShowTimelyQuality_Resources|" + opName + "|" + qty; + SendMsg(opName, MesServer_SendProtocol_Plc, SendMessage); + } + else + { + MesWorkForm.WritePLC(20, opName, "0"); + } + break; + // 扫码完成,比对结果 + case 65: + if (tagValue == "1") + { + GetQualityDataCount(opName); + } + else + { + MesWorkForm.WritePLC(66, opName, 0); + } + break; + default: + break; + } + } + catch (Exception err) + { } + + + + } + + + + private static void SaveQualityData(string opName, string tagValue, string tagID, out DataTable dt_WWW, bool isCheck = false) + { + int id_tagCF; + int qualityMask = 0; + int engineTypeID = 0; + string engineID = ""; + string engineType = ""; + string partPallet = ""; + string orderFormPlc = ""; + DataTable BasicDataTagValueUpDown = new DataTable(); + DataTable BasicDataTagValue = new DataTable(); + dt_WWW = BuildDataTables_WWW(); + Hashtable valueList; + try + { + + // 加注结果 + //dt_WWW.Rows.Add(GetQualityData(opName, 63, isOk).ItemArray); + string isOk = MesWorkForm.ReadPLC(63, opName).ToString(); + engineID = MesWorkForm.ReadPLC(64, opName).ToString(); + engineID = engineID.Replace(" ", ""); + // 真空值 + dt_WWW.Rows.Add(GetQualityData(opName, 60, isOk).ItemArray); + // 加注量 + dt_WWW.Rows.Add(GetQualityData(opName, 61, isOk).ItemArray); + // 节拍时间 + dt_WWW.Rows.Add(GetQualityData(opName, 62, isOk).ItemArray); + + + DateTime lastupdatetime = DateTime.Now; + //保存质量数 + B_DB_Opera.BaseData_tagTable_QualityData_B5A_IndexInsert(engineID, tagID, engineType, engineTypeID, opName, qualityMask, partPallet, out id_tagCF); + B_DB_Opera.BaseData_tagTable_QualityData_B5A_Insert(engineID, id_tagCF, opName, dt_WWW, isCheck); + //回写保存完成数据 + WritePLC(20, opName, true); + } + catch (Exception err) + { + WritePLC(20, opName, true); + } + } + + static public DataTable BuildDataTables_WWW() + { + DataTable table; + DataColumnCollection columns; + table = new DataTable(); + columns = table.Columns; + table.Columns.Add("TagID", typeof(System.String)); + table.Columns.Add("TagValue", typeof(System.String)); + table.Columns.Add("IsGoodBad", typeof(System.Int32)); + table.Columns.Add("测量位置", typeof(System.String)); + table.Columns.Add("测量项目", typeof(System.String)); + table.Columns.Add("工位号", typeof(System.String)); + table.Columns.Add("理论值", typeof(System.String)); + table.Columns.Add("上限值", typeof(System.String)); + table.Columns.Add("下限值", typeof(System.String)); + table.Columns.Add("测量单位", typeof(System.String)); + table.Columns.Add("列位置", typeof(System.Int32)); + table.Columns.Add("变量排序", typeof(System.Int32)); + + return table; + } + public static DataRow GetQualityData(string opName, int tagTypeCode, string isOk) + { + string TagValueUp = ""; + string TagValueDown = ""; + DataRow dr = BuildDataTables_WWW().NewRow(); + var qualityData = (TagFormat)MesWorkForm.ReadPLC_TF(tagTypeCode, opName); + if(tagTypeCode == 61) + { + TagValueUp = MesWorkForm.ReadPLC(67, opName).ToString(); + TagValueDown = MesWorkForm.ReadPLC(68, opName).ToString(); + } + if (tagTypeCode == 60) + { + TagValueUp = MesWorkForm.ReadPLC(69, opName).ToString(); + } + dr["TagID"] = qualityData.TagID; + dr["测量位置"] = qualityData.ShaftID; + dr["测量项目"] = qualityData.ItemName; + dr["测量单位"] = qualityData.Unit; + dr["上限值"] = TagValueUp; + dr["下限值"] = TagValueDown; + dr["理论值"] = qualityData.TagValeNormal; + dr["工位号"] = opName; + dr["列位置"] = qualityData.TagOrderBy; + dr["变量排序"] = qualityData.TagItemOrderBy; + dr["IsGoodBad"] = isOk; + dr["TagValue"] = Convert.ToString(qualityData.TagValue); + return dr; + } + + public static void GetQualityDataCount(string opName) + { + string engineID = ""; + engineID = MesWorkForm.ReadPLC(64, opName).ToString(); + if(engineID == null || engineID == "") + { + WritePLC(66, opName, 2); + return; + } + try + { + DataTable dt = null; + B_DB_Opera.GetQualityDataCount(engineID, opName, out dt); + if (dt != null && dt.Rows.Count > 0) + { + WritePLC(66, opName, 2); + } + else + { + WritePLC(66, opName, 1); + } + } + catch (Exception err) + { + WritePLC(66, opName, 2); + } + + } + } +} + diff --git a/DT_SCADA/BusinessCode/PLC_State.cs b/DT_SCADA/BusinessCode/PLC_State.cs new file mode 100644 index 0000000..ce6e9f0 --- /dev/null +++ b/DT_SCADA/BusinessCode/PLC_State.cs @@ -0,0 +1,31 @@ +using DeviceDriver_BasicData; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MesWork +{ + public partial class Temp { } + public partial class MesWorkForm + { + /// + /// PLC状态展示 + /// + /// + void ShowPlcStateList(object obj) + { + var eState = (PlcStateEvetnArgs)obj; + string ip = eState.IP.ToString(); + string onState = eState.OnLine.ToString(); + + + + + } + + + + } +} diff --git a/DT_SCADA/Core/B_AGV.cs b/DT_SCADA/Core/B_AGV.cs new file mode 100644 index 0000000..17abc03 --- /dev/null +++ b/DT_SCADA/Core/B_AGV.cs @@ -0,0 +1,119 @@ +using DatabaseClient; +using Opc.Ua; +using OpcBasic; +using Robot.Common; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Threading; + +namespace MesWork +{ + /// + /// + /// + public class AgvRead + { + /// + /// + /// + public string from_to_loc = ""; + /// + /// + /// + string from_to_loc_old = ""; + /// + /// + /// + public string tagID = ""; + /// + /// + /// + string opName = ""; + /// + /// + /// + public string connectStr = ""; + /// + /// + /// + public bool onLine = false; + /// + /// + /// + public string update_time = ""; + /// + /// + /// + public string from_loc = ""; + /// + /// + /// + public string to_loc = ""; + /// + /// + /// + public void Start(string connectStr,int interval, int intervalUpdate ,string tagID,string opName) + { + this.connectStr = connectStr; + this.tagID = tagID; + this.opName = opName; + + new Thread(new ThreadStart(delegate () { + while (true) + { + try + { + from_to_loc = ReadAgv(); + if (from_to_loc_old != from_to_loc) + { + from_to_loc_old = from_to_loc; + + MesWorkForm.S_C_B_TagIDTrigger(opName,this.tagID, from_to_loc); + } + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })).Start(); + + } + public string ReadAgv() + { + var value = ""; + try + { + var sql = + $" SELECT aid,from_loc,to_loc,start_run,update_time FROM agv_from_to" + + $" ORDER BY aid LIMIT 1"; + MysqlClient.ExecQueryDataTable(sql, this.connectStr, out DataTable dt, out string err); + onLine = err.Length < 1; + if (onLine == false) + { + return value; + } + if (dt.Rows.Count > 0) + { + var aid = dt.Rows[0]["aid"].ToString(); + var from_loc = dt.Rows[0]["from_loc"].ToString(); + var to_loc = dt.Rows[0]["to_loc"].ToString(); + var start_run = dt.Rows[0]["start_run"].ToString(); + update_time = dt.Rows[0]["update_time"].ToString(); + + this.from_loc = from_loc; + this.to_loc = to_loc; + + value = $"{from_loc}__{to_loc}"; + } + } + catch (Exception err) + { + } + return value; + } + + + + } +} diff --git a/DT_SCADA/Core/B_Cnc_Edm.cs b/DT_SCADA/Core/B_Cnc_Edm.cs new file mode 100644 index 0000000..4ac1272 --- /dev/null +++ b/DT_SCADA/Core/B_Cnc_Edm.cs @@ -0,0 +1,613 @@ +using BsRmlib.EDM; +using Newtonsoft.Json; +using NPOI.SS.UserModel; +using NPOI.XSSF.Model; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Drawing; +using System.Security.Claims; +using System.Threading; + +namespace MesWork +{ + public class B_Cnc_Edm + { + /// + /// + /// + private CClient edm = null; + /// + /// + /// + public bool OnLine = false; + /// + /// + /// + public string ip = "-1"; + /// + /// + /// + public int port = -1; + /// + /// + /// + public int interval = -1; + /// + /// + /// + public bool isRun = true; + /// + /// + /// + public string Id = "-1"; + /// + /// + /// + public string Name = ""; + + + /// + /// 机床状态 + /// -1-离线,0-待机,1-运行,2-报警 + /// + public int edmCtrlStatus = 0; + /// + /// 机床报警号及信息 + /// + public ushort edmGetError = 0; + public ushort edmGetError_Old = 0; + public string edmGetErrMsg = ""; + /// + /// 机床提示号及信息 + /// + public ushort edmGetComment = 0; + public ushort edmGetComment_Old = 0; + public string edmGetComMsg = ""; + /// + /// 机床电流电压 + /// + public int edmGetCurrent = 0; + public int edmGetVoltage = 0; + + public string programName = ""; + + + + public string edmGetRunTime = ""; + + public string progContent = ""; + + public uint toolNum_Set = 0; + + public ushort doorAtStatus = 3; + public ushort doorAtStatus_Old = 3; + + public DateTime start = DateTime.Now; + + public ushort workbench_HasPart = 0; + public ushort workbench_HasPart_Old = 0; + public ushort spindleClamp_HasPart = 0; + public ushort spindleClamp_HasPart_Old = 0; + public ushort toolLib_HasPart = 0; + public ushort toolLib_HasPart_Old = 0; + public int IsSpark = 0; + public int IsSpark_Old = 0; + + + + + public double[] absolute_j = new double[12]; + public double[] relative_j = new double[12]; + /// + /// + /// + public double[] machine_j = new double[12]; + /// + /// + /// + public double[] jDemo = new double[12]; + /// + /// + /// + public List Joints = null; + /// + /// + /// + public string sendStr_Old = ""; + /// + /// + /// + public string payloadInfoStr_Old = ""; + + /// + /// + /// + public B_Cnc_Edm() + { + + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void Start(string ip, int port,int interval, int intervalUpdate, string DeviceCode, string OpName, List Joints + ,string tagID_DoorOpen = "", string tagID_DoorClose = "" + , string tagID_Workbench = "", string tagID_SpindleClamp = "", string tagID_ToolLib = "", string modelCode_Spark = "") + { + this.ip = ip; + this.port = port; + this.interval = interval; + this.Id = DeviceCode; + this.Name = OpName; + this.Joints = Joints; + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + + if (edm == null) + { + edmCtrlStatus = -1; + ReConnRobot(); + } + if (OnLine = edm.IsConnected()) + { + machine_j = ReadResult_To_Array(); + + //到位状态:O:打开或关闭过程中,1:打开到位,2:关闭到位 + doorAtStatus = edm.EdmStatFrontDoor(); + if (doorAtStatus_Old != doorAtStatus) + { + switch (doorAtStatus_Old) + { + case 0://0->其他:不处理 + break; + case 1://1->0:关闭 + MesWorkForm.S_C_B_TagIDTrigger(Name, tagID_DoorClose, "1"); + break; + case 2://2->0:打开 + MesWorkForm.S_C_B_TagIDTrigger(Name, tagID_DoorOpen, "1"); + break; + + } + } + doorAtStatus_Old = doorAtStatus; + + //机床状态;0-停止,1-运行,2-报警,3-暂停 + var edmCtrlStatus_NC = edm.EdmCtrlStatus(); + + switch (edmCtrlStatus_NC) + { + case EnumEdmStatus.Stop: + edmCtrlStatus = 0; + break; + case EnumEdmStatus.Run: + edmCtrlStatus = 1; + break; + case EnumEdmStatus.Halt: + edmCtrlStatus = 3; + break; + } + + //机床报警号及信息 + edmGetError = edm.EdmGetError(); + edmGetErrMsg = edm.EdmGetErrMsg(edmGetError); + if (edmGetError_Old != edmGetError) + { + // B_DB_Opera.Event_AlarmAndTip_Start(Name, edmGetError, edmGetErrMsg, edmGetError.ToString(),1); + } + edmGetError_Old = edmGetError; + + //机床提示号及信息 + edmGetComment = edm.EdmGetComment(); + edmGetComMsg = edm.EdmGetComMsg(edmGetComment); + if (edmGetComment_Old != edmGetComment) + { + // B_DB_Opera.Event_AlarmAndTip_Start(Name, edmGetComment, edmGetComMsg, edmGetComment.ToString(),2); + } + edmGetComment_Old = edmGetComment; + + //机床电流电压 + edmGetCurrent = edm.EdmGetCurrent(); + edmGetVoltage = edm.EdmGetVoltage(); + + if (edmGetCurrent > 5) + { + IsSpark = 1; + } + else + { + IsSpark = 0; + } + + if (IsSpark_Old != IsSpark) + { + // MesWorkForm.S_C_B_SparkTrigger(Name, modelCode_Spark, IsSpark.ToString()); + } + IsSpark_Old = IsSpark; + + + + + //获取当前机床主程序 + programName = edm.PrgGetSelMain(); + + //运行时间 + edmGetRunTime = edm.EdmGetRunTime().ToString(); + + //程序内容 + progContent = edm.EdmGetDispNc().nc; + + //刀具号 + toolNum_Set = edm.EdmGetToolNo(); + + + workbench_HasPart = edm.EdmStatWorkbenExistPiece(); + if (workbench_HasPart_Old != workbench_HasPart) + { + MesWorkForm.S_C_B_TagIDTrigger(Name, tagID_Workbench, workbench_HasPart.ToString()); + } + workbench_HasPart_Old = workbench_HasPart; + + spindleClamp_HasPart = edm.EdmStatSpindleExistTool(); + if (spindleClamp_HasPart_Old != spindleClamp_HasPart) + { + MesWorkForm.S_C_B_TagIDTrigger(Name, tagID_SpindleClamp, spindleClamp_HasPart.ToString()); + } + spindleClamp_HasPart_Old = spindleClamp_HasPart; + + toolLib_HasPart = edm.EdmStatMagaginExistTool(); + if (toolLib_HasPart_Old != toolLib_HasPart) + { + MesWorkForm.S_C_B_TagIDTrigger(Name, tagID_ToolLib, toolLib_HasPart.ToString()); + } + toolLib_HasPart_Old = toolLib_HasPart; + } + else + { + edmCtrlStatus = -1; + Thread.Sleep(10_000); + ReConnRobot(); + continue; + } + for (int i = 0; i < Joints.Count ; i++) + { + Joints[i].DeviceCode = DeviceCode; + Joints[i].Value = machine_j[i].ToString(); + } + + var sendStr = MesWorkForm.Move_Joint(Joints); + if (sendStr_Old != sendStr) + { + sendStr_Old = sendStr; + MesWorkForm.SendMsg(sendStr); + } + + + + + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () { + while (isRun) + { + try + { + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = DeviceCode; + Joints[i].Value = machine_j[i].ToString(); + } + + var payload = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(payload); + + } + catch (Exception err) + { } + Thread.Sleep(intervalUpdate); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + UpdateDataToSql(); + UpdateStationStatusToSql(); + + + var deviceInfo = new DeviceInfo(); + deviceInfo.order = ""; + deviceInfo.Name = Name; + deviceInfo.Id = Id; + + deviceInfo.Status = edmCtrlStatus.ToString(); + deviceInfo.Program = programName; + deviceInfo.ProgramStatus = ""; + deviceInfo.Feed = ""; + deviceInfo.Speed = ""; + deviceInfo.Rapid = ""; + deviceInfo.Current = edmGetCurrent.ToString(); + deviceInfo.Voltage = edmGetVoltage.ToString(); + deviceInfo.Axis = new List(); + deviceInfo.Tool = null; + deviceInfo.OtherParameter = new List(); + deviceInfo.Alarm = new List(); + if (edmGetErrMsg.Length > 0) + { + deviceInfo.Alarm.Add(new AlarmInfo() + { + AlarmCode = edmGetError.ToString(), + Alarm = edmGetErrMsg, + AlarmTime = DateTime.Now.ToString("G") + }); + } + deviceInfo.Tip = new List(); + if (edmGetComMsg.Length > 0) + { + deviceInfo.Tip.Add(new TipInfo() + { + TipCode = edmGetComment.ToString(), + Tip = edmGetComMsg, + TipTime = DateTime.Now.ToString("G") + }); + } + + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "X", AxisValue = machine_j[0].ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "Y", AxisValue = machine_j[1].ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "Z", AxisValue = machine_j[2].ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "U", AxisValue = machine_j[3].ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "V", AxisValue = machine_j[4].ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "W", AxisValue = machine_j[5].ToString() }); + + var payloadInfoStr = MesWorkForm.Make_DeviceInfo(new List() { deviceInfo }); + + DateTime current = DateTime.Now; + if ((current - start).TotalMilliseconds > 1000) + { + // if (payloadInfoStr_Old != payloadInfoStr) + { + payloadInfoStr_Old = payloadInfoStr; + MesWorkForm.SendMsg(payloadInfoStr); + } + start = current; + } + + + Thread.Sleep(1000); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + InsertStationStatusToSql(); + Thread.Sleep(60 * 1000); + } + })) + { IsBackground = true }.Start(); + + } + + /// + /// + /// + public void TimelyUpdate() + { + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + } + + + /// + /// + /// + ~B_Cnc_Edm() + { + DisConn(); + } + /// + /// + /// + /// + /// + public void DisConn() + { + isRun = false; + Thread.Sleep(199); + edm?.Disconnect(); + + } + + + /// + /// + /// + private void ReConnRobot() + { + if (edm != null) + { + edm?.Disconnect(); + } + edm = new CClient(); + var success = edm.Connect(ip, (uint)port); + if (success) + { + } + + } + + + + + /// + /// + /// + /// + /// + private double[] ReadResult_To_Array() + { + if (MesWorkForm.IsDemoMesServer == 1) + { + return jDemo; + } + + double[] joint = new double[12]; + + var X = edm.EdmGetMachine(EnumAxisNo.X) / GetAxisDec(EnumAxisNo.X); + var Y = edm.EdmGetMachine(EnumAxisNo.Y) / GetAxisDec(EnumAxisNo.Y); + var Z = edm.EdmGetMachine(EnumAxisNo.Z) / GetAxisDec(EnumAxisNo.Z); + var U = edm.EdmGetMachine(EnumAxisNo.U) / GetAxisDec(EnumAxisNo.U); + var V = 0; + var W = 0; + + joint[0] = X; + joint[1] = Y; + joint[2] = Z; + joint[3] = U; + joint[4] = V; + joint[5] = W; + + + return joint; + } + + private double GetAxisDec(EnumAxisNo axis) + { + CPosInfo info = edm.EdmGetPosInfo(axis); + if (info.dec == 3) + return 1000.0; + else if (info.dec == 4) + return 10000.0; + return 1000.0; + } + + /// + /// 手动测试读取 + /// + /// + /// + /// + public string ReadTest(string robotName) + { + return "【" + robotName + "】" + MesWorkForm.Move_Joint(Joints); + } + + public void UpdateDataToSql() + { + //StoredProcedure("Event_CNC_Update"); + } + + //private void StoredProcedure(string pName) + //{ + // var sqlParameter = new SqlParameter[] { + // new SqlParameter("@DeviceCode", Id), + // new SqlParameter("@Online", OnLine.ToString()), + // new SqlParameter("@StationName", Name), + // new SqlParameter("@SlaveAddr", $"{ip}:{port}"), + // new SqlParameter("@Path", 1), + + // new SqlParameter("@程序号",0 ), + // new SqlParameter("@程序名称", programName), + // new SqlParameter("@主轴转速组", JsonConvert.SerializeObject(new double[6])), + // new SqlParameter("@坐标_绝对组", JsonConvert.SerializeObject(new double[6])), + // new SqlParameter("@坐标_相对组", JsonConvert.SerializeObject(new double[6])), + // new SqlParameter("@坐标_机械组", JsonConvert.SerializeObject(machine_j)), + // new SqlParameter("@伺服负载组", JsonConvert.SerializeObject(new double[6])), + // new SqlParameter("@进给速度",0 ), + // new SqlParameter("@进给倍率",0), + // new SqlParameter("@主轴倍率", 0), + // new SqlParameter("@已加工数量",0 ), + // new SqlParameter("@总加工数量", 0), + // new SqlParameter("@工作模式",JsonConvert.SerializeObject(new double[6] )), + // new SqlParameter("@TM模式", 0), + // new SqlParameter("@自动模式", 0), + // new SqlParameter("@运行状态",0), + // new SqlParameter("@轴_停留状态",0), + // new SqlParameter("@matb", 0), + // new SqlParameter("@急停", 0), + // new SqlParameter("@报警",0 ), + // new SqlParameter("@编辑状态", 0), + // new SqlParameter("@开机时间", 0), + // new SqlParameter("@运行时间", edmGetRunTime), + // new SqlParameter("@切削时间",0 ), + // new SqlParameter("@循环时间", 0), + // new SqlParameter("@机床时间", 0), + // new SqlParameter("@加工次数", 0), + // new SqlParameter("@额定次数", 0), + // new SqlParameter("@程序内容", progContent), + // new SqlParameter("@刀具号", (int)toolNum_Set), + // //北京电火花项目 + // new SqlParameter("@机床状态",(int)edmCtrlStatus), + // new SqlParameter("@报警代码",(int)edmGetError), + // new SqlParameter("@报警内容",edmGetErrMsg), + // new SqlParameter("@提示代码",(int)edmGetError), + // new SqlParameter("@提示内容",edmGetErrMsg), + // new SqlParameter("@电流",(int)edmGetCurrent), + // new SqlParameter("@电压",(int)edmGetVoltage), + + + // }; + // MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + // { + // procedureName = pName, + // sqlParameter = sqlParameter + // }); + //} + + + private void UpdateStationStatusToSql() + { + //Event_StationStatus("Event_StationStatus_Update"); + } + private void InsertStationStatusToSql() + { + //Event_StationStatus("Event_StationStatus_Insert"); + } + + //public void Event_StationStatus(string pName) + //{ + // try + // { + // var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + + // MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + // { + // procedureName = pName, + // sqlParameter = new SqlParameter[] { + // new SqlParameter("@OpName", Name), + // new SqlParameter("@Status", (int)edmCtrlStatus), + // new SqlParameter("@ChangeTime",ChangeTime) + // } + // }); + + // } + // catch (Exception err) + // { + // } + + + //} + + + + } +} diff --git a/DT_SCADA/Core/B_DeviceState.cs b/DT_SCADA/Core/B_DeviceState.cs new file mode 100644 index 0000000..11cb0bd --- /dev/null +++ b/DT_SCADA/Core/B_DeviceState.cs @@ -0,0 +1,148 @@ +using Opc.Ua; +using OpcBasic; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Threading; + +/// +/// +/// +namespace MesWork +{ + /// + /// + /// + public class B_DeviceState + { + /// + /// + /// + public int interval = 0; + /// + /// + /// + public int intervalUpdate = 0; + /// + /// + /// + public int intervalInsert = 0; + /// + /// + /// + public string opName = ""; + /// + /// + /// + public ConcurrentDictionary cd_OpNameGroupData = new ConcurrentDictionary(); + /// + /// + /// + /// + /// + /// + /// + public B_DeviceState(int interval, int intervalUpdate, int intervalInsert, string opName) + { + this.interval = interval; + this.intervalUpdate = intervalUpdate; + this.intervalInsert = intervalInsert; + this.opName = opName; + } + public void Start() + { + new Thread(new ThreadStart(delegate () + { + while (true) + { + try + { + cd_OpNameGroupData = MesWorkForm.ReadPLC_GroupData(opName); + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () + { + while (true) + { + UpdateDataToSql(); + Thread.Sleep(intervalUpdate); + } + })){ IsBackground = true }.Start(); + new Thread(new ThreadStart(delegate () + { + while (true) + { + InsertDataToSql(); + Thread.Sleep(intervalInsert); + } + })){ IsBackground = true }.Start(); + + } + + + public void UpdateDataToSql() + { + StoredProcedure("Event_Device_Update_CurrInfo"); + } + private void InsertDataToSql() + { + StoredProcedure("Event_Device_Insert_CurrInfo"); + } + + public void StoredProcedure(string pName) + { + try + { + var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + + foreach (KeyValuePair item in cd_OpNameGroupData) + { + var TF = (TagFormat)item.Value; + + var TagTypeCodeID = TF.TagTypeCodeID; + var TagOrderBy = TF.TagOrderBy; + var ItemName = TF.ItemName; + var TagValue = TF.TagValue.ToString(); + var TagID = TF.TagID; + + if (TagTypeCodeID < 1000 | TagTypeCodeID >= 40000) + { + + //MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + //{ + // procedureName = pName, + // sqlParameter = new SqlParameter[] { + // new SqlParameter("@OpName", opName), + // new SqlParameter("@TagTypeCodeID", TagTypeCodeID), + // new SqlParameter("@TagOrderBy", TagOrderBy), + // new SqlParameter("@ItemName", ItemName), + // new SqlParameter("@TagValue", TagValue), + // new SqlParameter("@ChangeTime",ChangeTime), + // new SqlParameter("@TagID", TagID) + // } + //}); + //var sendStr2 = MesWorkForm.MachineQtyDataInfo("C_B_QtyInfo", opName, TagID, TagValue); + //MesWorkForm.SendMsg(sendStr2); + } + + + } + } + catch (Exception err) + { + } + + + } + + + + + } +} diff --git a/DT_SCADA/Core/B_Read_N_Axis.cs b/DT_SCADA/Core/B_Read_N_Axis.cs new file mode 100644 index 0000000..f32705d --- /dev/null +++ b/DT_SCADA/Core/B_Read_N_Axis.cs @@ -0,0 +1,188 @@ +using Opc.Ua; +using OpcBasic; +using Robot.Common; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace MesWork +{ + public partial class Temp { } + public partial class B_Read_N_Axis + { + /// + /// + /// + string sendStr_Temp = "-1"; + /// + /// + /// + string opName = ""; + /// + /// + /// + int axisNum = 1; + /// + /// + /// + int interval = 100; + /// + /// + /// + int intervalUpdate = 10000; + /// + /// + /// + string Id = ""; + /// + /// + /// + string Name = ""; + /// + /// + /// + public void Start(int interval, int intervalUpdate ,string opName, List Joints, string Id, string Name) + { + this.axisNum = Joints.Count; + this.interval = interval; + this.intervalUpdate = intervalUpdate; + this.opName = opName; + + + new Thread(new ThreadStart(delegate () { while (true) { try { + + var j = Read_N_Axis(out bool success); + if (success == false) + { + continue; + } + //if (j.Select(it => it == 0).Count() == j.Length) + //{ + // continue; + //} + for (int i = 0; i < j.Length; i++) + { + Joints[i].DeviceCode = opName; + Joints[i].Value = j[i].ToString(); + } + var sendStr = MesWorkForm.Move_Joint(Joints); + if (sendStr_Temp != sendStr) + { + MesWorkForm.SendMsg(sendStr); + MesWorkForm.S_C_B_Info_Fast(Joints); + MesWorkForm.WriteLog(sendStr); + } + sendStr_Temp = sendStr; + } catch (Exception err) { } Thread.Sleep(interval); + } })).Start(); + + new Thread(new ThreadStart(delegate () { while (true) { try { + + var j = Read_N_Axis(out bool success); + if (success == false) + { + continue; + } + //if (j.Select(it => it == 0).Count() == j.Length) + //{ + // continue; + //} + for (int i = 0; i < j.Length; i++) + { + Joints[i].DeviceCode = opName; + Joints[i].Value = j[i].ToString(); + } + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + MesWorkForm.S_C_B_Info_Fast(Joints); + MesWorkForm.WriteLog(sendStr); + } catch (Exception err) { } Thread.Sleep(intervalUpdate); + }})).Start(); + + new Thread(new ThreadStart(delegate () + { + while (true) + { + var deviceInfo = new DeviceInfo(); + deviceInfo.order = ""; + deviceInfo.Name = Name; + deviceInfo.Id = Id; + + deviceInfo.Axis = new List(); + deviceInfo.OtherParameter = new List(); + + var j = Read_N_Axis(out bool success); + + if (success == false) + { + continue; + } + //if (j.Select(it => it == 0).Count() == j.Length) + //{ + // continue; + //} + + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J1", AxisValue = Math.Round(j[0], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J2", AxisValue = Math.Round(j[1], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J3", AxisValue = Math.Round(j[2], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J4", AxisValue = Math.Round(j[3], 2).ToString() }); + + var payloadInfoStr = MesWorkForm.Make_DeviceInfo(new List() { deviceInfo }); + + MesWorkForm.SendMsg(payloadInfoStr); + + Thread.Sleep(300); + } + })) + { IsBackground = true }.Start(); + + + } + + + public double[] Read_N_Axis(out bool success) + { + success = true; + double[] p = new double[this.axisNum]; + + var jointArray = MesWorkForm.ReadPLC_GroupData(this.opName); + if (axisNum != jointArray.Count) + { + return p; + } + var listFalse = new List(); + foreach (KeyValuePair item in jointArray) + { + var TF = (TagFormat)item.Value; + var index = Convert.ToInt32(TF.ShaftID); + var value = Convert.ToDouble(TF.TagValue); + switch (value) + { + case -1: + case -2: + case -5: + case 100: + listFalse.Add(false); + break; + default: + break; + } + + p[index] = value; + } + if (listFalse.Count() > 0) + { + success = false; + return p; + } + + return p; + } + + + + + } +} diff --git a/DT_SCADA/Core/B_Read_N_AxisCard.cs b/DT_SCADA/Core/B_Read_N_AxisCard.cs new file mode 100644 index 0000000..cb52a92 --- /dev/null +++ b/DT_SCADA/Core/B_Read_N_AxisCard.cs @@ -0,0 +1,160 @@ +using NPOI.SS.Formula.Functions; +using NPOI.XSSF.Streaming.Values; +using Opc.Ua; +using OpcBasic; +using Robot.Common; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading; + +namespace MesWork +{ + public class B_Read_N_AxisCard + { + /// + /// + /// + string sendStr_Temp = "-1"; + /// + /// + /// + string opName = ""; + /// + /// + /// + int axisNum = 1; + /// + /// + /// + int interval = 100; + /// + /// + /// + int intervalUpdate = 10000; + /// + /// + /// + public void Start(int interval, int intervalUpdate ,string opName, List Joints) + { + this.axisNum = Joints.Count; + this.interval = interval; + this.intervalUpdate = intervalUpdate; + this.opName = opName; + + + new Thread(new ThreadStart(delegate () { while (true) { try { + + var j = Read_N_Axis(); + for (int i = 0; i < j.Length; i++) + { + Joints[i].DeviceCode = opName; + Joints[i].Value = j[i].ToString(); + } + var sendStr = MesWorkForm.Move_Joint(Joints); + if (sendStr_Temp != sendStr) + { + MesWorkForm.SendMsg(sendStr); + MesWorkForm.S_C_B_Info_Fast(Joints); + } + sendStr_Temp = sendStr; + } catch (Exception err) { } Thread.Sleep(interval); + } })).Start(); + + new Thread(new ThreadStart(delegate () { while (true) { try { + + var j = Read_N_Axis(); + for (int i = 0; i < j.Length; i++) + { + Joints[i].DeviceCode = opName; + Joints[i].Value = j[i].ToString(); + } + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + MesWorkForm.S_C_B_Info_Fast(Joints); + } catch (Exception err) { } Thread.Sleep(intervalUpdate); + }})).Start(); + + + } + + + //public double[] Read_N_Axis() + //{ + // double[] p = new double[this.axisNum]; + + // var x1 = Convert.ToDouble(MesWorkForm.ReadPLC(101, this.opName).ToString()); + // var x2 = Convert.ToDouble(MesWorkForm.ReadPLC(102, this.opName).ToString()); + // var y1 = Convert.ToDouble(MesWorkForm.ReadPLC(201, this.opName).ToString()); + // var y2 = Convert.ToDouble(MesWorkForm.ReadPLC(202, this.opName).ToString()); + // var z1 = Convert.ToDouble(MesWorkForm.ReadPLC(301, this.opName).ToString()); + // var z2 = Convert.ToDouble(MesWorkForm.ReadPLC(302, this.opName).ToString()); + + // p[0] = x1 + x2 * 0.001; + // p[1] = y1 + y2 * 0.001; + // p[2] = z1 + z2 * 0.001; + + // return p; + //} + + public double[] Read_N_Axis() + { + double[] p = new double[this.axisNum]; + + //var x1 = Convert.ToDouble(MesWorkForm.ReadPLC(101, this.opName).ToString()); + //var x2 = Convert.ToDouble(MesWorkForm.ReadPLC(102, this.opName).ToString()); + //var y1 = Convert.ToDouble(MesWorkForm.ReadPLC(201, this.opName).ToString()); + //var y2 = Convert.ToDouble(MesWorkForm.ReadPLC(202, this.opName).ToString()); + //var z1 = Convert.ToDouble(MesWorkForm.ReadPLC(301, this.opName).ToString()); + //var z2 = Convert.ToDouble(MesWorkForm.ReadPLC(302, this.opName).ToString()); + + double x1 = 0; + double x2 = 0; + double y1 = 0; + double y2 = 0; + double z1 = 0; + double z2 = 0; + + var jointArray = MesWorkForm.ReadPLC_GroupData(this.opName); + foreach (KeyValuePair item in jointArray) + { + var TF = (TagFormat)item.Value; + var tagTypeCodeID = Convert.ToInt32(TF.TagTypeCodeID); + var value = Convert.ToDouble(TF.TagValue); + + switch (tagTypeCodeID) + { + case 101: + x1 = value; + break; + case 102: + x2 = value; + break; + case 201: + y1 = value; + break; + case 202: + y2 = value; + break; + case 301: + z1 = value; + break; + case 302: + z2 = value; + break; + default: + break; + } + } + + p[0] = x1 + x2 * 0.001; + p[1] = y1 + y2 * 0.001; + p[2] = z1 + z2 * 0.001; + + return p; + } + + + + } +} diff --git a/DT_SCADA/Core/B_Robot_Abb.cs b/DT_SCADA/Core/B_Robot_Abb.cs new file mode 100644 index 0000000..13f7d05 --- /dev/null +++ b/DT_SCADA/Core/B_Robot_Abb.cs @@ -0,0 +1,305 @@ +using System; +using System.Threading; +using System.Collections.Generic; +using ABB.Robotics.Controllers; +using ABB.Robotics.Controllers.Discovery; +using ABB.Robotics.Controllers.IOSystemDomain; +using Robot.Common; + + +namespace MesWork +{ + public class B_Robot_Abb + { + /// + /// + /// + private Controller abb = null; + /// + /// + /// + public bool OnLine = false; + /// + /// + /// + public string ip = "-1"; + /// + /// + /// + public string cname = ""; + /// + /// + /// + public int interval = -1; + /// + /// + /// + public bool isRun = true; + + /// + /// + /// + public string Id = "-1"; + /// + /// + /// + public string Name = ""; + + + + public string robotWorkbench_1 = ""; + public string robotWorkbench_Old_1 = ""; + public string robotWorkbench_2 = ""; + public string robotWorkbench_Old_2 = ""; + + public string TagID_Axis_7 = ""; + + + + /// + /// + /// + public double[] j = new double[12]; + /// + /// + /// + public double[] jDemo = new double[12]; + /// + /// + /// + public List Joints = null; + /// + /// + /// + public string sendStr_Old = ""; + + /// + /// + /// + public B_Robot_Abb() + { + + } + + + /// + /// + /// + /// + /// + /// + /// + /// + public void Start(string ip, string cname,int interval, int intervalUpdate, string DeviceCode, string OpName, List Joints + , string TagID_DoorOpen = "", string TagID_DoorClose = "", string TagID_Axis_7 = "") + { + this.ip = ip; + this.cname = cname; + this.interval = interval; + this.Id = DeviceCode; + this.Name = OpName; + this.Joints = Joints; + this.TagID_Axis_7 = TagID_Axis_7; + + var robotWorkbench_1_Addr = TagID_DoorOpen.Split(',')[0]; + var robotWorkbench_1_TagID = TagID_DoorOpen.Split(',')[1]; + var robotWorkbench_2_Addr = TagID_DoorClose.Split(',')[0]; + var robotWorkbench_2_TagID = TagID_DoorClose.Split(',')[1]; + + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + + if (abb == null) + { + ReConnRobot(); + } + OnLine = abb.Connected; + if (OnLine) + { + j = ReadResult_To_Array(); + + robotWorkbench_1 = ReadIO(robotWorkbench_1_Addr); + if (robotWorkbench_Old_1 != robotWorkbench_1) + { + MesWorkForm.S_C_B_TagIDTrigger(Name, robotWorkbench_1_TagID, robotWorkbench_1); + } + robotWorkbench_Old_1 = robotWorkbench_1; + + robotWorkbench_2 = ReadIO(robotWorkbench_2_Addr); + if (robotWorkbench_Old_2 != robotWorkbench_2) + { + MesWorkForm.S_C_B_TagIDTrigger(Name, robotWorkbench_2_TagID, robotWorkbench_2); + } + robotWorkbench_Old_2 = robotWorkbench_2; + + } + else + { + Thread.Sleep(10 * 1000); + ReConnRobot(); + continue; + } + for (int i = 0; i < Joints.Count ; i++) + { + Joints[i].DeviceCode = DeviceCode; + Joints[i].Value = j[i].ToString(); + } + + var sendStr = MesWorkForm.Move_Joint(Joints); + if (sendStr_Old != sendStr) + { + sendStr_Old = sendStr; + MesWorkForm.SendMsg(sendStr); + } + + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () { + while (isRun) + { + try + { + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = DeviceCode; + Joints[i].Value = j[i].ToString(); + } + + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + + } + catch (Exception err) + { } + Thread.Sleep(intervalUpdate); + } + })) + { IsBackground = true }.Start(); + } + + + private string ReadIO(string addr) + { + var valueStr = ""; + // using (var m = Mastership.Request(abb.Rapid)) + { + var _d = (DigitalSignal)abb.IOSystem.GetSignal(addr); + if (_d != null) + { + valueStr = _d.Value.ToString(); + } + } + switch (valueStr.ToLower()) + { + case "0": + case "false": + valueStr = "0"; + break; + case "1": + case "true": + valueStr = "1"; + break; + default: + break; + } + return valueStr; + } + + ~B_Robot_Abb() + { + DisConn(); + } + /// + /// + /// + /// + /// + public void DisConn() + { + isRun = false; + Thread.Sleep(199); + abb?.Logoff(); + + } + + + /// + /// + /// + private void ReConnRobot() + { + if (MesWorkForm.IsDemoMesServer == 1) + { + //abb = ControllerFactory.CreateFrom(); + //abb.Logon(UserInfo.DefaultUser); + abb = new Controller(); + return; + } + + if (abb != null) + { + abb?.Logoff(); + abb = null; + } + + var scanner = new NetworkScanner(); + var controllers = scanner.GetControllers(); + foreach (var controllerInfo in controllers) + { + if (controllerInfo.IPAddress.ToString() == ip & controllerInfo.SystemName == cname) + { + abb = ControllerFactory.CreateFrom(controllerInfo); + abb.Logon(UserInfo.DefaultUser); + } + } + + } + + /// + /// + /// + /// + /// + private double[] ReadResult_To_Array() + { + + if (MesWorkForm.IsDemoMesServer == 1) + { + return jDemo; + } + float j7 = 0f; + try + { + j7 = Convert.ToSingle(MesWorkForm.ReadPLC(TagID_Axis_7).ToString()); + + } + catch (Exception err ) + { + } + + var joint = new double[12]; + var currJoint = abb.MotionSystem.ActiveMechanicalUnit.GetPosition(); + joint[0] = currJoint.RobAx.Rax_1; + joint[1] = currJoint.RobAx.Rax_2; + joint[2] = currJoint.RobAx.Rax_3; + joint[3] = currJoint.RobAx.Rax_4; + joint[4] = currJoint.RobAx.Rax_5; + joint[5] = currJoint.RobAx.Rax_6; + joint[6] = j7; + + return joint; + } + + + } +} diff --git a/DT_SCADA/Core/B_Robot_Espon.cs b/DT_SCADA/Core/B_Robot_Espon.cs new file mode 100644 index 0000000..68a9835 --- /dev/null +++ b/DT_SCADA/Core/B_Robot_Espon.cs @@ -0,0 +1,418 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Text.RegularExpressions; +using System.Threading; +using System.Windows.Forms; +using System.Collections.Generic; +using Newtonsoft.Json; +using HslCommunication.Robot.FANUC; +using HslCommunication.Robot.KUKA; +using System.Net.Sockets; +using Org.BouncyCastle.Bcpg; +using System.Text; +using Adapters; +using static Focas1; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace MesWork +{ + public class B_Robot_Espon + { + /// + /// + /// + private Socket espon = null; + /// + /// + /// + public bool OnLine = false; + /// + /// + /// + public string ip = "-1"; + /// + /// + /// + public int port = -1; + /// + /// + /// + public int interval = -1; + /// + /// + /// + public bool isRun = true; + /// + /// + /// + public string sendV_Temp = "-1"; + /// + /// + /// + public double[] j = new double[12]; + /// + /// + /// + public double[] jDemo = new double[12]; + /// + /// 记录老值 + /// + string axis_act_Old = "-1"; + /// + /// 焊接中 + /// + public string clamp_Old = ""; + /// + /// + /// + public string clamp = ""; + /// + /// + /// + public string Id = "-1"; + /// + /// + /// + public string Name = ""; + /// + /// + /// + public List Joints = null; + /// + /// + /// + public string md5Pos = ""; + + + /// + /// + /// + public B_Robot_Espon() + { + + } + + + /// + /// + /// + /// + /// + /// + /// + /// + public void Start(string ip, int port,int interval, int intervalUpdate, string DeviceCode, string OpName, List Joints,string TagID_Clamp) + { + this.ip = ip; + this.port = port; + this.interval = interval; + this.Id = DeviceCode; + this.Name = OpName; + this.Joints = Joints; + var dataRec = new byte[1024 * 1024]; + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + int readlen = 0; + if (espon == null) + { + continue; + } + try + { + espon.ReceiveTimeout = 5000; + readlen = espon.Receive(dataRec, 0, dataRec.Length, SocketFlags.None); + } + catch (Exception err) + { + continue; + } + if (readlen <= 0) + { + continue; + } + + var str = Encoding.Default.GetString(dataRec, 0, readlen); + + j = ReadResult_To_Array(str, out string clamp); + + if (clamp_Old != clamp) + { + MesWorkForm.S_C_B_TagIDTrigger(OpName, TagID_Clamp, clamp); + } + clamp_Old = clamp; + + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = $"ROBOT_ESPON_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + + var payload = MesWorkForm.Move_Joint(Joints); + var md5Str = JsonConvert.SerializeObject(payload); + if (md5Pos != md5Str) + { + md5Pos = md5Str; + MesWorkForm.SendMsg(payload); + } + + + } + catch (Exception err) { } + Thread.Sleep(15); + } + })) + { IsBackground = true }.Start(); + + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + + try + { + if (MesWorkForm.IsDemoMesServer == 1) + { + j = jDemo; + OnLine = true; + continue; + } + if (espon == null) + { + ReConnRobot(); + } + var data = Encoding.Default.GetBytes("1"); + espon.Send(data, 0, data.Length, SocketFlags.None); + OnLine = true; + } + catch (Exception err) + { + OnLine = false; + Thread.Sleep(2000); + ReConnRobot(); + continue; + } + + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) + { IsBackground = true }.Start(); + + + new Thread(new ThreadStart(delegate () { + while (isRun) + { + try + { + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = $"ROBOT_ESPON_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + + var payload = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(payload);//FANUC机床的轴位置 + + UpdateDataToSql(); + } + catch (Exception err) + { } + Thread.Sleep(intervalUpdate); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + var deviceInfo = new DeviceInfo(); + deviceInfo.order = ""; + deviceInfo.Name = Name; + deviceInfo.Id = Id; + + deviceInfo.Axis = new List(); + deviceInfo.OtherParameter = new List(); + + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J1", AxisValue = Math.Round(j[0], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J2", AxisValue = Math.Round(j[1], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J3", AxisValue = Math.Round(j[2], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J4", AxisValue = Math.Round(j[3], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J5", AxisValue = Math.Round(j[4], 2).ToString() }); + deviceInfo.Axis.Add(new AxisInfo() { AxisName = "J6", AxisValue = Math.Round(j[5], 2).ToString() }); + + var payloadInfoStr = MesWorkForm.Make_DeviceInfo(new List() { deviceInfo }); + + MesWorkForm.SendMsg(payloadInfoStr); + + Thread.Sleep(300); + } + })) + { IsBackground = true }.Start(); + + + } + + public void TimelyUpdate() + { + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + } + + + + ~B_Robot_Espon() + { + DisConn(); + } + /// + /// + /// + /// + /// + public void DisConn() + { + isRun = false; + Thread.Sleep(199); + espon?.Close(); + espon = null; + + } + + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ReConnRobot() + { + if (MesWorkForm.IsDemoMesServer == 1) + { + espon = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + return; + } + + if (espon != null) + { + espon?.Close(); + espon = null; + } + espon = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + espon.Connect(ip, port); + + } + + /// + /// + /// + /// + /// + private double[] ReadResult_To_Array(string readResult,out string clamp) + { + clamp = "-1"; + + var joint = new double[12]; + var jStr = readResult.Split(','); + + joint[0] = Math.Round(Convert.ToDouble(jStr[0]), 2); + joint[1] = Math.Round(Convert.ToDouble(jStr[1]), 2); + joint[2] = Math.Round(Convert.ToDouble(jStr[2]), 2); + joint[3] = Math.Round(Convert.ToDouble(jStr[3]), 2); + joint[4] = Math.Round(Convert.ToDouble(jStr[4]), 2); + joint[5] = Math.Round(Convert.ToDouble(jStr[5]), 2); + + clamp = jStr[6]; + + return joint; + } + + + /// + /// 读取数据 + /// + /// + /// + public string Read_Welding(string addr) + { + string str = "-1"; + //if (kuka != null) + //{ + // var r = kuka.ReadString(addr); + // if (r.IsSuccess) + // { + // str = r.Content; + // } + //} + + return str; + } + + /// + /// 手动测试读取 + /// + /// + /// + /// + public string ReadTest(string robotName) + { + return "【" + robotName + "】" + MesWorkForm.Move_Joint(Joints); + } + + public void UpdateDataToSql() + { + StoredProcedure("Event_Robot_Update"); + } + private void StoredProcedure(string pName) + { + //var sqlParameter = new SqlParameter[] { + // new SqlParameter("@DeviceCode", DeviceCode), + // new SqlParameter("@Online", OnLine), + // new SqlParameter("@StationName", OpName), + // new SqlParameter("@SlaveAddr", $"{ip}:{port}"), + + // new SqlParameter("@Joint1", j[0]), + // new SqlParameter("@Joint2", j[1]), + // new SqlParameter("@Joint3", j[2]), + + // new SqlParameter("@Joint4", j[3]), + // new SqlParameter("@Joint5", j[4]), + // new SqlParameter("@Joint6", j[5]), + + // new SqlParameter("@Joint7", j[6]), + // new SqlParameter("@Joint8", j[7]), + // new SqlParameter("@Joint9", j[8]), + + // new SqlParameter("@Joint10",j[9]), + // new SqlParameter("@Joint11",j[10]), + // new SqlParameter("@Joint12",j[11]), + // new SqlParameter("@Clamp", welding) + // }; + //MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + //{ + // procedureName = pName, + // sqlParameter = sqlParameter + //}); + } + + + + } +} diff --git a/DT_SCADA/Core/B_Robot_Fanuc.cs b/DT_SCADA/Core/B_Robot_Fanuc.cs new file mode 100644 index 0000000..7f18935 --- /dev/null +++ b/DT_SCADA/Core/B_Robot_Fanuc.cs @@ -0,0 +1,409 @@ +using HslCommunication.Robot.FANUC; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using NPOI.SS.Formula.Functions; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading; +using static Focas1; + +namespace MesWork +{ + public partial class Temp { } + public partial class B_Robot_Fanuc + { + /// + /// + /// + private FanucInterfaceNet fanuc = null; + /// + /// + /// + public bool OnLine = false; + /// + /// + /// + private string ip = "-1"; + /// + /// + /// + private int port = -1; + /// + /// + /// + private int interval = -1; + /// + /// + /// + private bool isRun = true; + /// + /// + /// + private string cmd = ""; + /// + /// + /// + private string cmd_Welding = ""; + /// + /// + /// + string sendV_Temp = "-1"; + /// + /// + /// + public double[] j = new double[12]; + /// + /// + /// + public double[] jDemo = new double[12]; + /// + /// + /// + string DeviceCode = ""; + /// + /// + /// + string OpName = ""; + /// + /// 焊接中 + /// + int welding = 0; + /// + /// + /// + public string Id = "-1"; + /// + /// + /// + string Name = ""; + /// + /// + /// + List Joints = null; + /// + /// + /// + public string md5Pos = ""; + + /// + /// + /// + public B_Robot_Fanuc() + { + + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void Start(string ip, int port, int interval, int intervalUpdate, string cmd, string cmd_Welding, string Id, string Name, List Joints) + { + this.ip = ip; + this.port = port; + this.interval = interval; + this.cmd = cmd; + this.cmd_Welding = cmd_Welding; + this.Id = Id; + this.Name = Name; + this.Joints = Joints; + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + //var weldingStr = Read_Welding(cmd_Welding); + //switch (weldingStr.ToLower()) + //{ + // case "1": + // case "true": + // welding = 1; + // break; + // default: + // welding = 0; + // break; + //} + + if (fanuc == null) + { + ReConnRobot(); + } + var r = fanuc.ReadString(cmd); + OnLine = r.IsSuccess; + if (OnLine) + { + j = ReadResult_To_Array(r.Content); + } + else + { + Thread.Sleep(10 * 1000); + ReConnRobot(); + continue; + } + + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = $"ROBOT_FANUC_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + //Joints[0].Value = j[0].ToString(); + //Joints[1].Value = j[1].ToString(); + //Joints[2].Value = j[2].ToString(); + //Joints[3].Value = j[3].ToString(); + //Joints[4].Value = j[4].ToString(); + //Joints[5].Value = j[5].ToString(); + //Joints[6].Value = j[6].ToString(); + + var payload = MesWorkForm.Move_Joint(Joints); + var md5Str = JsonConvert.SerializeObject(payload); + if (md5Pos != md5Str) + { + md5Pos = md5Str; + MesWorkForm.SendMsg(payload);//FANUC机床的轴位置 + } + + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () { + while (isRun) + { + try + { + + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = $"ROBOT_FANUC_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + //Joints[0].Value = j[0].ToString(); + //Joints[1].Value = j[1].ToString(); + //Joints[2].Value = j[2].ToString(); + //Joints[3].Value = j[3].ToString(); + //Joints[4].Value = j[4].ToString(); + //Joints[5].Value = j[5].ToString(); + //Joints[6].Value = j[6].ToString(); + + var payload = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(payload);//FANUC机床的轴位置 + + UpdateDataToSql(); + } + catch (Exception err) { } + Thread.Sleep(intervalUpdate); + } + })) + { IsBackground = true }.Start(); + + } + + public void TimelyUpdate() + { + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + } + + + + ~B_Robot_Fanuc() + { + FanucClose(); + } + /// + /// + /// + /// + /// + public void FanucClose() + { + isRun = false; + Thread.Sleep(199); + fanuc?.ConnectClose(); + + } + + /// + /// + /// + /// + /// + /// + private void ReConnRobot() + { + if (MesWorkForm.IsDemoMesServer == 1) + { + fanuc = new FanucInterfaceNet(); + return; + } + + if (fanuc != null) + { + fanuc?.ConnectClose(); + } + fanuc = new FanucInterfaceNet(); + fanuc.IpAddress = ip; + fanuc.Port = port; + var connect = fanuc.ConnectServer(); + if (connect.IsSuccess) + { + } + + } + public void DisConn() + { + if (fanuc != null) + { + fanuc?.ConnectClose(); + } + } + + /// + /// + /// + /// + /// + private double[] ReadResult_To_Array(string readResult) + { + if (MesWorkForm.IsDemoMesServer == 1) + { + return jDemo; + } + + double[] joint = new double[12]; + + var recdata = readResult; + var jsc = ((JObject)JsonConvert.DeserializeObject(recdata))["Joint"]; + joint[0] = Convert.ToDouble(jsc[0]); + joint[1] = Convert.ToDouble(jsc[1]); + joint[2] = Convert.ToDouble(jsc[2]); + joint[3] = Convert.ToDouble(jsc[3]); + joint[4] = Convert.ToDouble(jsc[4]); + joint[5] = Convert.ToDouble(jsc[5]); + joint[6] = Convert.ToDouble(jsc[6]); + joint[7] = Convert.ToDouble(jsc[7]); + joint[8] = Convert.ToDouble(jsc[8]); + + joint[9] = Convert.ToDouble(0); + joint[10] = Convert.ToDouble(0); + joint[11] = Convert.ToDouble(0); + + joint = new double[] + { + //Math.Round(Convert.ToDouble(joint[0])*Math.PI/180,4), + //Math.Round(Convert.ToDouble(joint[1])*Math.PI/180,4), + //Math.Round(( Convert.ToDouble(joint[2])+ Convert.ToDouble(joint[1]))*Math.PI/180 ,4), + //Math.Round(Convert.ToDouble(joint[3])*Math.PI/180,4), + //Math.Round(Convert.ToDouble(joint[4])*Math.PI/180,4), + //Math.Round(Convert.ToDouble(joint[5])*Math.PI/180,4), + //Convert.ToDouble(joint[6])/1000, + //Convert.ToDouble(joint[7])/1000, + //Convert.ToDouble(joint[8])/1000 + + Math.Round(Convert.ToDouble(joint[0]),2), + Math.Round(Convert.ToDouble(joint[1]),2), + Math.Round((Convert.ToDouble(joint[2])+ Convert.ToDouble(joint[1])) ,2), + Math.Round(Convert.ToDouble(joint[3]),2), + Math.Round(Convert.ToDouble(joint[4]),2), + Math.Round(Convert.ToDouble(joint[5]),2), + Convert.ToDouble(joint[6])/1000, + Convert.ToDouble(joint[7])/1000, + Convert.ToDouble(joint[8])/1000, + Convert.ToDouble(joint[9]), + Convert.ToDouble(joint[10]), + Convert.ToDouble(joint[11]) + }; + + + return joint; + } + + + + + /// + /// 读取数据 + /// + /// + /// + public string Read_Welding(string addr) + { + string str = "-1"; + //if (kuka != null) + //{ + // var r = kuka.ReadString(addr); + // if (r.IsSuccess) + // { + // str = r.Content; + // } + //} + + return str; + } + + /// + /// 手动测试读取 + /// + /// + /// + /// + public string ReadTest(string robotName) + { + return "【" + robotName + "】" + MesWorkForm.Move_Joint(Joints); + } + + public void UpdateDataToSql() + { + StoredProcedure("Event_Robot_Update"); + } + private void StoredProcedure(string pName) + { + //var sqlParameter = new SqlParameter[] { + // new SqlParameter("@DeviceCode", DeviceCode), + // new SqlParameter("@Online", OnLine), + // new SqlParameter("@StationName", OpName), + // new SqlParameter("@SlaveAddr", $"{ip}:{port}"), + + // new SqlParameter("@Joint1", j[0]), + // new SqlParameter("@Joint2", j[1]), + // new SqlParameter("@Joint3", j[2]), + + // new SqlParameter("@Joint4", j[3]), + // new SqlParameter("@Joint5", j[4]), + // new SqlParameter("@Joint6", j[5]), + + // new SqlParameter("@Joint7", j[6]), + // new SqlParameter("@Joint8", j[7]), + // new SqlParameter("@Joint9", j[8]), + + // new SqlParameter("@Joint10",j[9]), + // new SqlParameter("@Joint11",j[10]), + // new SqlParameter("@Joint12",j[11]), + // new SqlParameter("@Clamp", welding) + // }; + //MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + //{ + // procedureName = pName, + // sqlParameter = sqlParameter + //}); + } + + + + + } +} diff --git a/DT_SCADA/Core/B_Robot_Kuka.cs b/DT_SCADA/Core/B_Robot_Kuka.cs new file mode 100644 index 0000000..b42a8f5 --- /dev/null +++ b/DT_SCADA/Core/B_Robot_Kuka.cs @@ -0,0 +1,386 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Text.RegularExpressions; +using System.Threading; +using System.Windows.Forms; +using System.Collections.Generic; +using Newtonsoft.Json; +using HslCommunication.Robot.FANUC; +using HslCommunication.Robot.KUKA; + +namespace MesWork +{ + public partial class Temp { } + public partial class B_Robot_Kuka + { + /// + /// + /// + private KukaAvarProxyNet kuka = null; + /// + /// + /// + public bool OnLine = false; + /// + /// + /// + private string ip = "-1"; + /// + /// + /// + private int port = -1; + /// + /// + /// + private int interval = -1; + /// + /// + /// + private bool isRun = true; + /// + /// + /// + private string cmd = ""; + /// + /// + /// + private string cmd_Welding = ""; + /// + /// + /// + string sendV_Temp = "-1"; + /// + /// + /// + public double[] j = new double[12]; + /// + /// + /// + public double[] jDemo = new double[12]; + /// + /// 记录老值 + /// + string axis_act_Old = "-1"; + /// + /// 焊接中 + /// + int welding = 0; + /// + /// + /// + public string Id = "-1"; + /// + /// + /// + string Name = ""; + /// + /// + /// + public List Joints = null; + /// + /// + /// + public string md5Pos = ""; + + + /// + /// + /// + public B_Robot_Kuka() + { + + } + + + /// + /// + /// + /// + /// + /// + /// + /// + public void Start(string ip, int port,int interval, int intervalUpdate, string cmd, string cmd_Welding, string DeviceCode, string OpName, List Joints) + { + this.ip = ip; + this.port = port; + this.interval = interval; + this.cmd = cmd; + this.cmd_Welding = cmd_Welding; + this.Id = DeviceCode; + this.Name = OpName; + this.Joints = Joints; + + new Thread(new ThreadStart(delegate () + { + while (isRun) + { + try + { + //var weldingStr = Read_Welding(cmd_Welding); + //switch (weldingStr.ToLower()) + //{ + // case "1": + // case "true": + // welding = 1; + // break; + // default: + // welding = 0; + // break; + //} + + if (kuka == null) + { + ReConnRobot(); + } + var r = kuka.ReadString(cmd); + OnLine = r.IsSuccess; + if (OnLine) + { + j = ReadResult_To_Array(r.Content); + } + else + { + Thread.Sleep(10 * 1000); + ReConnRobot(); + continue; + } + for (int i = 0; i < Joints.Count ; i++) + { + Joints[i].DeviceCode = $"ROBOT_KUKA_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + //Joints[0].Value = j[0].ToString(); + //Joints[1].Value = j[1].ToString(); + //Joints[2].Value = j[2].ToString(); + //Joints[3].Value = j[3].ToString(); + //Joints[4].Value = j[4].ToString(); + //Joints[5].Value = j[5].ToString(); + //Joints[6].Value = j[6].ToString(); + + var payload = MesWorkForm.Move_Joint(Joints); + var md5Str = JsonConvert.SerializeObject(payload); + if (md5Pos != md5Str) + { + md5Pos = md5Str; + MesWorkForm.SendMsg(payload); + } + + } + catch (Exception err) { } + Thread.Sleep(interval); + } + })) + { IsBackground = true }.Start(); + + new Thread(new ThreadStart(delegate () { + while (isRun) + { + try + { + for (int i = 0; i < Joints.Count; i++) + { + Joints[i].DeviceCode = $"ROBOT_KUKA_{ip.Split('.')[3]}"; + Joints[i].Value = j[i].ToString(); + } + //Joints[0].Value = j[0].ToString(); + //Joints[1].Value = j[1].ToString(); + //Joints[2].Value = j[2].ToString(); + //Joints[3].Value = j[3].ToString(); + //Joints[4].Value = j[4].ToString(); + //Joints[5].Value = j[5].ToString(); + //Joints[6].Value = j[6].ToString(); + + var payload = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(payload);//FANUC机床的轴位置 + + UpdateDataToSql(); + } + catch (Exception err) + { } + Thread.Sleep(intervalUpdate); + } + })) + { IsBackground = true }.Start(); + + } + + public void TimelyUpdate() + { + var sendStr = MesWorkForm.Move_Joint(Joints); + MesWorkForm.SendMsg(sendStr); + } + + + + ~B_Robot_Kuka() + { + DisConn(); + } + /// + /// + /// + /// + /// + public void DisConn() + { + isRun = false; + Thread.Sleep(199); + kuka?.ConnectClose(); + + } + + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ReConnRobot() + { + if (MesWorkForm.IsDemoMesServer == 1) + { + kuka = new KukaAvarProxyNet(); + return; + } + + if (kuka != null) + { + kuka?.ConnectClose(); + } + kuka = new KukaAvarProxyNet(); + kuka.IpAddress = ip; + kuka.Port = port; + var connect = kuka.ConnectServer(); + if (connect.IsSuccess) + { + } + + } + + /// + /// + /// + /// + /// + private double[] ReadResult_To_Array(string readResult) + { + //string readResult = "{E6AXIS: A1 -12.03, A2 -97.15, A3 116.47, A4 -30.16, A5 -23.85, A6 27.48, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0}"; + + if (MesWorkForm.IsDemoMesServer == 1) + { + return jDemo; + } + + var axis_act = readResult; + + double[] joint = new double[12]; + + if (axis_act == "-1") + { + axis_act = axis_act_Old; + } + else + { + //axis_act = Regex.Split(axis_act, ", E4", RegexOptions.IgnoreCase)[0]; + axis_act = Regex.Split(axis_act, "}", RegexOptions.IgnoreCase)[0]; + axis_act = axis_act.Replace("{E6AXIS: A1 ", "").Replace(", A2 ", "&").Replace(", A3 ", "&").Replace(", A4 ", "&").Replace(", A5 ", "&").Replace(", A6 ", "&") + .Replace(", E1 ", "&").Replace(", E2 ", "&").Replace(", E3 ", "&").Replace(", E4 ", "&").Replace(", E5 ", "&").Replace(", E6 ", "&"); + axis_act_Old = axis_act; + } + + string[] jStr = axis_act.Split('&'); + + for (int i = 0; i < jStr.Length; i++) + { + joint[i] = Math.Round(Convert.ToDouble(jStr[i]), 2); + //joint[i] = Convert.ToDouble(jStr[i]); + //if (i == 6 | i == 7 | i == 8 | i == 9 | i == 10 | i == 11) + // joint[i] = Math.Round(joint[i] / 1000.0, 2); + //else + // joint[i] = Math.Round(joint[i] * Math.PI / 180, 2); + } + + return joint; + } + + + /// + /// 读取数据 + /// + /// + /// + public string Read_Welding(string addr) + { + string str = "-1"; + //if (kuka != null) + //{ + // var r = kuka.ReadString(addr); + // if (r.IsSuccess) + // { + // str = r.Content; + // } + //} + + return str; + } + + /// + /// 手动测试读取 + /// + /// + /// + /// + public string ReadTest(string robotName) + { + return "【" + robotName + "】" + MesWorkForm.Move_Joint(Joints); + } + + public void UpdateDataToSql() + { + StoredProcedure("Event_Robot_Update"); + } + private void StoredProcedure(string pName) + { + //var sqlParameter = new SqlParameter[] { + // new SqlParameter("@DeviceCode", DeviceCode), + // new SqlParameter("@Online", OnLine), + // new SqlParameter("@StationName", OpName), + // new SqlParameter("@SlaveAddr", $"{ip}:{port}"), + + // new SqlParameter("@Joint1", j[0]), + // new SqlParameter("@Joint2", j[1]), + // new SqlParameter("@Joint3", j[2]), + + // new SqlParameter("@Joint4", j[3]), + // new SqlParameter("@Joint5", j[4]), + // new SqlParameter("@Joint6", j[5]), + + // new SqlParameter("@Joint7", j[6]), + // new SqlParameter("@Joint8", j[7]), + // new SqlParameter("@Joint9", j[8]), + + // new SqlParameter("@Joint10",j[9]), + // new SqlParameter("@Joint11",j[10]), + // new SqlParameter("@Joint12",j[11]), + // new SqlParameter("@Clamp", welding) + // }; + //MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT + //{ + // procedureName = pName, + // sqlParameter = sqlParameter + //}); + } + + + + } +} diff --git a/DT_SCADA/Core/ElectricEnergyMeter.cs b/DT_SCADA/Core/ElectricEnergyMeter.cs new file mode 100644 index 0000000..d14c481 --- /dev/null +++ b/DT_SCADA/Core/ElectricEnergyMeter.cs @@ -0,0 +1,780 @@ +//using ConLink.ModBus; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using static ConLink.BasicFramework.SoftBasic; +//using System.Threading; +//using System.Threading.Tasks; +//using System.Data.SqlClient; + +///// +///// +///// +//namespace MesWork + + + +///* +// public float Ua = 0f; +// public float Ub = 0f; +// public float Uc = 0f; +// public float Uab = 0f; +// public float Ubc = 0f; +// public float Uca = 0f; +// public float Ia = 0f; +// public float Ib = 0f; +// public float Ic = 0f; +// public float Pa = 0f; +// public float Pb = 0f; +// public float Pc = 0f; +// public float P = 0f; +// public float Qa = 0f; +// public float Qb = 0f; +// public float Qc = 0f; +// public float Q = 0f; +// public float Sa = 0f; +// public float Sb = 0f; +// public float Sc = 0f; +// public float S = 0f; +// public float PFa = 0f; +// public float PFb = 0f; +// public float PFc = 0f; +// public float PF = 0f; +// public float FR = 0f; +// public float Ep1 = 0f; +// public float Ep2 = 0f; +// public float Eq1 = 0f; +// public float Eq2 = 0f; +// */ + + + +///* +// @Ua REAL = 0, +// @Ub REAL = 0, +// @Uc REAL = 0, +// @Uab REAL = 0, +// @Ubc REAL = 0, +// @Uca REAL = 0, +// @Ia REAL = 0, +// @Ib REAL = 0, +// @Ic REAL = 0, +// @Pa REAL = 0, +// @Pb REAL = 0, +// @Pc REAL = 0, +// @P REAL = 0, +// @Qa REAL = 0, +// @Qb REAL = 0, +// @Qc REAL = 0, +// @Q REAL = 0, +// @Sa REAL = 0, +// @Sb REAL = 0, +// @Sc REAL = 0, +// @S REAL = 0, +// @PFa REAL = 0, +// @PFb REAL = 0, +// @PFc REAL = 0, +// @PF REAL = 0, +// @FR REAL = 0, +// @Ep1 REAL = 0, +// @Ep2 REAL = 0, +// @Eq1 REAL = 0, +// @Eq2 REAL = 0 +// */ +//{ +// /// +// /// +// /// +// public class ElectricEnergyMeter +// { +// /// +// /// +// /// +// private string ip = ""; +// /// +// /// +// /// +// private int port = 0; +// /// +// /// / +// /// +// private byte station = 0; +// /// +// /// +// /// +// private string opName = ""; +// /// +// /// +// /// +// private int intervalRead = 1 * 1000; +// /// +// /// +// /// +// private int intervalUpdate = 5 * 1000; +// /// +// /// +// /// +// private int intervalInsert = 10 * 1000; +// /// +// /// +// /// +// private ModbusTcpNet mbt = null; +// /// +// /// +// /// +// private Thread tt = null; +// /// +// /// +// /// +// private Thread ttt = null; +// /// +// /// +// /// +// private Thread tttt = null; +// /// +// /// +// /// +// private string message = "00 00 00 00 00 06 01 03 00 00 00 3C"; +// /// +// /// +// /// +// private int offset = 18; +// /// +// /// +// /// +// private int index = 0; +// /// +// /// +// /// +// public float Ua = 0f; +// /// +// /// +// /// +// public float Ub = 0f; +// /// +// /// +// /// +// public float Uc = 0f; +// /// +// /// +// /// +// public float Uab = 0f; +// /// +// /// +// /// +// public float Ubc = 0f; +// /// +// /// +// /// +// public float Uca = 0f; +// /// +// /// +// /// +// public float Ia = 0f; +// /// +// /// +// /// +// public float Ib = 0f; +// /// +// /// +// /// +// public float Ic = 0f; +// /// +// /// +// /// +// public float Pa = 0f; +// /// +// /// +// /// +// public float Pb = 0f; +// /// +// /// +// /// +// public float Pc = 0f; +// /// +// /// +// /// +// public float P = 0f; +// /// +// /// +// /// +// public float Qa = 0f; +// /// +// /// +// /// +// public float Qb = 0f; +// /// +// /// +// /// +// public float Qc = 0f; +// /// +// /// +// /// +// public float Q = 0f; +// /// +// /// +// /// +// public float Sa = 0f; +// /// +// /// +// /// +// public float Sb = 0f; +// /// +// /// +// /// +// public float Sc = 0f; +// /// +// /// +// /// +// public float S = 0f; +// /// +// /// +// /// +// public float PFa = 0f; +// /// +// /// +// /// +// public float PFb = 0f; +// /// +// /// +// /// +// public float PFc = 0f; +// /// +// /// +// /// +// public float PF = 0f; +// /// +// /// +// /// +// public float FR = 0f; +// /// +// /// +// /// +// public float Ep1 = 0f; +// /// +// /// +// /// +// public float Ep2 = 0f; +// /// +// /// +// /// +// public float Eq1 = 0f; +// /// +// /// +// /// +// public float Eq2 = 0f; + +// /// +// /// +// /// + +// public void Start(string ip,int port,byte station,string opName,int intervalRead +// , int intervalUpdate ,int intervalInsert) +// { +// this.ip = ip; +// this.port = port; +// this.station = station; +// this.opName = opName; +// this.intervalRead = intervalRead; +// this.intervalUpdate = intervalUpdate; +// this.intervalInsert = intervalInsert; + +// mbt = new ModbusTcpNet(ip, port, station); +// mbt.AddressStartWithZero = true ; + +// mbt.SetLoginAccount("",""); + +// mbt.DataFormat = ConLink.Core.DataFormat.ABCD; +// mbt.IsStringReverse = false; + +// var s = mbt.ConnectServer(); +// var dfg = s.IsSuccess; + +// tt = new Thread(new ThreadStart(Read)); +// tt.IsBackground = true; +// tt.Start(); + +// ttt = new Thread(new ThreadStart(Update)); +// ttt.IsBackground = true; +// ttt.Start(); + +// tttt = new Thread(new ThreadStart(Insert)); +// tttt.IsBackground = true; +// tttt.Start(); + + +// } + + +// /// +// /// +// /// +// private void Read() +// { +// while (true) +// { +// try +// { +// var read = mbt.ReadFromCoreServer(HexStringToBytes(this.message)); +// if (read.IsSuccess) +// { +// var rc = read.Content; +// var str = ByteToHexString(rc); +// //str = "00000000001B010318199A435C199A435C199A435C199A435C199A435C199A435C"; +// index = 0; +// Ua = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4,4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 1; +// Ub = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 2; +// Uc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 3; +// Uab = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 4; +// Ubc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 5; +// Uca = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + + +// index = 6; +// Ia = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 7; +// Ib = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 8; +// Ic = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + + +// index = 9; +// Pa = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 10; +// Pb = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 11; +// Pc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 12; +// P = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + +// index = 13; +// Qa = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 14; +// Qb = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 15; +// Qc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 16; +// Q = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + +// index = 17; +// Sa = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 18; +// Sb = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 19; +// Sc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 20; +// S = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + + +// index = 21; +// PFa = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 22; +// PFb = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 23; +// PFc = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 24; +// PF = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + + + +// index = 25; +// FR = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + +// index = 26; +// Ep1 = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); +// index = 27; +// Ep2 = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + + +// index = 28; +// Eq1 = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + +// index = 29; +// Eq2 = BitConverter.ToSingle(BitConverter.GetBytes(Convert.ToUInt32( +// str.Substring(offset + index * 8 + 4, 4) + str.Substring(offset + index * 8 + 0, 4) +// , 16)), 0); + +// } +// else +// { +// Thread.Sleep(this.intervalRead * 3); +// } +// } +// catch (Exception err) +// { + +// } +// Thread.Sleep(this.intervalRead); +// } +// } + +// /// +// /// +// /// +// private void Update() +// { +// while (true) +// { +// try +// { +// ExecUpdate(); +// } +// catch (Exception err) +// { + +// } +// Thread.Sleep(this.intervalUpdate); + +// } +// } +// /// +// /// +// /// +// private void Insert() +// { +// while (true) +// { +// try +// { +// ExecInsert(); +// } +// catch (Exception err) +// { + +// } +// Thread.Sleep(this.intervalInsert); + +// } +// } + + +// /// +// /// +// /// +// private void ExecUpdate() +// { +// /* +// public float Ua = 0f; +// public float Ub = 0f; +// public float Uc = 0f; +// public float Uab = 0f; +// public float Ubc = 0f; +// public float Uca = 0f; +// public float Ia = 0f; +// public float Ib = 0f; +// public float Ic = 0f; +// public float Pa = 0f; +// public float Pb = 0f; +// public float Pc = 0f; +// public float P = 0f; +// public float Qa = 0f; +// public float Qb = 0f; +// public float Qc = 0f; +// public float Q = 0f; +// public float Sa = 0f; +// public float Sb = 0f; +// public float Sc = 0f; +// public float S = 0f; +// public float PFa = 0f; +// public float PFb = 0f; +// public float PFc = 0f; +// public float PF = 0f; +// public float FR = 0f; +// public float Ep1 = 0f; +// public float Ep2 = 0f; +// public float Eq1 = 0f; +// public float Eq2 = 0f; +// */ + + +// UpdateCurr(); + + +// } + +// /// +// /// +// /// +// private void ExecInsert() +// { +// /* +// public float Ua = 0f; +// public float Ub = 0f; +// public float Uc = 0f; +// public float Uab = 0f; +// public float Ubc = 0f; +// public float Uca = 0f; +// public float Ia = 0f; +// public float Ib = 0f; +// public float Ic = 0f; +// public float Pa = 0f; +// public float Pb = 0f; +// public float Pc = 0f; +// public float P = 0f; +// public float Qa = 0f; +// public float Qb = 0f; +// public float Qc = 0f; +// public float Q = 0f; +// public float Sa = 0f; +// public float Sb = 0f; +// public float Sc = 0f; +// public float S = 0f; +// public float PFa = 0f; +// public float PFb = 0f; +// public float PFc = 0f; +// public float PF = 0f; +// public float FR = 0f; +// public float Ep1 = 0f; +// public float Ep2 = 0f; +// public float Eq1 = 0f; +// public float Eq2 = 0f; +// */ + + +// InsertHis(); +// } + + + + +// private bool UpdateCurr() +// { +// /* +// public float Ua = 0f; +// public float Ub = 0f; +// public float Uc = 0f; +// public float Uab = 0f; +// public float Ubc = 0f; +// public float Uca = 0f; +// public float Ia = 0f; +// public float Ib = 0f; +// public float Ic = 0f; +// public float Pa = 0f; +// public float Pb = 0f; +// public float Pc = 0f; +// public float P = 0f; +// public float Qa = 0f; +// public float Qb = 0f; +// public float Qc = 0f; +// public float Q = 0f; +// public float Sa = 0f; +// public float Sb = 0f; +// public float Sc = 0f; +// public float S = 0f; +// public float PFa = 0f; +// public float PFb = 0f; +// public float PFc = 0f; +// public float PF = 0f; +// public float FR = 0f; +// public float Ep1 = 0f; +// public float Ep2 = 0f; +// public float Eq1 = 0f; +// public float Eq2 = 0f; +// */ + +// var sqlParameter = new SqlParameter[] { +// new SqlParameter("@StationName", opName), +// new SqlParameter("@SlaveAddr", ip), + +// new SqlParameter("@Ua", Ua), +// new SqlParameter("@Ub", Ub), +// new SqlParameter("@Uc", Uc), + +// new SqlParameter("@Uab", Ua), +// new SqlParameter("@Ubc", Ub), +// new SqlParameter("@Uca", Uc), + +// new SqlParameter("@Ia", Ia), +// new SqlParameter("@Ib", Ib), +// new SqlParameter("@Ic", Ic), + +// new SqlParameter("@Pa", Pa), +// new SqlParameter("@Pb", Pb), +// new SqlParameter("@Pc", Pc), +// new SqlParameter("@P", Pa), + +// new SqlParameter("@Qa", Qa), +// new SqlParameter("@Qb", Qb), +// new SqlParameter("@Qc", Qc), +// new SqlParameter("@Q", Q), + +// new SqlParameter("@Sa", Sa), +// new SqlParameter("@Sb", Sb), +// new SqlParameter("@Sc", Sc), +// new SqlParameter("@S", S), + +// new SqlParameter("@PFa", PFa), +// new SqlParameter("@PFb", PFb), +// new SqlParameter("@PFc", PFc), +// new SqlParameter("@PF", PF), + +// new SqlParameter("@FR", FR), + +// new SqlParameter("@Ep1", Ep1), +// new SqlParameter("@Ep2", Ep2), + +// new SqlParameter("@Eq1", Eq1), +// new SqlParameter("@Eq2", Eq2) + +// }; +// return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("Event_Meter_Update",MesWorkForm.ConnectionString, ref sqlParameter, out string errorMessage); + +// } +// private bool InsertHis() +// { +// /* +// public float Ua = 0f; +// public float Ub = 0f; +// public float Uc = 0f; +// public float Uab = 0f; +// public float Ubc = 0f; +// public float Uca = 0f; +// public float Ia = 0f; +// public float Ib = 0f; +// public float Ic = 0f; +// public float Pa = 0f; +// public float Pb = 0f; +// public float Pc = 0f; +// public float P = 0f; +// public float Qa = 0f; +// public float Qb = 0f; +// public float Qc = 0f; +// public float Q = 0f; +// public float Sa = 0f; +// public float Sb = 0f; +// public float Sc = 0f; +// public float S = 0f; +// public float PFa = 0f; +// public float PFb = 0f; +// public float PFc = 0f; +// public float PF = 0f; +// public float FR = 0f; +// public float Ep1 = 0f; +// public float Ep2 = 0f; +// public float Eq1 = 0f; +// public float Eq2 = 0f; +// */ + +// var sqlParameter = new SqlParameter[] { +// new SqlParameter("@StationName", opName), +// new SqlParameter("@SlaveAddr", ip), + +// new SqlParameter("@Ua", Ua), +// new SqlParameter("@Ub", Ub), +// new SqlParameter("@Uc", Uc), + +// new SqlParameter("@Uab", Ua), +// new SqlParameter("@Ubc", Ub), +// new SqlParameter("@Uca", Uc), + +// new SqlParameter("@Ia", Ia), +// new SqlParameter("@Ib", Ib), +// new SqlParameter("@Ic", Ic), + +// new SqlParameter("@Pa", Pa), +// new SqlParameter("@Pb", Pb), +// new SqlParameter("@Pc", Pc), +// new SqlParameter("@P", Pa), + +// new SqlParameter("@Qa", Qa), +// new SqlParameter("@Qb", Qb), +// new SqlParameter("@Qc", Qc), +// new SqlParameter("@Q", Q), + +// new SqlParameter("@Sa", Sa), +// new SqlParameter("@Sb", Sb), +// new SqlParameter("@Sc", Sc), +// new SqlParameter("@S", S), + +// new SqlParameter("@PFa", PFa), +// new SqlParameter("@PFb", PFb), +// new SqlParameter("@PFc", PFc), +// new SqlParameter("@PF", PF), + +// new SqlParameter("@FR", FR), + +// new SqlParameter("@Ep1", Ep1), +// new SqlParameter("@Ep2", Ep2), + +// new SqlParameter("@Eq1", Eq1), +// new SqlParameter("@Eq2", Eq2) + +// }; +// return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("Event_Meter_Insert", MesWorkForm.ConnectionString, ref sqlParameter, out string errorMessage); + +// } + + + + +// } +//} diff --git a/DT_SCADA/Core/ExecSqlServer.cs b/DT_SCADA/Core/ExecSqlServer.cs new file mode 100644 index 0000000..cc38749 --- /dev/null +++ b/DT_SCADA/Core/ExecSqlServer.cs @@ -0,0 +1,28 @@ +using MesWork; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NJ_ZC +{ + + public class ParamT + { + public string procedureName + { + get; + set; + } = ""; + + public SqlParameter[] sqlParameter + { + get; + set; + } + } + + +} diff --git a/DT_SCADA/Core/Load.cs b/DT_SCADA/Core/Load.cs new file mode 100644 index 0000000..370a7a3 --- /dev/null +++ b/DT_SCADA/Core/Load.cs @@ -0,0 +1,154 @@ +using NJ_ZC; +using NPOI.SS.Formula.Functions; +using OpcBasic; +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Threading; +using System.Windows.Forms; +using SystemFramework; + +namespace MesWork +{ + public partial class Temp { } + /// + /// + /// + public partial class MesWorkForm + { + /// + /// + /// + /// + private void LoadDevice(ScadaConfig appConfig) + { + foreach (var mu in appConfig.MachineTool) + { + var Enable = mu.Enable; + var Type = mu.Type; + var ConnectStr = mu.ConnectStr; + var Id = mu.Id; + var Name = mu.Name; + var DataTimeInterval = Convert.ToInt32(mu.DataTimeInterval); + var AxesTimeInterval = Convert.ToInt32(mu.AxesTimeInterval); + var Joints = mu.Joints; + + var TagID_Clamp = mu.TagID_Clamp; + + + var IP = ""; + var Port = 0; + + if (Enable == "1") + { + switch (Type.ToUpper()) + { + case "ROBOTFANUC": + { + if (!ConnectStr.Contains(":")) + { + MessageBox.Show("JsonļУConnectStr ֵʽ"); + Process.GetCurrentProcess().Kill(); + } + IP = ConnectStr.Split(':')[0]; + Port = Convert.ToInt32(ConnectStr.Split(':')[1]); + var fanuc = new B_Robot_Fanuc(); + fanuc.Start(IP, Port, AxesTimeInterval, DataTimeInterval, "CurrentPose", "", Id, Name, Joints); + dc_Robot.Add($"{Type}|{Id}", fanuc); + } + break; + case "ROBOTKUKA": + { + if (!ConnectStr.Contains(":")) + { + MessageBox.Show("JsonļУConnectStr ֵʽ"); + Process.GetCurrentProcess().Kill(); + } + IP = ConnectStr.Split(':')[0]; + Port = Convert.ToInt32(ConnectStr.Split(':')[1]); + var kuka = new B_Robot_Kuka(); + kuka.Start(IP, Port, AxesTimeInterval, DataTimeInterval, "$axis_act", "$OUT[8]", Id, Name, Joints); + dc_Robot.Add($"{Type}|{Id}", kuka); + } + break; + case "ROBOTABB": + { + if (!ConnectStr.Contains(":")) + { + MessageBox.Show("JsonļУConnectStr ֵʽ"); + Process.GetCurrentProcess().Kill(); + } + IP = ConnectStr.Split(':')[0]; + var cname = ConnectStr.Split(':')[1]; + var abb = new B_Robot_Abb(); + abb.Start(IP, cname, AxesTimeInterval, DataTimeInterval, Id, Name, Joints); + dc_Robot.Add($"{Type}|{Id}", abb); + } + break; + case "ROBOTEPSON": + { + if (!ConnectStr.Contains(":")) + { + MessageBox.Show("JsonļУConnectStr ֵʽ"); + Process.GetCurrentProcess().Kill(); + } + IP = ConnectStr.Split(':')[0]; + Port = Convert.ToInt32(ConnectStr.Split(':')[1]); + var espon = new B_Robot_Espon(); + espon.Start(IP, Port, AxesTimeInterval, DataTimeInterval, Id, Name, Joints, TagID_Clamp); + dc_Robot.Add($"{Type}|{Id}", espon); + } + break; + case "AXIS": + { + var b_Read_N_Axis = new B_Read_N_Axis(); + b_Read_N_Axis.Start(AxesTimeInterval, DataTimeInterval, ConnectStr, Joints, Id, Name); + dc_Name_Axis.Add($"{Type}|{Id}|{ConnectStr}", b_Read_N_Axis); + } + break; + case "AXIS_CARD": + { + var b_Read_N_AxisCard = new B_Read_N_AxisCard(); + b_Read_N_AxisCard.Start(AxesTimeInterval, DataTimeInterval, ConnectStr, Joints); + dc_Name_Axis_Card.Add($"{Type}|{Id}|{ConnectStr}", b_Read_N_AxisCard); + } + break; + case "AGV": + { + agvRead = new AgvRead(); + agvRead.Start(ConnectStr,AxesTimeInterval, DataTimeInterval, Id, Name); + } + break; + case "CNCEDM": + { + IP = ConnectStr.Split(':')[0]; + Port = Convert.ToInt32(ConnectStr.Split(':')[1]); + + var edm = new B_Cnc_Edm(); + edm.Start(IP, Port, AxesTimeInterval, DataTimeInterval, Id, Name, Joints); + + dc_Robot.Add($"{Type}|{Id}", edm); + } + break; + default: + break; + } + } + } + + + } + + + + + } +} + + + + diff --git a/DT_SCADA/Core/MW.DisConn.cs b/DT_SCADA/Core/MW.DisConn.cs new file mode 100644 index 0000000..537d7c5 --- /dev/null +++ b/DT_SCADA/Core/MW.DisConn.cs @@ -0,0 +1,53 @@ +using NJ_ZC; +using OpcBasic; +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Threading; +using System.Windows.Forms; +using SystemFramework; +using static System.Configuration.ConfigurationManager; + +namespace MesWork +{ + public partial class Temp { } + /// + /// + /// + public partial class MesWorkForm + { + + public void DisConnect() + { + try + { + foreach (var robot in new Dictionary(dc_Robot)) + { + var key = robot.Key; + var robotObj = robot.Value; + var type = key.Split('|')[0]; + var robotCode = key.Split('|')[1]; + switch (type) + { + case "FANUC": + ((B_Robot_Fanuc)robotObj).DisConn(); + break; + case "KUKA": + ((B_Robot_Kuka)robotObj).DisConn(); + break; + default: + break; + } + } + } + catch (Exception err){} + + } + + + } +} diff --git a/DT_SCADA/Core/MysqlClient.cs b/DT_SCADA/Core/MysqlClient.cs new file mode 100644 index 0000000..c6e88e6 --- /dev/null +++ b/DT_SCADA/Core/MysqlClient.cs @@ -0,0 +1,95 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + public class MysqlClient + { + + public static bool ExecQuerySQL(string sql, string ConnectStr, out string err) + { + // lock (losk1) { + bool success = false; + err = ""; + using (MySqlConnection conn = new MySqlConnection(ConnectStr)) + { + try + { + conn.Open(); + + MySqlCommand command = new MySqlCommand(sql, conn); + command.ExecuteNonQuery(); + success = true; + } + catch (Exception er) + { + err = er.Message; + } + finally + { + if (conn != null) + { + conn.Close(); + } + } + + } + + return success; + // } + + } + + + + public static bool ExecQueryDataTable(string sql, string ConnectStr,out DataTable dt, out string err) + { + bool success = false; + err = ""; + dt = null; + using (MySqlConnection conn = new MySqlConnection(ConnectStr)) + { + try + { + conn.Open(); + + MySqlCommand command = new MySqlCommand(sql, conn); + MySqlDataAdapter da = new MySqlDataAdapter(command); + DataSet ds = new DataSet(); + da.Fill(ds); + + if (ds.Tables.Count > 0) + { + dt = ds.Tables[0]; + } + success = true; + } + catch (Exception er) + { + err = er.Message; + } + finally + { + if (conn != null) + { + conn.Close(); + } + } + + } + + return success; + } + + + + + + + } +} diff --git a/DT_SCADA/Core/Remote.Receive.cs b/DT_SCADA/Core/Remote.Receive.cs new file mode 100644 index 0000000..f452b42 --- /dev/null +++ b/DT_SCADA/Core/Remote.Receive.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MesWork +{ + public partial class QingYa_OP0010 { } + public partial class MesWorkForm + { + /// + /// + /// + /// + public void LoadClientInfo(object _Msg) + { + try + { + string recStr = (string)_Msg; + string m_Source = recStr.Split('|')[0]; + string cmd = recStr.Split('|')[1]; + //string OpName = recStr.Split('|')[2]; + //string tagValue = recStr.Split('|')[3]; + + switch (m_Source) + { + case "DT": + switch (cmd) + { + case "B_C_DT_WebLoaded": + new TaskFactory().StartNew(delegate () { + try + { + var tagList = DriverCache["Cache_Tag"]; + foreach (var item in tagList) + { + var tf = (OpcBasic.TagFormat)item.Value; + var tagID = tf.TagID; + var tagValue = tf.TagValue.ToString(); + var tagTypeID = Convert.ToInt32(tf.TagTypeID); + var tagTypeCodeID = (int)tf.TagTypeCodeID; + var opName = tf.OpName.ToString(); + if (tagTypeID == 11) + { + switch (tagValue.ToUpper()) + { + case "1": + case "TRUE": + tagValue = "1"; + break; + default: + tagValue = "0"; + break; + } + } + + S_C_B_TagIDTrigger(opName,tagID, tagValue); + } + } + catch (Exception ew1) { } + //try + //{ + // var from_to_loc = agvRead.ReadAgv(); + // MesWorkForm.S_C_B_TagIDTrigger(agvRead.connectStr, agvRead.tagID, from_to_loc); + //} + //catch (Exception ew2) { } + }); + break; + } + break; + case "MES": + switch (cmd) + { + case "B_C_DT_WebLoaded": + //string OpName = recStr.Split('|')[2]; + //if (OpName == "AllOpName") + //{ + + // foreach (var fanucBaseNC in fanucBaseNCArray) + // { + // fanucBaseNC.SendDataReLoad(); + // } + + // return; + //} + //if (fanucBaseNCArray.FirstOrDefault(o => o.OpName == OpName) != null) { + // fanucBaseNCArray.FirstOrDefault(o => o.OpName == OpName).SendDataReLoad(); + //} + + // FanucBaseNC.SendStateDataFirst(); + + + + break; + default: + break; + } + break; + } + + } + catch (Exception err) { } + } + + + + + + } +} diff --git a/DT_SCADA/Core/Remote.Send.cs b/DT_SCADA/Core/Remote.Send.cs new file mode 100644 index 0000000..9a99a81 --- /dev/null +++ b/DT_SCADA/Core/Remote.Send.cs @@ -0,0 +1,275 @@ +using HslCommunication; +using HslCommunication.Core.Net; +using HslCommunication.Enthernet; +using MQTTnet; +using MQTTnet.Client.Connecting; +using MQTTnet.Client.Disconnecting; +using MQTTnet.Client.Options; +using MQTTnet.Client.Receiving; +using MQTTnet.Extensions.ManagedClient; +using MQTTnet.Formatter; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; + +/// +/// +/// +namespace MesWork +{ + /// + /// + /// + public partial class Temp { } + /// + /// + /// + public partial class MesWorkForm + { + /// + /// + /// + public static NetComplexClient complexClient = null; + /// + /// + /// + static private IManagedMqttClient mqttClient = null; + /// + /// + /// + string topic = ""; + /// + /// + /// + static bool OnLine_Mqtt = false; + /// + /// + /// + /// + /// + public async Task StartAsync(string uri) + { + var array = uri.Split(new char[] { ':', ',' }); + string mqttUser = array[2]; + string mqttPassword = ""; + var options = new MqttClientOptions + { + ClientId = $"{mqttUser}_{Guid.NewGuid().ToString()}", + ProtocolVersion = MqttProtocolVersion.V311, + ChannelOptions = new MqttClientTcpOptions { Server = array[0], Port = Convert.ToInt32(array[1]) }, + CleanSession = true, + KeepAlivePeriod = TimeSpan.FromSeconds(15), + Credentials = new MqttClientCredentials + { + Username = mqttUser, + Password = Encoding.UTF8.GetBytes(mqttPassword) + } + }; + mqttClient = new MqttFactory().CreateManagedMqttClient(); + mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected); + mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected); + mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived); + await mqttClient.StartAsync(new ManagedMqttClientOptions { ClientOptions = options }); + this.topic = array[2]; + await mqttClient.SubscribeAsync(new MqttTopicFilter { Topic = topic }); + + } + /// + /// + /// + /// + private void ClientConnection(string MesServer_IpPortName) + { + string serverIP = MesServer_IpPortName.Split(':')[0]; + string portString = MesServer_IpPortName.Split(':')[1].Split(',')[0]; + string opNameSocket = MesServer_IpPortName.Split(',')[1]; + + if (!IPAddress.TryParse(serverIP, out IPAddress address)) + { + return; + } + + if (!int.TryParse(portString, out int port)) + { + return; + } + + try + { + // 连接 connect + complexClient = new NetComplexClient(); + complexClient.ClientAlias = opNameSocket; + complexClient.EndPointServer = new IPEndPoint(address, port); + //complexClient.Token = new Guid(textBox3.Text); + complexClient.AcceptString += ComplexClient_AcceptString; + complexClient.MessageAlerts += ComplexClient_MessageAlerts; + complexClient.ClientStart(); + } + catch (Exception ex) + { + HslCommunication.BasicFramework.SoftBasic.ShowExceptionMessage(ex); + } + } + /// + /// + /// + /// + /// + /// + private static async Task Publish(string publish_topic, string publish_msg) + { + if (mqttClient != null) + { + await mqttClient.PublishAsync(new MqttApplicationMessageBuilder().WithTopic(publish_topic).WithPayload(publish_msg).WithAtMostOnceQoS().Build()); + } + } + /// + /// + /// + /// + private async Task DisConnectService() + { + if (mqttClient != null) + { + await mqttClient.UnsubscribeAsync(new string[] { topic }); + await mqttClient.StopAsync(); + } + } + + /// + /// + /// + /// + private void ComplexClient_MessageAlerts(string text) + { + //if (InvokeRequired) + //{ + // Invoke(new Action(ComplexClient_MessageAlerts), text); + // return; + //} + + } + /// + /// 连接完成 + /// + /// + private void OnSubscriberConnected(MqttClientConnectedEventArgs x) + { + OnLine_Mqtt = true; + // textBox1_robotData.Text += "连接完成" + "\r\n"; + var rec = x.AuthenticateResult.ResultCode.ToString(); + // label_State.Text = rec; + // textBox1_robotData.Text += rec + "\r\n"; + } + /// + /// 断开连接 + /// + /// + private void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x) + { + OnLine_Mqtt = false; + try + { + // textBox1_robotData.Text += "断开连接" + "\r\n"; + + var rec = x.ClientWasConnected.ToString(); + // textBox1_robotData.Text += rec + "\r\n"; + } + catch (Exception err) + { + // textBox1_robotData.Text += $"Message:{err.Message}\r\n\r\nStackTrace:{err.StackTrace}" + "\r\n"; + } + + } + /// + /// 接收信息 + /// + /// + private void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x) + { + var recStr = x.ApplicationMessage.ConvertPayloadToString(); + ThreadPool.QueueUserWorkItem(LoadClientInfo, recStr); + } + /// + /// 接收消息 + /// + /// + /// + /// + private void ComplexClient_AcceptString(AppSession arg1, NetHandle arg2, string arg3) + { + ThreadPool.QueueUserWorkItem(LoadClientInfo, (string)arg3); + } + + public static void SendMsg(string str) + { + try + { + switch (ConnectType) + { + case 1: + complexClient.Send(1, str); + break; + case 2: + //var s = $"{MqttTargetTopic}\\?"; + //var sendString = Regex.Split(str, s, RegexOptions.IgnoreCase); + //TOBS??SCADAMain?DT|C_B_JointMoveTo| + var topic = $"{str.Split('?')[2]}"; + var content = $"{str.Split('?')[3]}"; + Publish(topic, content); + break; + default: + break; + } + } + catch (Exception err) + { + } + + } + public static void SendMsg(string opName, string topic, string content) + { + try + { + switch (ConnectType) + { + case 1: + complexClient.Send(1, content); + break; + case 2: + Publish(topic + opName, content); + break; + default: + break; + } + } + catch (Exception err) + { + } + + } + + private void ConnectService() + { + switch (ConnectType) + { + case 1: + ClientConnection(IpPortSub); + break; + case 2: + var _task = StartAsync(IpPortSub); + break; + default: + break; + } + } + + + } +} diff --git a/DT_SCADA/Core/ScadaConfig.cs b/DT_SCADA/Core/ScadaConfig.cs new file mode 100644 index 0000000..760e7ea --- /dev/null +++ b/DT_SCADA/Core/ScadaConfig.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MesWork +{ + public class ToolInfo + { + public string Name { get; set; } + public string TimeRated { get; set; } + public string TimeUsed { get; set; } + } + + public class AxisInfo + { + public string AxisName { get; set; } + public string AxisValue { get; set; } + } + + public class ParameterInfo + { + public string ParameterName { get; set; } + public string ParameterValue { get; set; } + } + + public class AlarmInfo + { + public string AlarmCode { get; set; } = "83721"; + public string Alarm { get; set; } = "该吃饭了!"; + public string AlarmTime { get; set; } = DateTime.Now.ToString(); + } + public class TipInfo + { + public string TipCode { get; set; } = "1123"; + public string Tip { get; set; } = "该睡觉了!"; + public string TipTime { get; set; } = DateTime.Now.ToString(); + } + + public class DeviceInfo + { + public string order { get; set; } = ""; + public string Name { get; set; } = ""; + public string Id { get; set; } = ""; + public string Status { get; set; } = ""; + public string Program { get; set; } = ""; + public string Feed { get; set; } = ""; + public string Speed { get; set; } = ""; + public string Rapid { get; set; } = ""; + public string ProgramStatus { get; set; } = ""; + /// + /// 电流 + /// + public string Current { get; set; } = ""; + /// + /// 电压 + /// + public string Voltage { get; set; } = ""; + + public ToolInfo Tool { get; set; } = new ToolInfo(); + public List Axis { get; set; } = new List(); + + public List OtherParameter { get; set; } = new List(); + public List Alarm { get; set; } = new List(); + public List Tip { get; set; } = new List(); + + } + + public class JointConfig + { + public string DeviceCode { get; set; } + public string JointName { get; set; } + public string ModelCode { get; set; } + public string JointType { get; set; } + public string Axis { get; set; } + public string Flip { get; set; } + public string Value { get; set; } + public string ValueFactor { get; set; } + public string Delta { get; set; } + } + + public class MachineToolConfig + { + public string Enable { get; set; } + public string Type { get; set; } + public string ConnectStr { get; set; } + public string Id { get; set; } + public string Name { get; set; } + public string DataTimeInterval { get; set; } + public string AxesTimeInterval { get; set; } + public List Joints { get; set; } + public string TagID_Clamp { get; set; } + + } + + + + public class ScadaConfig + { + public List MachineTool { get; set; } + } +} diff --git a/DT_SCADA/Core/SendProtocol.cs b/DT_SCADA/Core/SendProtocol.cs new file mode 100644 index 0000000..866b429 --- /dev/null +++ b/DT_SCADA/Core/SendProtocol.cs @@ -0,0 +1,67 @@ +using Newtonsoft.Json; +using Opc.Ua; +using OpcBasic; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Threading; + +namespace MesWork +{ + public partial class Temp { } + public partial class MesWorkForm + { + + + /// + /// 01 + /// + /// + /// + /// + public static void S_C_B_TagIDTrigger(string opName, string tagID, string tagValue) + { + SendMsg(MesServer_SendProtocol_Tag + "{\"DeviceCode\":\"" + opName + "\",\"TagID\":\"" + tagID + "\",\"TagValue\":\"" + tagValue + "\"}"); + } + + /// + /// 02 + /// + /// + /// + public static string Move_Joint(List joints) + { + var sendStr = MesServer_SendProtocol_Joint + JsonConvert.SerializeObject(joints); + return sendStr; + } + + + /// + /// 11 + /// + /// + public static void S_C_B_Info_Fast(List tagValue) + { + SendMsg(MesServer_SendProtocol_Info_Fast + JsonConvert.SerializeObject(tagValue)); + } + + /// + /// 12 + /// + /// + public static void S_C_B_Info_Slow(Param_Slow tagValue) + { + SendMsg(MesServer_SendProtocol_Info_Slow + JsonConvert.SerializeObject(tagValue)); + } + + + public static string Make_DeviceInfo(List di) + { + var sendStr = MesServer_SendProtocol_DeviceInfo + JsonConvert.SerializeObject(di); + return sendStr; + } + + + } +} diff --git a/DT_SCADA/Core/TagTypeCodeID.cs b/DT_SCADA/Core/TagTypeCodeID.cs new file mode 100644 index 0000000..a10b044 --- /dev/null +++ b/DT_SCADA/Core/TagTypeCodeID.cs @@ -0,0 +1,466 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +///1 X WorkStart 2 工件到位(PLC) 工件到位。托盘到达工位,并且托盘上有工件。 +///2 X RepairPartStatusPLC 3 RepairPartStatusPLC 备用 +///3 STRING RepairPathString 4 RepairPathString "工位返修字符串(121211112222111),前2位是西门子字符串格式,第一位是总长度,第二位是实际长度" +///4 X EngineTypeGetOverMES 5 传递机型(MES) MES传递总成信息给PLC(上线工位) +///5 X PartPalletGoOver 6 PartPalletGoOver 上线工位。0:正常工作;1:空托盘放行,PLC读取到此标志不走申请上线逻辑。 +///6 X MaterialVerifyOver 7 MaterialVerifyOver MES保存完质量数据,物料数据等与PLC信号交互完成后通知PLC,所以工步都完成,才可以放行工件,正常工作时工件放行的必要条件。 +///7 X FalseGo 8 FalseGo 按MES界面[不合格放行]按钮,MES发送此信号。操作者判断工件不合格,通知设备,按不合格方式放行工件,工件流转到返修下线工位后,返修下线。MES工作完成MES0.3=1,MES合格放行MES0.5=0,MES0.4=1 +///8 INT EngineTypeID 9 EngineTypeID MES发动机机型标志(必须PLC) +///9 STRING EngineID 10 EngineID MES发动机编号(必须PLC) +///10 STRING EngineType 11 机型(MES) MES发动机机型(必须PLC) +///11 X PartPalletStatus 13 PartPalletStatus MES激发变量托盘到位离开(必须PLC) +///12 X HeartBeatPLC 14 HeartBeatPLC 心跳处理:PLC收到MES心跳信号后,PLC延时5秒后,数值取反再写回PLC,写回PLC开始计时,如果5秒钟MES无反馈报通讯故障。 +///13 X HeartBeatMIS 15 HeartBeatMIS 间隔时间5S,心跳处理。收到PLC心跳信号后,MES按原值回写。PLC收到MES信号后延时5秒,取反写入,以此循环。 +///14 X TargetTimeRead 16 TargetTimeRead MES允许可读工位运行时间 +///15 Int MachineTargetTime 17 MachineTargetTime 目标运行时间 +///16 Int MachineActualTime 18 MachineActualTime 实际运行时间 +///17 X MesRead 19 允许保存(PLC) 质量数据可以读数据 +///18 X MesReadOver 20 保存完成(MES) MES保存完数据(必须MIS) +///19 INT QualityMask 21 合格标志(PLC) 质量数据工位合格标志0:没有工作;1:合格 ;2 :不合格(必须PLC) +///20 B PalletInfo 22 PalletInfo 0空托盘,1合格件,2不合格件 +///21 INT RepairStatusPLC 23 RepairStatusPLC 0正常件,1返修件 +///22 INT OrderNo 24 订单号(MES) 订单号(MES) +///23 X StorageNo 25 库位号(MES) 库位号(MES) +///24 X AllowPass 26 允许放行(MES) 允许放行 +///25 X PartLoadFinish 27 PartLoadFinish PartLoadFinish +///26 X Reserved_7 28 Reserved_7 备用 +///27 X Reserved_8 29 Reserved_8 备用 +///28 X Reserved_9 30 Reserved_9 备用 +///29 X Reserved_10 31 Reserved_10 备用 +///30 X Reserved_11 32 Reserved_11 备用 +///31 X Reserved_12 33 Reserved_12 备用 +///32 X Reserved_13 34 Reserved_13 备用 +///33 X Reserved_14 35 Reserved_14 备用 +///34 Int PLCSPareint1 36 PLCSPareint1 备用 +///35 Int PLCSPareint2 37 PLCSPareint2 备用 +///36 Int PLCSPareint3 38 PLCSPareint3 备用 +///37 STRING PLCSarestring1 39 PLCSarestring1 备用 +///38 STRING PLCSarestring2 40 PLCSarestring2 备用 +///39 STRING MarkID 42 MarkID 机体打标号(MES)前2位是西门子字符串格式,第一位是总长度,第二位是实际长度 +///40 X PartLoad 43 PartLoad 上线工位,PLC向MES申请总成编号。收到该信号后,MES将机型标志(DBB22 ~23)、总成号(DBB24 ~63)、总成机型DBB64 ~103写入PLC。之后MES通过信号“传递机型(DBX0.1)”通知PLC。 +///41 X EngineTypeGetOverPLC 44 传递机型(PLC) PLC将机型标志(DBB50…51)、工件编号(DBB52…101)、产品型号(DBB102…187)、托盘编号(DBB188…189)准备完毕后,通知MES。 +///42 X PartLoadOK 48 PartLoadOK 备用 +///43 X Reserved_18 49 Reserved_18 备用 +///44 X PalletDown 50 PalletDown 暂时保留,项目未使用 +///45 X ConfirmOkGo 51 ConfirmOkGo 按MES界面[合格放行]按钮,MES发送此信号。操作者判断工件合格,通知设备,工件按合格方式放行工件。MES工作完成MES0.3=1,MES合格放行MES0.5=1,MES0.4=0 +///46 X ResetDevice 52 ResetDevice 针对手动工位,无HMI,需要复位设备在MES页面操作。 +///47 X UnloadCompleted 53 UnloadCompleted 暂时保留,项目未使用 +///48 X MachineTime_ReadOver 54 MachineTime_ReadOver 备用 +///49 X Reserved_19 58 Reserved_19 备用 +///50 X FixOK 59 FixOK 手动拧紧工位,单工步螺栓拧紧完成,通知PC读取数据。 +///51 X Reserved_21 61 Reserved_21 备用 +///52 X Reserved_22 62 Reserved_22 备用 +///53 X Reserved_23 63 Reserved_23 备用 +///54 X Reserved_24 64 Reserved_24 备用 +///55 X Reserved_25 65 Reserved_25 备用 +///56 X FixAllow 66 FixAllow "设备工作的必须信号,对于有物料验证的工位,MES验证完成给出此信号,对于无物料验证工位,MES直接给出此信号。" +///57 X FixOver 67 FixOver 用于手动拧紧且有质量数据工位。通知设备当前工步拧紧螺钉工作结束。 +///58 X MatchingCompleted 68 MatchingCompleted 分线上总线,匹配成功是1;不成功是0。 +///59 X Match 69 Match 分线上总线,匹配成功是1;不成功是0。 +///60 X Reserved_2 70 Reserved_2 备用 +///61 X IsAutoGetEngineID 71 IsAutoGetEngineID 自动手动申请工件编号。0是自动方式;1:手动方式。暂时保留,生成流水号方式是在数据库中实现的 +///62 X RepairUplineMES 72 RepairUplineMES 上线清空MOBY(针对上线工位):通知PLC从新开始申请上线流程 +///63 INT EngineTypeID_MES 73 机型代码(MES) MES发动机机型标志(必须MES) +///64 STRING EngineID_MES 74 工件编号(MES) MES发动机编号(必须MES) +///65 STRING EngineType_MES 75 EngineType_MES MES发动机机型(必须MES) +///66 X Reserved_20 76 Reserved_20 备用 +///67 INT ProcessCode 77 ProcessCode 手动拧紧工位:由MES通知PLC拧紧序号 +///68 B OnLineState 79 OnLineState 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:0正常状态,实现正常功能。1离线:设备脱离MES工作,进入不交互模式。 +///69 INT PartPalletCode 80 托盘号(MES) 托盘编号(B5A) +///70 INT BoltCode 88 BoltCode 手动拧紧工位:指导PLC所用套筒 +///71 INT RepairStatus 93 RepairStatus "0正常件,1返修件。对于上线工位MES给出是正常上线还是返修上线,返修路径" +///72 DInt Reserved_15 110 Reserved_15 备用 +///73 DInt Reserved_16 111 Reserved_16 备用 +///74 B Reserved_17 112 Reserved_17 备用 +///75 INT SPareint1 113 SPareint1 备用int1 +///76 INT SPareint2 114 SPareint2 备用int2 +///77 INT SPareint3 115 SPareint3 备用int3 +///78 STRING Sparestring1 116 Sparestring1 备用字符串1 +///79 STRING Sparestring2 117 Sparestring2 备用字符串2 +///80 X MachineStatusPutOn 1000 机床上电(PLC) 机床上电(必须PLC) +///81 X MachineStatusWorkOn 1001 循环开始(PLC) 循环开始(必须PLC) +///82 X MachineStatusAlarm 1002 设备报警(PLC) 机床故障(必须PLC) +///83 X MachineStatusNoPart 1003 MachineStatusNoPart 上料无件(必须PLC) +///84 X MachineStatusBlock 1004 MachineStatusBlock 下料堵塞(必须PLC) + + +namespace MesWork +{ + /// + /// 这是变量类型代码的配置,几乎是不变的 + /// 请不要随意修改,为了保证变量版本同一,并且方便维护,请联系发行人修改! + /// 请注意,此修改为全局修改! + /// + public enum EnumTagTypeCodeID + { + /// + /// 工件到位(PLC) + /// 变量类型:Bool + /// 解释:托盘到达工位,并且托盘上有工件。 + /// + WorkStart = 2, + /// + /// + /// + RepairPartStatusPLC = 3, + /// + /// 工位返修字符串 + /// 变量类型:String + /// 解释:工位返修字符串 + /// + RepairPathString = 4, + /// + /// 传递机型(MES) + /// 变量类型:Bool + /// 解释:MES传递总成信息给PLC(上线工位) + /// + EngineTypeGetOverMES = 5, + /// + /// + /// + PartPalletGoOver = 6, + /// + /// + /// + MaterialVerifyOver = 7, + /// + /// + /// + FalseGo = 8, + /// + /// + /// + EngineTypeID = 9, + /// + /// + /// + EngineID = 10, + /// + /// 机型(MES) + /// 变量类型:String + /// + EngineType = 11, + /// + /// + /// + PartPalletStatus = 13, + /// + /// + /// + HeartBeatPLC = 14, + /// + /// + /// + HeartBeatMIS = 15, + /// + /// + /// + TargetTimeRead = 16, + /// + /// + /// + MachineTargetTime = 17, + /// + /// + /// + MachineActualTime = 18, + /// + /// 允许保存(PLC) + /// 变量类型:Bool + /// + MesRead = 19, + /// + /// 保存完成(MES) + /// 变量类型:Bool + /// + MesReadOver = 20, + /// + /// 合格标志(PLC) + /// 变量类型:Int + /// + QualityMask = 21, + /// + /// + /// + PalletInfo = 22, + /// + /// + /// + RepairStatusPLC = 23, + /// + /// 订单号(MES) + /// 变量类型:Int + /// + OrderNo = 24, + /// + /// 库位号(MES) + /// 变量类型:Bool + /// + StorageNo = 25, + /// + /// 允许放行(MES) + /// 变量类型:Bool + /// + AllowPass = 26, + /// + /// + /// + PartLoadFinish = 27, + /// + /// + /// + Reserved_7 = 28, + /// + /// + /// + Reserved_8 = 29, + /// + /// + /// + Reserved_9 = 30, + /// + /// + /// + Reserved_10 = 31, + /// + /// + /// + Reserved_11 = 32, + /// + /// + /// + Reserved_12 = 33, + /// + /// + /// + Reserved_13 = 34, + /// + /// + /// + Reserved_14 = 35, + /// + /// + /// + PLCSPareint1 = 36, + /// + /// + /// + PLCSPareint2 = 37, + /// + /// + /// + PLCSPareint3 = 38, + /// + /// + /// + PLCSarestring1 = 39, + /// + /// + /// + PLCSarestring2 = 40, + /// + /// + /// + MarkID = 42, + /// + /// + /// + PartLoad = 43, + /// + /// 传递机型(PLC) + /// 变量类型:Bool + /// + EngineTypeGetOverPLC = 44, + /// + /// + /// + PartLoadOK = 48, + /// + /// + /// + Reserved_18 = 49, + /// + /// + /// + PalletDown = 50, + /// + /// + /// + ConfirmOkGo = 51, + /// + /// + /// + ResetDevice = 52, + /// + /// + /// + UnloadCompleted = 53, + /// + /// + /// + MachineTime_ReadOver = 54, + /// + /// + /// + Reserved_19 = 58, + /// + /// + /// + FixOK = 59, + /// + /// + /// + Reserved_21 = 61, + /// + /// + /// + Reserved_22 = 62, + /// + /// + /// + Reserved_23 = 63, + /// + /// + /// + Reserved_24 = 64, + /// + /// + /// + Reserved_25 = 65, + /// + /// + /// + FixAllow = 66, + /// + /// + /// + FixOver = 67, + /// + /// + /// + MatchingCompleted = 68, + /// + /// + /// + Match = 69, + /// + /// + /// + Reserved_2 = 70, + /// + /// + /// + IsAutoGetEngineID = 71, + /// + /// + /// + RepairUplineMES = 72, + /// + /// 机型代码(MES) + /// 变量类型:Int + /// + EngineTypeID_MES = 73, + /// + /// 工件编号(MES) + /// 变量类型:String + /// + EngineID_MES = 74, + /// + /// + /// + EngineType_MES = 75, + /// + /// + /// + Reserved_20 = 76, + /// + /// + /// + ProcessCode = 77, + /// + /// + /// + OnLineState = 79, + /// + /// 托盘号(MES) + /// 变量类型:Int + /// + PartPalletCode = 80, + /// + /// + /// + BoltCode = 88, + /// + /// + /// + RepairStatus = 93, + /// + /// + /// + Reserved_15 = 110, + /// + /// + /// + Reserved_16 = 111, + /// + /// + /// + Reserved_17 = 112, + /// + /// + /// + SPareint1 = 113, + /// + /// + /// + SPareint2 = 114, + /// + /// + /// + SPareint3 = 115, + /// + /// + /// + Sparestring1 = 116, + /// + /// + /// + Sparestring2 = 117, + /// + /// 机床上电(PLC) + /// 变量类型:Bool + /// + MachineStatusPutOn = 1000, + /// + /// 循环开始(PLC) + /// 变量类型:Bool + /// + MachineStatusWorkOn = 1001, + /// + /// 设备报警(PLC) + /// 变量类型:Bool + /// + MachineStatusAlarm = 1002, + /// + /// 上料无件(PLC) + /// 变量类型:Bool + /// + MachineStatusNoPart = 1003, + /// + /// 下料堵塞(PLC) + /// 变量类型:Bool + /// + MachineStatusBlock = 1004, + /// + /// 下料堵塞(PLC) + /// 变量类型:Bool + /// + havePart70 = 10003, + } +} diff --git a/DT_SCADA/Core/fwlib32.cs b/DT_SCADA/Core/fwlib32.cs new file mode 100644 index 0000000..de13a39 --- /dev/null +++ b/DT_SCADA/Core/fwlib32.cs @@ -0,0 +1,12890 @@ +/*-------------------------------------------------------------------*/ +/* fwlib32.cs */ +/* */ +/* CNC/PMC Data Window Library for FOCAS1/Ethernet */ +/* FOCAS1/以太网的CNC/PMC数据窗口库 */ +/* Copyright (C) 2002-2011 by FANUC CORPORATION All rights reserved. */ +/* */ +/*-------------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; +using System.Threading; + +public class Focas1 +{ + /* Axis define 轴定义*/ +#if FS30D + public const short MAX_AXIS = 32; +#elif M_AXIS2 + public const short MAX_AXIS = 24; +#elif FS15D + public const short MAX_AXIS = 10; +#else + public const short MAX_AXIS = 8; +#endif + + public const short ALL_AXES = (-1); + public const short ALL_SPINDLES = (-1); + public const short EW_OK = (short)focas_ret.EW_OK; + + /* Error Codes */ + //错误代码 + public enum focas_ret + { + EW_PROTOCOL = (-17), /* protocol error 协议错误*/ + EW_SOCKET = (-16), /* Windows socket error Windows套接字错误*/ + EW_NODLL = (-15), /* DLL not exist error DLL不存在错误*/ + EW_BUS = (-11), /* bus error 总线错误*/ + EW_SYSTEM2 = (-10), /* system error 系统错误*/ + EW_HSSB = (-9), /* hssb communication error hssb通信错误*/ + EW_HANDLE = (-8), /* Windows library handle error Windows库句柄错误*/ + EW_VERSION = (-7), /* CNC/PMC version missmatch CNC/PMC版本不匹配*/ + EW_UNEXP = (-6), /* abnormal error 异常误差*/ + EW_SYSTEM = (-5), /* system error 系统错误*/ + EW_PARITY = (-4), /* shared RAM parity error 共享RAM奇偶校验错误*/ + EW_MMCSYS = (-3), /* emm386 or mmcsys install error emm386或mmcsys安装错误*/ + EW_RESET = (-2), /* reset or stop occured error 重置或停止发生错误*/ + EW_BUSY = (-1), /* busy error 忙错误*/ + EW_OK = 0, /* no problem 没问题*/ + EW_FUNC = 1, /* command prepare error 命令准备错误*/ + EW_NOPMC = 1, /* pmc not exist pmc不存在*/ + EW_LENGTH = 2, /* data block length error 数据块长度错误*/ + EW_NUMBER = 3, /* data number error 数据编号错误*/ + EW_RANGE = 3, /* address range error 地址范围错误*/ + EW_ATTRIB = 4, /* data attribute error 数据属性错误*/ + EW_TYPE = 4, /* data type error */ + EW_DATA = 5, /* data error 数据类型错误*/ + EW_NOOPT = 6, /* no option error 无选项错误*/ + EW_PROT = 7, /* write protect error 写保护错误*/ + EW_OVRFLOW = 8, /* memory overflow error 内存溢出错误*/ + EW_PARAM = 9, /* cnc parameter not correct error cnc参数错误*/ + EW_BUFFER = 10, /* buffer error 缓冲区错误*/ + EW_PATH = 11, /* path error 路径错误*/ + EW_MODE = 12, /* cnc mode error cnc模式错误*/ + EW_REJECT = 13, /* execution rejected error 执行拒绝错误*/ + EW_DTSRVR = 14, /* data server error 数据服务器错误*/ + EW_ALARM = 15, /* alarm has been occurred 已发生警报*/ + EW_STOP = 16, /* CNC is not running CNC未运行*/ + EW_PASSWD = 17, /* protection data error 保护数据错误*/ + /* + Result codes of DNC operation DNC操作结果代码 + */ + DNC_NORMAL = (-1), /* normal completed 正常完成*/ + DNC_CANCEL = (-32768), /* DNC operation was canceled by CNC CNC取消了DNC操作*/ + DNC_OPENERR = (-514), /* file open error 文件打开错误*/ + DNC_NOFILE = (-516), /* file not found file not found*/ + DNC_READERR = (-517) /* read error 读取错误*/ + }; + + /*--------------------*/ + /* */ + /* Structure Template */ + /* 结构模板 */ + /*--------------------*/ + /*-------------------------------------*/ + /* CNC: Control axis / spindle related */ + /*--------CNC:控制轴/主轴相关----------*/ + + /* cnc_actf:read actual axis feedrate(F) 读取实际值轴进给速度(F)*/ + /* cnc_acts:read actual spindle speed(S) 读取实际值主轴转速(S)*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBACT + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public int data; /* actual feed / actual spindle */ + } + + /* cnc_acts2:read actual spindle speed(S) 读取实际主轴转速 */ + /* (All or specified ) 全部或指定*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBACT2 + { + public short datano; /* spindle number */ + public short type; /* dummy */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public int[] data; /* spindle data */ + } + + /* cnc_absolute:read absolute axis position 读取绝对值轴线位置*/ + /* cnc_machine:read machine axis position 读取机器轴位置*/ + /* cnc_relative:read relative axis position 读取相对轴线位置*/ + /* cnc_distance:read distance to go 读取距离外带*/ + /* cnc_skip:read skip position 读取跳过位置*/ + /* cnc_srvdelay:read servo delay value 读取伺服延迟值*/ + /* cnc_accdecdly:read acceleration/deceleration delay value 读取加速/减速延迟值*/ + /* cnc_absolute2:read absolute axis position 2 读取绝对轴位置2*/ + /* cnc_relative2:read relative axis position 2 读取相对轴位置2*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAXIS + { + public short dummy; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] data; /* data value */ + } + + /* cnc_rddynamic:read all dynamic data 数控机床动态:全部读取动态数据*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class FAXIS + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] absolute; /* absolute position 绝对位置*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] machine; /* machine position 机器位置*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] relative; /* relative position 相对位置*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] distance; /* distance to go 剩余距离*/ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OAXIS + { + public int absolute; /* absolute position 绝对位置*/ + public int machine; /* machine position 机器位置*/ + public int relative; /* relative position 相对位置*/ + public int distance; /* distance to go 剩余距离*/ + } +#if (!ONO8D) + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDY_1 + { + public short dummy; + public short axis; /* axis number 轴号*/ + public short alarm; /* alarm status 报警状态*/ + public short prgnum; /* current program number 当前程序号*/ + public short prgmnum; /* main program number 主程序编号*/ + public int seqnum; /* current sequence number 当前序列号 */ + public int actf; /* actual feedrate 实际进给速度*/ + public int acts; /* actual spindle speed 实际主轴转速*/ + public FAXIS pos = new FAXIS(); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDY_2 + { + public short dummy; + public short axis; /* axis number 轴号*/ + public short alarm; /* alarm status 报警状态*/ + public short prgnum; /* current program number 当前程序号*/ + public short prgmnum; /* main program number 主程序编号*/ + public int seqnum; /* current sequence number 当前序列号 */ + public int actf; /* actual feedrate 实际进给速度*/ + public int acts; /* actual spindle speed 实际主轴转速*/ + public OAXIS pos = new OAXIS(); + } +#else + [StructLayout(LayoutKind.Sequential, Pack=4)] + public class ODBDY_1 + { + public short dummy ; + public short axis ; /* axis number */ + public short alarm ; /* alarm status */ + public int prgnum ; /* current program number */ + public int prgmnum ; /* main program number */ + public int seqnum ; /* current sequence number */ + public int actf ; /* actual feedrate */ + public int acts ; /* actual spindle speed */ + public FAXIS pos = new FAXIS(); + } + [StructLayout(LayoutKind.Sequential, Pack=4)] + public class ODBDY_2 + { + public short dummy ; + public short axis ; /* axis number */ + public short alarm ; /* alarm status */ + public int prgnum ; /* current program number */ + public int prgmnum ; /* main program number */ + public int seqnum ; /* current sequence number */ + public int actf ; /* actual feedrate */ + public int acts ; /* actual spindle speed */ + public OAXIS pos = new OAXIS(); + } +#endif + + /* cnc_rddynamic2:read all dynamic data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDY2_1 + { + public short dummy; + public short axis; /* axis number 轴号*/ + public short alarm; /* alarm status 报警状态*/ + public short prgnum; /* current program number 当前程序号*/ + public short prgmnum; /* main program number 主程序编号*/ + public int seqnum; /* current sequence number 当前序列号 */ + public int actf; /* actual feedrate 实际进给速度*/ + public int acts; /* actual spindle speed 实际主轴转速*/ + public FAXIS pos = new FAXIS(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDY2_2 + { + public short dummy; + public short axis; /* axis number 轴号*/ + public short alarm; /* alarm status 报警状态*/ + public short prgnum; /* current program number 当前程序号*/ + public short prgmnum; /* main program number 主程序编号*/ + public int seqnum; /* current sequence number 当前序列号 */ + public int actf; /* actual feedrate 实际进给速度*/ + public int acts; /* actual spindle speed 实际主轴转速*/ + public OAXIS pos = new OAXIS(); /* In case of 1 axis */ + } + + /* cnc_wrrelpos:set origin / preset relative axis position */ + /* 数控机床位置:设置原点/预设相对轴位置*/ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBWRR + { + public short datano; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] data = new int[MAX_AXIS]; /* preset data */ + } + + /* cnc_prstwkcd:preset work coordinate */ + //预设工作坐标 + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBWRA + { + public short datano; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] data = new int[MAX_AXIS]; /* preset data */ + } + + /* cnc_rdmovrlap:read manual overlapped motion value */ + //读取手动重叠运动值 + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBOVL + { + public short datano; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2 * MAX_AXIS)] + public int[] data; /* data value:[2][MAX_AXIS] */ + } + + /* cnc_rdspload:read load information of serial spindle 读取串行主轴的负载信息*/ + /* cnc_rdspmaxrpm:read maximum r.p.m. ratio of serial spindle 读取串行主轴的最大r.p.m.比*/ + /* cnc_rdspgear:read gear ratio of serial spindle 读取串行主轴的传动比*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPN + { + public short datano; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public short[] data; /* preset data */ + } + + /* cnc_rdposition:read tool position 读取刀具位置*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class POSELM + { + public int data; /* position data 位置数据*/ + public short dec; /* place of decimal point of position data 位置数据的小数点位置*/ + public short unit; /* unit of position data 位置数据单位*/ + public short disp; /* status of display显示状态 */ + public char name; /* axis name 轴名称*/ + public char suff; /* axis name preffix 轴名称前缀*/ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class POSELMALL + { + public POSELM abs = new POSELM(); + public POSELM mach = new POSELM(); + public POSELM rel = new POSELM(); + public POSELM dist = new POSELM(); + } + +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBPOS + { + public POSELMALL p1=new POSELMALL(); + public POSELMALL p2=new POSELMALL(); + public POSELMALL p3=new POSELMALL(); + public POSELMALL p4=new POSELMALL(); + public POSELMALL p5=new POSELMALL(); + public POSELMALL p6=new POSELMALL(); + public POSELMALL p7=new POSELMALL(); + public POSELMALL p8=new POSELMALL(); + public POSELMALL p9=new POSELMALL(); + public POSELMALL p10=new POSELMALL(); + public POSELMALL p11=new POSELMALL(); + public POSELMALL p12=new POSELMALL(); + public POSELMALL p13=new POSELMALL(); + public POSELMALL p14=new POSELMALL(); + public POSELMALL p15=new POSELMALL(); + public POSELMALL p16=new POSELMALL(); + public POSELMALL p17=new POSELMALL(); + public POSELMALL p18=new POSELMALL(); + public POSELMALL p19=new POSELMALL(); + public POSELMALL p20=new POSELMALL(); + public POSELMALL p21=new POSELMALL(); + public POSELMALL p22=new POSELMALL(); + public POSELMALL p23=new POSELMALL(); + public POSELMALL p24=new POSELMALL(); + // In case of 24 axes. + // if you need the more information, you must be add the member. + } +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBPOS + { + public POSELMALL p1=new POSELMALL(); + public POSELMALL p2=new POSELMALL(); + public POSELMALL p3=new POSELMALL(); + public POSELMALL p4=new POSELMALL(); + public POSELMALL p5=new POSELMALL(); + public POSELMALL p6=new POSELMALL(); + public POSELMALL p7=new POSELMALL(); + public POSELMALL p8=new POSELMALL(); + public POSELMALL p9=new POSELMALL(); + public POSELMALL p10=new POSELMALL(); + // In case of 10 axes. + // if you need the more information, you must be add the member. + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPOS + { + public POSELMALL p1 = new POSELMALL(); + public POSELMALL p2 = new POSELMALL(); + public POSELMALL p3 = new POSELMALL(); + public POSELMALL p4 = new POSELMALL(); + public POSELMALL p5 = new POSELMALL(); + public POSELMALL p6 = new POSELMALL(); + public POSELMALL p7 = new POSELMALL(); + public POSELMALL p8 = new POSELMALL(); + // In case of 8 axes. + //8轴情况下 + // if you need the more information, you must be add the member. + // 如果您需要更多信息,您必须添加成员 + } +#endif + + /* cnc_rdhndintrpt:read handle interruption */ + //读取句柄中断 + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHND_data + { + public POSELM input = new POSELM(); /* input unit 输入单元*/ + public POSELM output = new POSELM(); /* output unit 输出单元*/ + } +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBHND + { + public ODBHND_data p1=new ODBHND_data(); + public ODBHND_data p2=new ODBHND_data(); + public ODBHND_data p3=new ODBHND_data(); + public ODBHND_data p4=new ODBHND_data(); + public ODBHND_data p5=new ODBHND_data(); + public ODBHND_data p6=new ODBHND_data(); + public ODBHND_data p7=new ODBHND_data(); + public ODBHND_data p8=new ODBHND_data(); + public ODBHND_data p9=new ODBHND_data(); + public ODBHND_data p10=new ODBHND_data(); + public ODBHND_data p11=new ODBHND_data(); + public ODBHND_data p12=new ODBHND_data(); + public ODBHND_data p13=new ODBHND_data(); + public ODBHND_data p14=new ODBHND_data(); + public ODBHND_data p15=new ODBHND_data(); + public ODBHND_data p16=new ODBHND_data(); + public ODBHND_data p17=new ODBHND_data(); + public ODBHND_data p18=new ODBHND_data(); + public ODBHND_data p19=new ODBHND_data(); + public ODBHND_data p20=new ODBHND_data(); + public ODBHND_data p21=new ODBHND_data(); + public ODBHND_data p22=new ODBHND_data(); + public ODBHND_data p23=new ODBHND_data(); + public ODBHND_data p24=new ODBHND_data(); + // In case of 24 axes. + // if you need the more information, you must be add the member. + } +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBHND + { + public ODBHND_data p1=new ODBHND_data(); + public ODBHND_data p2=new ODBHND_data(); + public ODBHND_data p3=new ODBHND_data(); + public ODBHND_data p4=new ODBHND_data(); + public ODBHND_data p5=new ODBHND_data(); + public ODBHND_data p6=new ODBHND_data(); + public ODBHND_data p7=new ODBHND_data(); + public ODBHND_data p8=new ODBHND_data(); + public ODBHND_data p9=new ODBHND_data(); + public ODBHND_data p10=new ODBHND_data(); + // In case of 10 axes. + // if you need the more information, you must be add the member. + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHND + { + public ODBHND_data p1 = new ODBHND_data(); + public ODBHND_data p2 = new ODBHND_data(); + public ODBHND_data p3 = new ODBHND_data(); + public ODBHND_data p4 = new ODBHND_data(); + public ODBHND_data p5 = new ODBHND_data(); + public ODBHND_data p6 = new ODBHND_data(); + public ODBHND_data p7 = new ODBHND_data(); + public ODBHND_data p8 = new ODBHND_data(); + // In case of 8 axes. + //8轴情况下 + // if you need the more information, you must be add the member. + // 如果您需要更多信息,您必须添加成员 + } +#endif + + /* cnc_rdspeed:read current speed */ + //读取当前速度 + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class SPEEDELM + { + public int data; /* speed data 速度数据*/ + public short dec; /* decimal position 小数点位置*/ + public short unit; /* data unit 数据单元 */ + public short disp; /* display flag 显示标志*/ + public byte name; /* name of data 数据名称*/ + public byte suff; /* suffix 后缀*/ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPEED + { + public SPEEDELM actf = new SPEEDELM(); /* actual feed rate 实际进给量*/ + public SPEEDELM acts = new SPEEDELM(); /* actual spindle speed 实际主轴转速*/ + } + + /* cnc_rdsvmeter:read servo load meter 读取伺服负载表*/ + /* cnc_rdspmeter:read spindle load meter 主轴负荷计读数*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class LOADELM + { + public int data; /* load meter 负荷计*/ + public short dec; /* decimal position 小数点位置*/ + public short unit; /* unit 单元*/ + public byte name; /* name of data 数据名称*/ + public byte suff1; /* suffix 后缀*/ + public byte suff2; /* suffix 后缀*/ + public byte reserve; /* reserve 储备*/ + } + +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBSVLOAD + { + public LOADELM svload1 = new LOADELM(); /* servo load meter */ + public LOADELM svload2 = new LOADELM(); /* servo load meter */ + public LOADELM svload3 = new LOADELM(); /* servo load meter */ + public LOADELM svload4 = new LOADELM(); /* servo load meter */ + public LOADELM svload5 = new LOADELM(); /* servo load meter */ + public LOADELM svload6 = new LOADELM(); /* servo load meter */ + public LOADELM svload7 = new LOADELM(); /* servo load meter */ + public LOADELM svload8 = new LOADELM(); /* servo load meter */ + public LOADELM svload9 = new LOADELM(); /* servo load meter */ + public LOADELM svload10= new LOADELM(); /* servo load meter */ + public LOADELM svload11= new LOADELM(); /* servo load meter */ + public LOADELM svload12= new LOADELM(); /* servo load meter */ + public LOADELM svload13= new LOADELM(); /* servo load meter */ + public LOADELM svload14= new LOADELM(); /* servo load meter */ + public LOADELM svload15= new LOADELM(); /* servo load meter */ + public LOADELM svload16= new LOADELM(); /* servo load meter */ + public LOADELM svload17= new LOADELM(); /* servo load meter */ + public LOADELM svload18= new LOADELM(); /* servo load meter */ + public LOADELM svload19= new LOADELM(); /* servo load meter */ + public LOADELM svload20= new LOADELM(); /* servo load meter */ + public LOADELM svload21= new LOADELM(); /* servo load meter */ + public LOADELM svload22= new LOADELM(); /* servo load meter */ + public LOADELM svload23= new LOADELM(); /* servo load meter */ + public LOADELM svload24= new LOADELM(); /* servo load meter */ + } +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBSVLOAD + { + public LOADELM svload1 = new LOADELM(); /* servo load meter */ + public LOADELM svload2 = new LOADELM(); /* servo load meter */ + public LOADELM svload3 = new LOADELM(); /* servo load meter */ + public LOADELM svload4 = new LOADELM(); /* servo load meter */ + public LOADELM svload5 = new LOADELM(); /* servo load meter */ + public LOADELM svload6 = new LOADELM(); /* servo load meter */ + public LOADELM svload7 = new LOADELM(); /* servo load meter */ + public LOADELM svload8 = new LOADELM(); /* servo load meter */ + public LOADELM svload9 = new LOADELM(); /* servo load meter */ + public LOADELM svload10= new LOADELM(); /* servo load meter */ + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSVLOAD + { + public LOADELM svload1 = new LOADELM(); /* servo load meter 伺服负荷计*/ + public LOADELM svload2 = new LOADELM(); /* servo load meter */ + public LOADELM svload3 = new LOADELM(); /* servo load meter */ + public LOADELM svload4 = new LOADELM(); /* servo load meter */ + public LOADELM svload5 = new LOADELM(); /* servo load meter */ + public LOADELM svload6 = new LOADELM(); /* servo load meter */ + public LOADELM svload7 = new LOADELM(); /* servo load meter */ + public LOADELM svload8 = new LOADELM(); /* servo load meter */ + } +#endif + + /* cnc_rdexecpt:read execution program pointer */ + //读取执行程序指针 + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class PRGPNT + { + public int prog_no; /* program number 程序编号*/ + public int blk_no; /* block number 区块编号*/ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPLOAD_data + { + public LOADELM spload = new LOADELM(); /* spindle load meter 主轴负荷计*/ + public LOADELM spspeed = new LOADELM(); /* spindle speed 主轴转速*/ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPLOAD + { + public ODBSPLOAD_data spload1 = new ODBSPLOAD_data(); /* spindle load 主轴负荷*/ + public ODBSPLOAD_data spload2 = new ODBSPLOAD_data(); /* spindle load */ + public ODBSPLOAD_data spload3 = new ODBSPLOAD_data(); /* spindle load */ + public ODBSPLOAD_data spload4 = new ODBSPLOAD_data(); /* spindle load */ + } + + /* cnc_rd5axmandt:read manual feed for 5-axis machining */ + //读取5轴加工的手动进给 + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB5AXMAN + { + public short type1; + public short type2; + public short type3; + public int data1; + public int data2; + public int data3; + public int c1; + public int c2; + public int dummy; + public int td; + public int r1; + public int r2; + public int vr; + public int h1; + public int h2; + } + + /*----------------------*/ + /* CNC: Program related */ + /*-------CNC:程序相关------*/ + + /* cnc_rddncdgndt:read the diagnosis data of DNC operation */ + /// + /// 读取DNC操作的诊断数据 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDNCDGN + { + public short ctrl_word; + public short can_word; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public char[] nc_file; + public ushort read_ptr; + public ushort write_ptr; + public ushort empty_cnt; + public uint total_size; + } + + /* cnc_upload:upload NC program */ + /* cnc_cupload:upload NC program(conditional) */ + /// + /// 上传NC程序 + /// 上传NC程序(有条件) + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBUP + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public char[] data; /* data */ + } /* In case that the number of data is 256 如果数据数为256*/ + + /* cnc_buff:read buffer status for downloading/verification NC program */ + /// + /// 读取下载/验证NC程序的缓冲区状态 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBBUF + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public short data; /* buffer status */ + } + + /* cnc_rdprogdir:read program directory */ + /// + /// 读取程序目录 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class PRGDIR + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public char[] prg_data; /* directory data */ + } /* In case that the number of data is 256 */ + + /* cnc_rdproginfo:read program information */ + /// + /// 读取程序信息 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBNC_1 + { + public short reg_prg; /* registered program number */ + public short unreg_prg; /* unregistered program number */ + public int used_mem; /* used memory area */ + public int unused_mem; /* unused memory area */ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBNC_2 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] + public char[] asc; /* ASCII string type */ + } + + /* cnc_rdprgnum:read program number under execution */ + /// + /// 读取正在执行的程序号 + /// +#if (!ONO8D) + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPRO + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public short data; /* running program number 运行程序编号*/ + public short mdata; /* main program number 主程序编号*/ + } +#else + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBPRO + { + [MarshalAs(UnmanagedType.ByValArray,SizeConst=2)] + public short[] dummy ; /* dummy */ + public int data ; /* running program number */ + public int mdata ; /* main program number */ + } +#endif + + /* cnc_exeprgname:read program name under execution */ + /// + /// 读取正在执行的程序名 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXEPRG + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 36)] + public char[] name; /* running program name 运行程序名称*/ + public int o_num; /* running program number 运行程序编号*/ + } + + /* cnc_rdseqnum:read sequence number under execution 读取正在执行的序列号 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSEQ + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public int data; /* sequence number */ + } + + /* cnc_rdmdipntr:read execution pointer for MDI operation MDI操作的读取执行指针*/ +#if (!ONO8D) + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMDIP + { + public short mdiprog; /* exec. program number 程序编号*/ + public int mdipntr; /* exec. pointer 指针*/ + public short crntprog; /* prepare program number 准备程序编号*/ + public int crntpntr; /* prepare pointer 准备指针*/ + } +#else + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBMDIP + { + public int mdiprog; /* exec. program number */ + public int mdipntr; /* exec. pointer */ + public int crntprog; /* prepare program number */ + public int crntpntr; /* prepare pointer */ + } +#endif + + /* cnc_rdaxisdata:read various axis data 读取各种轴数据*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAXDT_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string name = new string(' ', 4); /* axis name */ + public int data; /* position data */ + public short dec; /* decimal position */ + public short unit; /* data unit */ + public short flag; /* flags */ + public short reserve; /* reserve */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAXDT + { + public ODBAXDT_data data1 = new ODBAXDT_data(); + public ODBAXDT_data data2 = new ODBAXDT_data(); + public ODBAXDT_data data3 = new ODBAXDT_data(); + public ODBAXDT_data data4 = new ODBAXDT_data(); + public ODBAXDT_data data5 = new ODBAXDT_data(); + public ODBAXDT_data data6 = new ODBAXDT_data(); + public ODBAXDT_data data7 = new ODBAXDT_data(); + public ODBAXDT_data data8 = new ODBAXDT_data(); + public ODBAXDT_data data9 = new ODBAXDT_data(); + public ODBAXDT_data data10 = new ODBAXDT_data(); + public ODBAXDT_data data11 = new ODBAXDT_data(); + public ODBAXDT_data data12 = new ODBAXDT_data(); + public ODBAXDT_data data13 = new ODBAXDT_data(); + public ODBAXDT_data data14 = new ODBAXDT_data(); + public ODBAXDT_data data15 = new ODBAXDT_data(); + public ODBAXDT_data data16 = new ODBAXDT_data(); + public ODBAXDT_data data17 = new ODBAXDT_data(); + public ODBAXDT_data data18 = new ODBAXDT_data(); + public ODBAXDT_data data19 = new ODBAXDT_data(); + public ODBAXDT_data data20 = new ODBAXDT_data(); + public ODBAXDT_data data21 = new ODBAXDT_data(); + public ODBAXDT_data data22 = new ODBAXDT_data(); + public ODBAXDT_data data23 = new ODBAXDT_data(); + public ODBAXDT_data data24 = new ODBAXDT_data(); + public ODBAXDT_data data25 = new ODBAXDT_data(); + public ODBAXDT_data data26 = new ODBAXDT_data(); + public ODBAXDT_data data27 = new ODBAXDT_data(); + public ODBAXDT_data data28 = new ODBAXDT_data(); + public ODBAXDT_data data29 = new ODBAXDT_data(); + public ODBAXDT_data data30 = new ODBAXDT_data(); + public ODBAXDT_data data31 = new ODBAXDT_data(); + public ODBAXDT_data data32 = new ODBAXDT_data(); + public ODBAXDT_data data33 = new ODBAXDT_data(); + public ODBAXDT_data data34 = new ODBAXDT_data(); + public ODBAXDT_data data35 = new ODBAXDT_data(); + public ODBAXDT_data data36 = new ODBAXDT_data(); + public ODBAXDT_data data37 = new ODBAXDT_data(); + public ODBAXDT_data data38 = new ODBAXDT_data(); + public ODBAXDT_data data39 = new ODBAXDT_data(); + public ODBAXDT_data data40 = new ODBAXDT_data(); + public ODBAXDT_data data41 = new ODBAXDT_data(); + public ODBAXDT_data data42 = new ODBAXDT_data(); + public ODBAXDT_data data43 = new ODBAXDT_data(); + public ODBAXDT_data data44 = new ODBAXDT_data(); + public ODBAXDT_data data45 = new ODBAXDT_data(); + public ODBAXDT_data data46 = new ODBAXDT_data(); + public ODBAXDT_data data47 = new ODBAXDT_data(); + public ODBAXDT_data data48 = new ODBAXDT_data(); + public ODBAXDT_data data49 = new ODBAXDT_data(); + public ODBAXDT_data data50 = new ODBAXDT_data(); + public ODBAXDT_data data51 = new ODBAXDT_data(); + public ODBAXDT_data data52 = new ODBAXDT_data(); + public ODBAXDT_data data53 = new ODBAXDT_data(); + public ODBAXDT_data data54 = new ODBAXDT_data(); + public ODBAXDT_data data55 = new ODBAXDT_data(); + public ODBAXDT_data data56 = new ODBAXDT_data(); + public ODBAXDT_data data57 = new ODBAXDT_data(); + public ODBAXDT_data data58 = new ODBAXDT_data(); + public ODBAXDT_data data59 = new ODBAXDT_data(); + public ODBAXDT_data data60 = new ODBAXDT_data(); + public ODBAXDT_data data61 = new ODBAXDT_data(); + public ODBAXDT_data data62 = new ODBAXDT_data(); + public ODBAXDT_data data63 = new ODBAXDT_data(); + public ODBAXDT_data data64 = new ODBAXDT_data(); + public ODBAXDT_data data65 = new ODBAXDT_data(); + public ODBAXDT_data data66 = new ODBAXDT_data(); + public ODBAXDT_data data67 = new ODBAXDT_data(); + public ODBAXDT_data data68 = new ODBAXDT_data(); + public ODBAXDT_data data69 = new ODBAXDT_data(); + public ODBAXDT_data data70 = new ODBAXDT_data(); + public ODBAXDT_data data71 = new ODBAXDT_data(); + public ODBAXDT_data data72 = new ODBAXDT_data(); + public ODBAXDT_data data73 = new ODBAXDT_data(); + public ODBAXDT_data data74 = new ODBAXDT_data(); + public ODBAXDT_data data75 = new ODBAXDT_data(); + public ODBAXDT_data data76 = new ODBAXDT_data(); + public ODBAXDT_data data77 = new ODBAXDT_data(); + public ODBAXDT_data data78 = new ODBAXDT_data(); + public ODBAXDT_data data79 = new ODBAXDT_data(); + public ODBAXDT_data data80 = new ODBAXDT_data(); + public ODBAXDT_data data81 = new ODBAXDT_data(); + public ODBAXDT_data data82 = new ODBAXDT_data(); + public ODBAXDT_data data83 = new ODBAXDT_data(); + public ODBAXDT_data data84 = new ODBAXDT_data(); + public ODBAXDT_data data85 = new ODBAXDT_data(); + public ODBAXDT_data data86 = new ODBAXDT_data(); + public ODBAXDT_data data87 = new ODBAXDT_data(); + public ODBAXDT_data data88 = new ODBAXDT_data(); + public ODBAXDT_data data89 = new ODBAXDT_data(); + public ODBAXDT_data data90 = new ODBAXDT_data(); + public ODBAXDT_data data91 = new ODBAXDT_data(); + public ODBAXDT_data data92 = new ODBAXDT_data(); + public ODBAXDT_data data93 = new ODBAXDT_data(); + public ODBAXDT_data data94 = new ODBAXDT_data(); + public ODBAXDT_data data95 = new ODBAXDT_data(); + public ODBAXDT_data data96 = new ODBAXDT_data(); + public ODBAXDT_data data97 = new ODBAXDT_data(); + public ODBAXDT_data data98 = new ODBAXDT_data(); + public ODBAXDT_data data99 = new ODBAXDT_data(); + public ODBAXDT_data data100 = new ODBAXDT_data(); + public ODBAXDT_data data101 = new ODBAXDT_data(); + public ODBAXDT_data data102 = new ODBAXDT_data(); + public ODBAXDT_data data103 = new ODBAXDT_data(); + public ODBAXDT_data data104 = new ODBAXDT_data(); + public ODBAXDT_data data105 = new ODBAXDT_data(); + public ODBAXDT_data data106 = new ODBAXDT_data(); + public ODBAXDT_data data107 = new ODBAXDT_data(); + public ODBAXDT_data data108 = new ODBAXDT_data(); + public ODBAXDT_data data109 = new ODBAXDT_data(); + public ODBAXDT_data data110 = new ODBAXDT_data(); + public ODBAXDT_data data111 = new ODBAXDT_data(); + public ODBAXDT_data data112 = new ODBAXDT_data(); + public ODBAXDT_data data113 = new ODBAXDT_data(); + public ODBAXDT_data data114 = new ODBAXDT_data(); + public ODBAXDT_data data115 = new ODBAXDT_data(); + public ODBAXDT_data data116 = new ODBAXDT_data(); + public ODBAXDT_data data117 = new ODBAXDT_data(); + public ODBAXDT_data data118 = new ODBAXDT_data(); + public ODBAXDT_data data119 = new ODBAXDT_data(); + public ODBAXDT_data data120 = new ODBAXDT_data(); + public ODBAXDT_data data121 = new ODBAXDT_data(); + public ODBAXDT_data data122 = new ODBAXDT_data(); + public ODBAXDT_data data123 = new ODBAXDT_data(); + public ODBAXDT_data data124 = new ODBAXDT_data(); + public ODBAXDT_data data125 = new ODBAXDT_data(); + public ODBAXDT_data data126 = new ODBAXDT_data(); + public ODBAXDT_data data127 = new ODBAXDT_data(); + public ODBAXDT_data data128 = new ODBAXDT_data(); + } + + /* cnc_rdspcss:read constant surface speed data 读取恒定表面速度数据*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBCSS + { + public int srpm; /* order spindle speed */ + public int sspm; /* order constant spindle speed */ + public int smax; /* order maximum spindle speed */ + } + + /* cnc_rdpdf_drive:read program drive directory 读取程序驱动器目录*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPDFDRV + { + public short max_num; /* maximum drive number */ + public short dummy; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive1 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive2 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive3 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive4 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive5 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive6 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive7 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive8 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive9 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive10 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive11 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive12 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive13 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive14 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive15 = new string(' ', 12); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string drive16 = new string(' ', 12); + } + + /* cnc_rdpdf_inf:read program drive information 读取程序驱动器信息*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPDFINF + { + public int used_page; /* used capacity */ + public int all_page; /* all capacity */ + public int used_dir; /* used directory number */ + public int all_dir; /* all directory number */ + } + + /* cnc_rdpdf_subdir:read directory (sub directories) 读取目录(子目录)*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IDBPDFSDIR + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 212)] + public string path = new string(' ', 212); /* path name */ + public short req_num; /* entry number */ + public short dummy; + } + + /* cnc_rdpdf_subdir:read directory (sub directories) 读取目录(子目录)*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPDFSDIR + { + public short sub_exist; /* existence of sub directory 子目录的存在*/ + public short dummy; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 36)] + public string d_f = new string(' ', 36); /* path name 路径名*/ + } + + /* cnc_rdpdf_alldir:read directory (all files) 读取目录(所有文件)*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IDBPDFADIR + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 212)] + public string path = new string(' ', 212); /* path name */ + public short req_num; /* entry number */ + public short size_kind; /* kind of size */ + public short type; /* kind of format */ + public short dummy; + } + + /* cnc_rdpdf_alldir:read directory (all files) 读取目录(所有文件)*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPDFADIR + { + public short data_kind; /* kinf of data */ + public short year; /* last date and time */ + public short mon; /* last date and time */ + public short day; /* last date and time */ + public short hour; /* last date and time */ + public short min; /* last date and time */ + public short sec; /* last date and time */ + public short dummy; + public int dummy2; + public int size; /* size */ + public int attr; /* attribute */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 36)] + public string d_f = new string(' ', 36); /* path name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 52)] + public string comment = new string(' ', 52); /* comment */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string o_time = new string(' ', 12); /* machining time stamp */ + } + + /* cnc_rdpdf_subdirn:read file count the directory has 目录的读取文件计数*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPDFNFIL + { + public short dir_num; /* directory */ + public short file_num; /* file */ + } + + /* cnc_wrpdf_attr:change attribute of program file and directory 更改程序文件和目录的属性*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBPDFTDIR + { + public uint slct; /* selection */ + public uint attr; /* data */ + } + + /*---------------------------*/ + /* CNC: NC file data related */ + /*--------数控文件数据相关--------*/ + + /* cnc_rdtofs:read tool offset value */ + /// + /// 读取刀具补偿值 + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTOFS + { + public short datano; /* data number */ + public short type; /* data type */ + public int data; /* data */ + } + + /* cnc_rdtofsr:read tool offset value(area specified) 读取刀具补偿值(指定区域)*/ + /* cnc_wrtofsr:write tool offset value(area specified) 写入刀具补偿值(指定区域)*/ + [StructLayout(LayoutKind.Explicit)] + public class OFS_1 + { + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] m_ofs = new int[5]; /* M Each */ + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] m_ofs_a = new int[5]; /* M-A All */ + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] t_tip = new short[5]; /* T Each, 2-byte */ + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] t_ofs = new int[5]; /* T Each, 4-byte */ + } /* In case that the number of data is 5 如果数据数为5*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OFS_2 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2 * 5)] + public int[] m_ofs_b = new int[10]; /* M-B All */ + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OFS_3 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4 * 5)] + public int[] m_ofs_c = new int[20]; /* M-C All */ + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class T_OFS_A + { + public short tip; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public int[] data; + } /* T-A All */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class T_OFS_A_data + { + public T_OFS_A data1 = new T_OFS_A(); + public T_OFS_A data2 = new T_OFS_A(); + public T_OFS_A data3 = new T_OFS_A(); + public T_OFS_A data4 = new T_OFS_A(); + public T_OFS_A data5 = new T_OFS_A(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class T_OFS_B + { + public short tip; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] data; + } /* T-B All */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class T_OFS_B_data + { + public T_OFS_B data1 = new T_OFS_B(); + public T_OFS_B data2 = new T_OFS_B(); + public T_OFS_B data3 = new T_OFS_B(); + public T_OFS_B data4 = new T_OFS_B(); + public T_OFS_B data5 = new T_OFS_B(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTO_1_1 + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + public OFS_1 ofs = new OFS_1(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTO_1_2 + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + public OFS_2 ofs = new OFS_2(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTO_1_3 + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + public OFS_3 ofs = new OFS_3(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTO_2 + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + public T_OFS_A_data tofsa = new T_OFS_A_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTO_3 + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + public T_OFS_B_data tofsb = new T_OFS_B_data(); + } + + /* cnc_rdzofs:read work zero offset value 读取工作零点偏移值*/ + /* cnc_wrzofs:write work zero offset value 写入工作零点偏移值*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBZOFS + { + public short datano; /* offset NO. */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] data = new int[MAX_AXIS]; /* data value */ + } + + /* cnc_rdzofsr:read work zero offset value(area specified) */ + /* cnc_wrzofsr:write work zero offset value(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBZOR + { + public short datano_s; /* start offset number */ + public short type; /* axis number */ + public short datano_e; /* end offset number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7 * MAX_AXIS)] + public int[] data = new int[7 * MAX_AXIS]; /* offset value */ + } /* In case that the number of axes is MAX_AXIS, the number of data is 7 */ + + /* cnc_rdmsptype:read mesured point value */ + /* cnc_wrmsptype:write mesured point value */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMSTP + { + public short datano_s; /* start offset number */ + public short dummy; /* dummy */ + public short datano_e; /* end offset number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public sbyte[] data = new sbyte[7]; /* mesured point value */ + } + + /* cnc_rdparam:read parameter */ + /* cnc_wrparam:write parameter */ + /* cnc_rdset:read setting data */ + /* cnc_wrset:write setting data */ + /* cnc_rdparar:read parameter(area specified) */ + /* cnc_wrparas:write parameter(plural specified) */ + /* cnc_rdsetr:read setting data(area specified) */ + /* cnc_wrsets:write setting data(plural specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REALPRM + { + public int prm_val; /* data of real parameter */ + public int dec_val; /* decimal point of real parameter */ + } +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class REALPRMS + { + public REALPRM rdata1=new REALPRM(); + public REALPRM rdata2=new REALPRM(); + public REALPRM rdata3=new REALPRM(); + public REALPRM rdata4=new REALPRM(); + public REALPRM rdata5=new REALPRM(); + public REALPRM rdata6=new REALPRM(); + public REALPRM rdata7=new REALPRM(); + public REALPRM rdata8=new REALPRM(); + public REALPRM rdata9=new REALPRM(); + public REALPRM rdata10=new REALPRM(); + public REALPRM rdata11=new REALPRM(); + public REALPRM rdata12=new REALPRM(); + public REALPRM rdata13=new REALPRM(); + public REALPRM rdata14=new REALPRM(); + public REALPRM rdata15=new REALPRM(); + public REALPRM rdata16=new REALPRM(); + public REALPRM rdata17=new REALPRM(); + public REALPRM rdata18=new REALPRM(); + public REALPRM rdata19=new REALPRM(); + public REALPRM rdata20=new REALPRM(); + public REALPRM rdata21=new REALPRM(); + public REALPRM rdata22=new REALPRM(); + public REALPRM rdata23=new REALPRM(); + public REALPRM rdata24=new REALPRM(); + } /* In case that the number of alarm is 24 */ +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class REALPRMS + { + public REALPRM rdata1=new REALPRM(); + public REALPRM rdata2=new REALPRM(); + public REALPRM rdata3=new REALPRM(); + public REALPRM rdata4=new REALPRM(); + public REALPRM rdata5=new REALPRM(); + public REALPRM rdata6=new REALPRM(); + public REALPRM rdata7=new REALPRM(); + public REALPRM rdata8=new REALPRM(); + public REALPRM rdata9=new REALPRM(); + public REALPRM rdata10=new REALPRM(); + } /* In case that the number of alarm is 10 */ +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REALPRMS + { + public REALPRM rdata1 = new REALPRM(); + public REALPRM rdata2 = new REALPRM(); + public REALPRM rdata3 = new REALPRM(); + public REALPRM rdata4 = new REALPRM(); + public REALPRM rdata5 = new REALPRM(); + public REALPRM rdata6 = new REALPRM(); + public REALPRM rdata7 = new REALPRM(); + public REALPRM rdata8 = new REALPRM(); + } /* In case that the number of alarm is 8 */ +#endif + + [StructLayout(LayoutKind.Explicit)] + public class IODBPSD_1 + { + [FieldOffset(0)] + public short datano; /* data number */ + [FieldOffset(2)] + public short type; /* axis number */ + [FieldOffset(4)] + public byte cdata; /* parameter / setting data */ + [FieldOffset(4)] + public short idata; + [FieldOffset(4)] + public int ldata; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_2 + { + public short datano; /* data number */ + public short type; /* axis number */ + public REALPRM rdata = new REALPRM(); + } + [StructLayout(LayoutKind.Explicit)] + public class IODBPSD_3 + { + [FieldOffset(0)] + public short datano; /* data number */ + [FieldOffset(2)] + public short type; /* axis number */ + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas = new byte[MAX_AXIS]; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas = new short[MAX_AXIS]; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas = new int[MAX_AXIS]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_4 + { + public short datano; /* data number */ + public short type; /* axis number */ + public REALPRMS rdatas = new REALPRMS(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_A + { + public IODBPSD_1 data1 = new IODBPSD_1(); + public IODBPSD_1 data2 = new IODBPSD_1(); + public IODBPSD_1 data3 = new IODBPSD_1(); + public IODBPSD_1 data4 = new IODBPSD_1(); + public IODBPSD_1 data5 = new IODBPSD_1(); + public IODBPSD_1 data6 = new IODBPSD_1(); + public IODBPSD_1 data7 = new IODBPSD_1(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_B + { + public IODBPSD_2 data1 = new IODBPSD_2(); + public IODBPSD_2 data2 = new IODBPSD_2(); + public IODBPSD_2 data3 = new IODBPSD_2(); + public IODBPSD_2 data4 = new IODBPSD_2(); + public IODBPSD_2 data5 = new IODBPSD_2(); + public IODBPSD_2 data6 = new IODBPSD_2(); + public IODBPSD_2 data7 = new IODBPSD_2(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_C + { + public IODBPSD_3 data1 = new IODBPSD_3(); + public IODBPSD_3 data2 = new IODBPSD_3(); + public IODBPSD_3 data3 = new IODBPSD_3(); + public IODBPSD_3 data4 = new IODBPSD_3(); + public IODBPSD_3 data5 = new IODBPSD_3(); + public IODBPSD_3 data6 = new IODBPSD_3(); + public IODBPSD_3 data7 = new IODBPSD_3(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSD_D + { + public IODBPSD_4 data1 = new IODBPSD_4(); + public IODBPSD_4 data2 = new IODBPSD_4(); + public IODBPSD_4 data3 = new IODBPSD_4(); + public IODBPSD_4 data4 = new IODBPSD_4(); + public IODBPSD_4 data5 = new IODBPSD_4(); + public IODBPSD_4 data6 = new IODBPSD_4(); + public IODBPSD_4 data7 = new IODBPSD_4(); + } /* (sample) must be modified */ + + /* cnc_rdparam_ext:read parameters */ + /* cnc_rddiag_ext:read diagnosis data */ + /* cnc_start_async_wrparam:async parameter write start */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRMNO + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] prm = new int[10]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRM_data + { + public int prm_val; /* parameter / setting data */ + public int dec_val; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRM1 + { + public IODBPRM_data data1 = new IODBPRM_data(); + public IODBPRM_data data2 = new IODBPRM_data(); + public IODBPRM_data data3 = new IODBPRM_data(); + public IODBPRM_data data4 = new IODBPRM_data(); + public IODBPRM_data data5 = new IODBPRM_data(); + public IODBPRM_data data6 = new IODBPRM_data(); + public IODBPRM_data data7 = new IODBPRM_data(); + public IODBPRM_data data8 = new IODBPRM_data(); + public IODBPRM_data data9 = new IODBPRM_data(); + public IODBPRM_data data10 = new IODBPRM_data(); + public IODBPRM_data data11 = new IODBPRM_data(); + public IODBPRM_data data12 = new IODBPRM_data(); + public IODBPRM_data data13 = new IODBPRM_data(); + public IODBPRM_data data14 = new IODBPRM_data(); + public IODBPRM_data data15 = new IODBPRM_data(); + public IODBPRM_data data16 = new IODBPRM_data(); + public IODBPRM_data data17 = new IODBPRM_data(); + public IODBPRM_data data18 = new IODBPRM_data(); + public IODBPRM_data data19 = new IODBPRM_data(); + public IODBPRM_data data20 = new IODBPRM_data(); + public IODBPRM_data data21 = new IODBPRM_data(); + public IODBPRM_data data22 = new IODBPRM_data(); + public IODBPRM_data data23 = new IODBPRM_data(); + public IODBPRM_data data24 = new IODBPRM_data(); + public IODBPRM_data data25 = new IODBPRM_data(); + public IODBPRM_data data26 = new IODBPRM_data(); + public IODBPRM_data data27 = new IODBPRM_data(); + public IODBPRM_data data28 = new IODBPRM_data(); + public IODBPRM_data data29 = new IODBPRM_data(); + public IODBPRM_data data30 = new IODBPRM_data(); + public IODBPRM_data data31 = new IODBPRM_data(); + public IODBPRM_data data32 = new IODBPRM_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRM2 + { + public int datano; /* data number */ + public short type; /* data type */ + public short axis; /* axis information */ + public short info; /* misc information */ + public short unit; /* unit information */ + public IODBPRM1 data = new IODBPRM1(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRM + { + public IODBPRM2 prm1 = new IODBPRM2(); + public IODBPRM2 prm2 = new IODBPRM2(); + public IODBPRM2 prm3 = new IODBPRM2(); + public IODBPRM2 prm4 = new IODBPRM2(); + public IODBPRM2 prm5 = new IODBPRM2(); + public IODBPRM2 prm6 = new IODBPRM2(); + public IODBPRM2 prm7 = new IODBPRM2(); + public IODBPRM2 prm8 = new IODBPRM2(); + public IODBPRM2 prm9 = new IODBPRM2(); + public IODBPRM2 prm10 = new IODBPRM2(); + } /* In case that the number of alarm is 10 */ + + /* cnc_rdpitchr:read pitch error compensation data(area specified) */ + /* cnc_wrpitchr:write pitch error compensation data(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPI + { + public short datano_s; /* start pitch number */ + public short dummy; /* dummy */ + public short datano_e; /* end pitch number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public sbyte[] data = new sbyte[5]; /* offset value */ + } /* In case that the number of data is 5 */ + + /* cnc_rdmacro:read custom macro variable */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBM + { + public short datano; /* variable number */ + public short dummy; /* dummy */ + public int mcr_val; /* macro variable */ + public short dec_val; /* decimal point */ + } + + /* cnc_rdmacror:read custom macro variables(area specified) */ + /* cnc_wrmacror:write custom macro variables(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMR_data + { + public int mcr_val; /* macro variable */ + public short dec_val; /* decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMR1 + { + public IODBMR_data data1 = new IODBMR_data(); + public IODBMR_data data2 = new IODBMR_data(); + public IODBMR_data data3 = new IODBMR_data(); + public IODBMR_data data4 = new IODBMR_data(); + public IODBMR_data data5 = new IODBMR_data(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMR + { + public short datano_s; /* start macro number */ + public short dummy; /* dummy */ + public short datano_e; /* end macro number */ + public IODBMR1 data = new IODBMR1(); + } + + /* cnc_rdpmacro:read P code macro variable */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPM + { + public int datano; /* variable number */ + public short dummy; /* dummy */ + public int mcr_val; /* macro variable */ + public short dec_val; /* decimal point */ + } + + /* cnc_rdpmacror:read P code macro variables(area specified) */ + /* cnc_wrpmacror:write P code macro variables(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPR_data + { + public int mcr_val; /* macro variable */ + public short dec_val; /* decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPR1 + { + public IODBPR_data data1 = new IODBPR_data(); + public IODBPR_data data2 = new IODBPR_data(); + public IODBPR_data data3 = new IODBPR_data(); + public IODBPR_data data4 = new IODBPR_data(); + public IODBPR_data data5 = new IODBPR_data(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPR + { + public int datano_s; /* start macro number */ + public short dummy; /* dummy */ + public int datano_e; /* end macro number */ + public IODBPR1 data = new IODBPR1(); + } + + /* cnc_rdtofsinfo:read tool offset information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLINF + { + public short ofs_type; + public short use_no; + } + + /* cnc_rdtofsinfo2:read tool offset information(2) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLINF2 + { + public short ofs_type; + public short use_no; + public short ofs_enable; + } + + /* cnc_rdmacroinfo:read custom macro variable information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMVINF + { + public short use_no1; + public short use_no2; + } + + /* cnc_rdpmacroinfo:read P code macro variable information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMINF + { + public short use_no1; +#if PCD_UWORD + public ushort use_no2; +#else + public short use_no2; +#endif + public short v2_type; + } + + /* cnc_tofs_rnge:read validity of tool offset */ + /* cnc_zofs_rnge:read validity of work zero offset */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDATRNG + { + public int data_min; /* lower limit */ + public int data_max; /* upper limit */ + public int status; /* status of setting */ + } + + /* cnc_rdhsprminfo:read the information for function cnc_rdhsparam() */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class HSPINFO_data + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data1 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data2 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data3 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data4 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data5 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data6 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data7 = new byte[16]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] data8 = new byte[16]; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class HSPINFO + { + public HSPINFO_data prminfo1 = new HSPINFO_data(); + public HSPINFO_data prminfo2 = new HSPINFO_data(); + public HSPINFO_data prminfo3 = new HSPINFO_data(); + public HSPINFO_data prminfo4 = new HSPINFO_data(); + public HSPINFO_data prminfo5 = new HSPINFO_data(); + public HSPINFO_data prminfo6 = new HSPINFO_data(); + public HSPINFO_data prminfo7 = new HSPINFO_data(); + public HSPINFO_data prminfo8 = new HSPINFO_data(); + public HSPINFO_data prminfo9 = new HSPINFO_data(); + public HSPINFO_data prminfo10 = new HSPINFO_data(); + } + + /* cnc_rdhsparam:read parameters at the high speed */ + [StructLayout(LayoutKind.Explicit)] + public class HSPDATA_1 + { + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas1 = new byte[MAX_AXIS]; + [FieldOffset(4 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas2 = new byte[MAX_AXIS]; + [FieldOffset(4 * 2 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas3 = new byte[MAX_AXIS]; + [FieldOffset(4 * 3 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas4 = new byte[MAX_AXIS]; + [FieldOffset(4 * 4 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas5 = new byte[MAX_AXIS]; + [FieldOffset(4 * 5 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas6 = new byte[MAX_AXIS]; + [FieldOffset(4 * 6 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas7 = new byte[MAX_AXIS]; + [FieldOffset(4 * 7 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas8 = new byte[MAX_AXIS]; + [FieldOffset(4 * 8 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas9 = new byte[MAX_AXIS]; + [FieldOffset(4 * 9 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas10 = new byte[MAX_AXIS]; + } + + [StructLayout(LayoutKind.Explicit)] + public class HSPDATA_2 + { + [FieldOffset(0), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas1 = new short[MAX_AXIS]; + [FieldOffset(2 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas2 = new short[MAX_AXIS]; + [FieldOffset(2 * 2 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas3 = new short[MAX_AXIS]; + [FieldOffset(2 * 3 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas4 = new short[MAX_AXIS]; + [FieldOffset(2 * 4 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas5 = new short[MAX_AXIS]; + [FieldOffset(2 * 5 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas6 = new short[MAX_AXIS]; + [FieldOffset(2 * 6 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas7 = new short[MAX_AXIS]; + [FieldOffset(2 * 7 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas8 = new short[MAX_AXIS]; + [FieldOffset(2 * 8 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas9 = new short[MAX_AXIS]; + [FieldOffset(2 * 9 * MAX_AXIS), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas10 = new short[MAX_AXIS]; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class HSPDATA_3 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas1 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas2 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas3 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas4 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas5 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas6 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas7 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas8 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas9 = new int[MAX_AXIS]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas10 = new int[MAX_AXIS]; + } + + /*----------------------------------------*/ + /* CNC: Tool life management data related */ + // CNC:刀具寿命管理数据相关 + /*----------------------------------------*/ + + /* cnc_rdgrpid:read tool life management data(tool group number) */ + /// + /// 读取刀具寿命管理数据(刀具组编号) + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLIFE1 + { + public short dummy; /* dummy */ + public short type; /* data type */ + public int data; /* data */ + } + + /* cnc_rdngrp:read tool life management data(number of tool groups) */ + /// + /// 读取刀具寿命管理数据(刀具组数量) + /// + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLIFE2 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public int data; /* data */ + } + + /* cnc_rdntool:read tool life management data(number of tools) */ + //读取刀具寿命管理数据(刀具数量) + /* cnc_rdlife:read tool life management data(tool life) */ + //读取刀具寿命管理数据(刀具寿命) + /* cnc_rdcount:read tool life management data(tool lift counter) */ + //读取工具寿命管理数据(刀具提升计数器) + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLIFE3 + { + public short datano; /* data number */ + public short dummy; /* dummy */ + public int data; /* data */ + } + + /* cnc_rd1length:read tool life management data(tool length number-1) 读取刀具寿命管理数据(刀具长度编号-1)*/ + /* cnc_rd2length:read tool life management data(tool length number-2) 读取刀具寿命管理数据(刀具长度编号-2)*/ + /* cnc_rd1radius:read tool life management data(cutter compensation no.-1) 读取刀具寿命管理数据(刀具补偿编号-1)*/ + /* cnc_rd2radius:read tool life management data(cutter compensation no.-2) 读取刀具寿命管理数据(刀具补偿编号-2)*/ + /* cnc_t1info:read tool life management data(tool information-1) 读取刀具寿命管理数据(刀具信息-1) */ + /* cnc_t2info:read tool life management data(tool information-2) 读取刀具寿命管理数据(刀具信息-2)*/ + /* cnc_toolnum:read tool life management data(tool number) 读取刀具寿命管理数据(刀具编号)*/ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLIFE4 + { + public short datano; /* data number */ + public short type; /* data type */ + public int data; /* data */ + } + + /* cnc_rdgrpid2:read tool life management data(tool group number) 2 读取刀具寿命管理数据(刀具组编号)2*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLIFE5 + { + public int dummy; /* dummy */ + public int type; /* data type */ + public int data; /* data */ + } + + /* cnc_rdtoolrng:read tool life management data(tool number, tool life, tool life counter)(area specified) 读取刀具寿命管理数据(刀具编号、刀具寿命、刀具寿命计数器)(指定区域)*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTR_data + { + public int ntool; /* tool number */ + public int life; /* tool life */ + public int count; /* tool life counter */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTR1 + { + public IODBTR_data data1 = new IODBTR_data(); + public IODBTR_data data2 = new IODBTR_data(); + public IODBTR_data data3 = new IODBTR_data(); + public IODBTR_data data4 = new IODBTR_data(); + public IODBTR_data data5 = new IODBTR_data(); + public IODBTR_data data6 = new IODBTR_data(); + public IODBTR_data data7 = new IODBTR_data(); + public IODBTR_data data8 = new IODBTR_data(); + public IODBTR_data data9 = new IODBTR_data(); + public IODBTR_data data10 = new IODBTR_data(); + public IODBTR_data data11 = new IODBTR_data(); + public IODBTR_data data12 = new IODBTR_data(); + public IODBTR_data data13 = new IODBTR_data(); + public IODBTR_data data14 = new IODBTR_data(); + public IODBTR_data data15 = new IODBTR_data(); + public IODBTR_data data16 = new IODBTR_data(); + public IODBTR_data data17 = new IODBTR_data(); + public IODBTR_data data18 = new IODBTR_data(); + public IODBTR_data data19 = new IODBTR_data(); + public IODBTR_data data20 = new IODBTR_data(); + public IODBTR_data data21 = new IODBTR_data(); + public IODBTR_data data22 = new IODBTR_data(); + public IODBTR_data data23 = new IODBTR_data(); + public IODBTR_data data24 = new IODBTR_data(); + public IODBTR_data data25 = new IODBTR_data(); + public IODBTR_data data26 = new IODBTR_data(); + public IODBTR_data data27 = new IODBTR_data(); + public IODBTR_data data28 = new IODBTR_data(); + public IODBTR_data data29 = new IODBTR_data(); + public IODBTR_data data30 = new IODBTR_data(); + public IODBTR_data data31 = new IODBTR_data(); + public IODBTR_data data32 = new IODBTR_data(); + + } /* In case that the number of data is 5 如果数据数为5*/ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTR + { + public short datano_s; /* start group number */ + public short dummy; /* dummy */ + public short datano_e; /* end group number */ + public IODBTR1 data = new IODBTR1(); + } + + /* cnc_rdtoolgrp:read tool life management data(all data within group) 读取刀具寿命管理数据(组内所有数据) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTG_data + { + public int tuse_num; /* tool number */ + public int tool_num; /* tool life */ + public int length_num; /* tool life counter */ + public int radius_num; /* tool life counter */ + public int tinfo; /* tool life counter */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTG1 + { + public ODBTG_data data1 = new ODBTG_data(); + public ODBTG_data data2 = new ODBTG_data(); + public ODBTG_data data3 = new ODBTG_data(); + public ODBTG_data data4 = new ODBTG_data(); + public ODBTG_data data5 = new ODBTG_data(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTG + { + public short grp_num; /* start group number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy; /* dummy */ + public int ntool; /* tool number */ + public int life; /* tool life */ + public int count; /* tool life counter */ + public ODBTG1 data = new ODBTG1(); + } + + /* cnc_wrcountr:write tool life management data(tool life counter) (area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBWRC_data + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] dummy; /* dummy */ + public int count; /* tool life counter */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBWRC1 + { + public IDBWRC_data data1 = new IDBWRC_data(); + public IDBWRC_data data2 = new IDBWRC_data(); + public IDBWRC_data data3 = new IDBWRC_data(); + public IDBWRC_data data4 = new IDBWRC_data(); + public IDBWRC_data data5 = new IDBWRC_data(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBWRC + { + public short datano_s; /* start group number */ + public short dummy; /* dummy */ + public short datano_e; /* end group number */ + public IDBWRC1 data = new IDBWRC1(); + } + + /* cnc_rdusegrpid:read tool life management data(used tool group number) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBUSEGR + { + public short datano; /* dummy */ + public short type; /* dummy */ + public int next; /* next use group number */ + public int use; /* using group number */ + public int slct; /* selecting group number */ + } + + /* cnc_rdmaxgrp:read tool life management data(max. number of tool groups) */ + /* cnc_rdmaxtool:read tool life management data(maximum number of tool within group) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBLFNO + { + public short datano; /* dummy */ + public short type; /* dummy */ + public short data; /* number of data */ + } + + /* cnc_rdusetlno:read tool life management data(used tool no within group) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLUSE + { + public short s_grp; /* start group number */ + public short dummy; /* dummy */ + public short e_grp; /* end group number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] data; /* tool using number */ + } /* In case that the number of group is 5 */ + + /* cnc_rd1tlifedata:read tool life management data(tool data1) */ + /* cnc_rd2tlifedata:read tool life management data(tool data2) */ + /* cnc_wr1tlifedata:write tool life management data(tool data1) */ + /* cnc_wr2tlifedata:write tool life management data(tool data2) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTD + { + public short datano; /* tool group number */ + public short type; /* tool using number */ + public int tool_num; /* tool number */ + public int h_code; /* H code */ + public int d_code; /* D code */ + public int tool_inf; /* tool information */ + } + + /* cnc_rd1tlifedat2:read tool life management data(tool data1) 2 */ + /* cnc_wr1tlifedat2:write tool life management data(tool data1) 2 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTD2 + { + public short datano; /* tool group number */ + public short dummy; /* dummy */ + public int type; /* tool using number */ + public int tool_num; /* tool number */ + public int h_code; /* H code */ + public int d_code; /* D code */ + public int tool_inf; /* tool information */ + } + + /* cnc_rdgrpinfo:read tool life management data(tool group information) */ + /* cnc_wrgrpinfo:write tool life management data(tool group information) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI_data + { + public int n_tool; /* number of tool */ + public int count_value; /* tool life */ + public int counter; /* tool life counter */ + public int count_type; /* tool life counter type */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI1 + { + public IODBTGI_data data1 = new IODBTGI_data(); + public IODBTGI_data data2 = new IODBTGI_data(); + public IODBTGI_data data3 = new IODBTGI_data(); + public IODBTGI_data data4 = new IODBTGI_data(); + public IODBTGI_data data5 = new IODBTGI_data(); + } /* In case that the number of data is 5 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI + { + public short s_grp; /* start group number */ + public short dummy; /* dummy */ + public short e_grp; /* end group number */ + public IODBTGI1 data = new IODBTGI1(); + } + + /* cnc_rdgrpinfo2:read tool life management data(tool group information 2) */ + /* cnc_wrgrpinfo2:write tool life management data(tool group information 2) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI2 + { + public short s_grp; /* start group number */ + public short dummy; /* dummy */ + public short e_grp; /* end group number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] opt_grpno = new int[5]; /* optional group number of tool */ + } /* In case that the number of group is 5 */ + + /* cnc_rdgrpinfo3:read tool life management data(tool group information 3) */ + /* cnc_wrgrpinfo3:write tool life management data(tool group information 3) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI3 + { + public short s_grp; /* start group number */ + public short dummy; /* dummy */ + public short e_grp; /* end group number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] life_rest = new int[5]; /* tool life rest count */ + } /* In case that the number of group is 5 */ + + /* cnc_rdgrpinfo4:read tool life management data(tool group information 4) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTGI4 + { + public short grp_no; + public int n_tool; + public int count_value; + public int counter; + public int count_type; + public int opt_grpno; + public int life_rest; + } + + /* cnc_instlifedt:insert tool life management data(tool data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBITD + { + public short datano; /* tool group number */ + public short type; /* tool using number */ + public int data; /* tool number */ + } + + /* cnc_rdtlinfo:read tool life management data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBTLINFO + { + public int max_group; /* maximum number of tool groups */ + public int max_tool; /* maximum number of tool within group */ + public int max_minute; /* maximum number of life count (minutes) */ + public int max_cycle; /* maximum number of life count (cycles) */ + } + + /* cnc_rdtlusegrp:read tool life management data(used tool group number) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBUSEGRP + { + public int next; /* next use group number */ + public int use; /* using group number */ + public int slct; /* selecting group number */ + public int opt_next; /* next use optional group number */ + public int opt_use; /* using optional group number */ + public int opt_slct; /* selecting optional group number */ + } + + /* cnc_rdtlgrp:read tool life management data(tool group information 2) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLGRP_data + { + public int ntool; /* number of all tool */ + public int nfree; /* number of free tool */ + public int life; /* tool life */ + public int count; /* tool life counter */ + public int use_tool; /* using tool number */ + public int opt_grpno; /* optional group number */ + public int life_rest; /* tool life rest count */ + public short rest_sig; /* tool life rest signal */ + public short count_type; /* tool life counter type */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLGRP + { + public IODBTLGRP_data data1 = new IODBTLGRP_data(); + public IODBTLGRP_data data2 = new IODBTLGRP_data(); + public IODBTLGRP_data data3 = new IODBTLGRP_data(); + public IODBTLGRP_data data4 = new IODBTLGRP_data(); + public IODBTLGRP_data data5 = new IODBTLGRP_data(); + } /* In case that the number of group is 5 */ + + /* cnc_rdtltool:read tool life management data (tool data1) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLTOOL_data + { + public int tool_num; /* tool number */ + public int h_code; /* H code */ + public int d_code; /* D code */ + public int tool_inf; /* tool information */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLTOOL + { + public IODBTLTOOL_data data1 = new IODBTLTOOL_data(); + public IODBTLTOOL_data data2 = new IODBTLTOOL_data(); + public IODBTLTOOL_data data3 = new IODBTLTOOL_data(); + public IODBTLTOOL_data data4 = new IODBTLTOOL_data(); + public IODBTLTOOL_data data5 = new IODBTLTOOL_data(); + } /* In case that the number of group is 5 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXGP_data + { + public int grp_no; /* group number */ + public int opt_grpno; /* optional group number */ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXGP + { + public ODBEXGP_data data1 = new ODBEXGP_data(); + public ODBEXGP_data data2 = new ODBEXGP_data(); + public ODBEXGP_data data3 = new ODBEXGP_data(); + public ODBEXGP_data data4 = new ODBEXGP_data(); + public ODBEXGP_data data5 = new ODBEXGP_data(); + public ODBEXGP_data data6 = new ODBEXGP_data(); + public ODBEXGP_data data7 = new ODBEXGP_data(); + public ODBEXGP_data data8 = new ODBEXGP_data(); + public ODBEXGP_data data9 = new ODBEXGP_data(); + public ODBEXGP_data data10 = new ODBEXGP_data(); + public ODBEXGP_data data11 = new ODBEXGP_data(); + public ODBEXGP_data data12 = new ODBEXGP_data(); + public ODBEXGP_data data13 = new ODBEXGP_data(); + public ODBEXGP_data data14 = new ODBEXGP_data(); + public ODBEXGP_data data15 = new ODBEXGP_data(); + public ODBEXGP_data data16 = new ODBEXGP_data(); + public ODBEXGP_data data17 = new ODBEXGP_data(); + public ODBEXGP_data data18 = new ODBEXGP_data(); + public ODBEXGP_data data19 = new ODBEXGP_data(); + public ODBEXGP_data data20 = new ODBEXGP_data(); + public ODBEXGP_data data21 = new ODBEXGP_data(); + public ODBEXGP_data data22 = new ODBEXGP_data(); + public ODBEXGP_data data23 = new ODBEXGP_data(); + public ODBEXGP_data data24 = new ODBEXGP_data(); + public ODBEXGP_data data25 = new ODBEXGP_data(); + public ODBEXGP_data data26 = new ODBEXGP_data(); + public ODBEXGP_data data27 = new ODBEXGP_data(); + public ODBEXGP_data data28 = new ODBEXGP_data(); + public ODBEXGP_data data29 = new ODBEXGP_data(); + public ODBEXGP_data data30 = new ODBEXGP_data(); + public ODBEXGP_data data31 = new ODBEXGP_data(); + public ODBEXGP_data data32 = new ODBEXGP_data(); + } + + /*-----------------------------------*/ + /* CNC: Tool management data related */ + /*-----------------------------------*/ + + /* cnc_regtool:new registration of tool management data */ + /* cnc_rdtool:lead of tool management data */ + /* cnc_wrtool:write of tool management data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMNG_data + { + public int T_code; + public int life_count; + public int max_life; + public int rest_life; + public byte life_stat; + public byte cust_bits; + public ushort tool_info; + public short H_code; + public short D_code; + public int spindle_speed; + public int feedrate; + public short magazine; + public short pot; + public short gno; + public short m_ofs; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public int[] reserved = new int[4]; + public int custom1; + public int custom2; + public int custom3; + public int custom4; + public int custom5; + public int custom6; + public int custom7; + public int custom8; + public int custom9; + public int custom10; + public int custom11; + public int custom12; + public int custom13; + public int custom14; + public int custom15; + public int custom16; + public int custom17; + public int custom18; + public int custom19; + public int custom20; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMNG + { + public IODBTLMNG_data data1 = new IODBTLMNG_data(); + public IODBTLMNG_data data2 = new IODBTLMNG_data(); + public IODBTLMNG_data data3 = new IODBTLMNG_data(); + public IODBTLMNG_data data4 = new IODBTLMNG_data(); + public IODBTLMNG_data data5 = new IODBTLMNG_data(); + } /* In case that the number of group is 5 */ + + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMNG_F2_data + { + public int T_code; + public int life_count; + public int max_life; + public int rest_life; + public byte life_stat; + public byte cust_bits; + public ushort tool_info; + public short H_code; + public short D_code; + public int spindle_speed; + public int feedrate; + public short magazine; + public short pot; + public short G_code; + public short W_code; + public short gno; + public short m_ofs; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public int[] reserved; + public int custom1; + public int custom2; + public int custom3; + public int custom4; + public int custom5; + public int custom6; + public int custom7; + public int custom8; + public int custom9; + public int custom10; + public int custom11; + public int custom12; + public int custom13; + public int custom14; + public int custom15; + public int custom16; + public int custom17; + public int custom18; + public int custom19; + public int custom20; + public int custom21; + public int custom22; + public int custom23; + public int custom24; + public int custom25; + public int custom26; + public int custom27; + public int custom28; + public int custom29; + public int custom30; + public int custom31; + public int custom32; + public int custom33; + public int custom34; + public int custom35; + public int custom36; + public int custom37; + public int custom38; + public int custom39; + public int custom40; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMNG_F2 + { + public IODBTLMNG_F2_data data1 = new IODBTLMNG_F2_data(); + public IODBTLMNG_F2_data data2 = new IODBTLMNG_F2_data(); + public IODBTLMNG_F2_data data3 = new IODBTLMNG_F2_data(); + public IODBTLMNG_F2_data data4 = new IODBTLMNG_F2_data(); + public IODBTLMNG_F2_data data5 = new IODBTLMNG_F2_data(); + } /* In case that the number of group is 5 */ + + /* cnc_wrtool2:write of individual data of tool management data */ + [StructLayout(LayoutKind.Explicit)] + public class IDBTLM_item + { + [FieldOffset(0)] + public sbyte data1; + [FieldOffset(0)] + public short data2; + [FieldOffset(0)] + public int data4; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBTLM + { + public short data_id; + public IDBTLM_item item = new IDBTLM_item(); + } + + /* cnc_regmagazine:new registration of magazine management data */ + /* cnc_rdmagazine:lead of magazine management data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMAG_data + { + public short magazine; + public short pot; + public short tool_index; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMAG + { + public IODBTLMAG_data data1 = new IODBTLMAG_data(); + public IODBTLMAG_data data2 = new IODBTLMAG_data(); + public IODBTLMAG_data data3 = new IODBTLMAG_data(); + public IODBTLMAG_data data4 = new IODBTLMAG_data(); + public IODBTLMAG_data data5 = new IODBTLMAG_data(); + } /* In case that the number of group is 5 */ + + /* cnc_delmagazine:deletion of magazine management data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMAG2_data + { + public short magazine; + public short pot; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLMAG2 + { + public IODBTLMAG2_data data1 = new IODBTLMAG2_data(); + public IODBTLMAG2_data data2 = new IODBTLMAG2_data(); + public IODBTLMAG2_data data3 = new IODBTLMAG2_data(); + public IODBTLMAG2_data data4 = new IODBTLMAG2_data(); + public IODBTLMAG2_data data5 = new IODBTLMAG2_data(); + } /* In case that the number of group is 5 */ + + + /*-------------------------------------*/ + /* CNC: Operation history data related */ + /*-------------------------------------*/ + + /* cnc_rdophistry:read operation history data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_ALM + { + public short rec_type; /* record type */ + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public sbyte axis_no; /* axis number */ + public sbyte dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MDI + { + public short rec_type; /* record type */ + public byte key_code; /* key code */ + public byte pw_flag; /* power on flag */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public sbyte[] dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_SGN + { + public short rec_type; /* record type */ + public sbyte sig_name; /* signal name */ + public byte sig_old; /* old signal bit pattern */ + public byte sig_new; /* new signal bit pattern */ + public sbyte dummy; + public short sig_no; /* signal number */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_DATE + { + public short rec_type; /* record type */ + public sbyte year; /* year */ + public sbyte month; /* month */ + public sbyte day; /* day */ + public sbyte pw_flag; /* power on flag */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public sbyte[] dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_TIME + { + public short rec_type; /* record flag */ + public sbyte hour; /* hour */ + public sbyte minute; /* minute */ + public sbyte second; /* second */ + public sbyte pw_flag; /* power on flag */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public sbyte[] dummy; + } + [StructLayout(LayoutKind.Explicit, Size = 8)] + public class ODBHIS_data + { + // record type + [FieldOffset(0)] + public short rec_type; /* record type */ + + // alarm record + [FieldOffset(0)] + public short alm_rec_type; /* record type */ + [FieldOffset(2)] + public short alm_alm_grp; /* alarm group */ + [FieldOffset(4)] + public short alm_alm_no; /* alarm number */ + [FieldOffset(6)] + public sbyte alm_axis_no; /* axis number */ + [FieldOffset(7)] + public sbyte alm_dummy; + + // mdi record + [FieldOffset(0)] + public short mdi_rec_type; /* record type */ + [FieldOffset(2)] + public byte mdi_key_code; /* key code */ + [FieldOffset(3)] + public byte mdi_pw_flag; /* power on flag */ + [FieldOffset(4)] + public sbyte mdi_dummy1; + [FieldOffset(5)] + public sbyte mdi_dummy2; + [FieldOffset(6)] + public sbyte mdi_dummy3; + [FieldOffset(7)] + public sbyte mdi_dummy4; + + // sign record + [FieldOffset(0)] + public short sgn_rec_type; /* record type */ + [FieldOffset(2)] + public sbyte sgn_sig_name; /* signal name */ + [FieldOffset(3)] + public byte sgn_sig_old; /* old signal bit pattern */ + [FieldOffset(4)] + public byte sgn_sig_new; /* new signal bit pattern */ + [FieldOffset(5)] + public sbyte sgn_dummy; + [FieldOffset(6)] + public short sgn_sig_no; /* signal number */ + + // date record + [FieldOffset(0)] + public short date_rec_type; /* record type */ + [FieldOffset(2)] + public sbyte date_year; /* year */ + [FieldOffset(3)] + public sbyte date_month; /* month */ + [FieldOffset(4)] + public sbyte date_day; /* day */ + [FieldOffset(5)] + public sbyte date_pw_flag; /* power on flag */ + [FieldOffset(6)] + public sbyte date_dummy1; + [FieldOffset(7)] + public sbyte date_dummy2; + + // time record + [FieldOffset(0)] + public short time_rec_type; /* record flag */ + [FieldOffset(2)] + public sbyte time_hour; /* hour */ + [FieldOffset(3)] + public sbyte time_minute; /* minute */ + [FieldOffset(4)] + public sbyte time_second; /* second */ + [FieldOffset(5)] + public sbyte time_pw_flag; /* power on flag */ + [FieldOffset(6)] + public sbyte time_dummy1; + [FieldOffset(7)] + public sbyte time_dummy2; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHIS1 + { + public ODBHIS_data data1 = new ODBHIS_data(); + public ODBHIS_data data2 = new ODBHIS_data(); + public ODBHIS_data data3 = new ODBHIS_data(); + public ODBHIS_data data4 = new ODBHIS_data(); + public ODBHIS_data data5 = new ODBHIS_data(); + public ODBHIS_data data6 = new ODBHIS_data(); + public ODBHIS_data data7 = new ODBHIS_data(); + public ODBHIS_data data8 = new ODBHIS_data(); + public ODBHIS_data data9 = new ODBHIS_data(); + public ODBHIS_data data10 = new ODBHIS_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHIS + { + public ushort s_no; /* start number */ + public short type; /* dummy */ + public ushort e_no; /* end number */ + public ODBHIS1 data = new ODBHIS1(); + } + + /* cnc_rdophistry2:read operation history data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MDI2 + { + public byte key_code; /* key code */ + public byte pw_flag; /* power on flag */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MDI2_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_MDI2 data = new REC_MDI2(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_SGN2 + { + public short sig_name; /* signal name */ + public short sig_no; /* signal number */ + public byte sig_old; /* old signal bit pattern */ + public byte sig_new; /* new signal bit pattern */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_SGN2_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_SGN2 data = new REC_SGN2(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_ALM2 + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_ALM2_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_ALM2 data = new REC_ALM2(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_DATE2 + { + public short evnt_type; /* event type */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_DATE2_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_DATE2 data = new REC_DATE2(); + } + [StructLayout(LayoutKind.Explicit)] + public class ODBOPHIS + { + [FieldOffset(0)] + public REC_MDI2_data rec_mdi = new REC_MDI2_data(); + [FieldOffset(0)] + public REC_SGN2_data rec_sgn = new REC_SGN2_data(); + [FieldOffset(0)] + public REC_ALM2_data rec_alm = new REC_ALM2_data(); + [FieldOffset(0)] + public REC_DATE2_data rec_date = new REC_DATE2_data(); + } + + /* cnc_rdophistry4:read operation history data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MDI4 + { + public char key_code; /* key code */ + public char pw_flag; /* power on flag */ + public short pth_no; /* path index */ + public short ex_flag; /* kxternal key flag */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MDI4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_MDI4 data = new REC_MDI4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_SGN4 + { + public short sig_name; /* signal name */ + public short sig_no; /* signal number */ + public char sig_old; /* old signal bit pattern */ + public char sig_new; /* new signal bit pattern */ + public short pmc_no; /* pmc index */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_SGN4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_SGN4 data = new REC_SGN4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_ALM4 + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_ALM4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_ALM4 data = new REC_ALM4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_DATE4 + { + public short evnt_type; /* event type */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_DATE4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_DATE4 data = new REC_DATE4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_IAL4 + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + public short sys_alm; /* sys alarm */ + public short dsp_flg; /* message dsp flag */ + public short axis_num; /* axis num */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] g_modal; /* G code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public char[] g_dp; /* #7:1 Block */ + /* #6乣#0 dp*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] a_modal; /* B,D,E,F,H,M,N,O,S,T code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public char[] a_dp; /* #7:1 Block */ + /* 6乣#0 dp*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] abs_pos; /* Abs pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public char[] abs_dp; /* Abs dp */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] mcn_pos; /* Mcn pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public char[] mcn_dp; /* Mcn dp */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_IAL4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_IAL4 data = new REC_IAL4(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class REC_MAL4 + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + public short sys_alm; /* sys alarm */ + public short dsp_flg; /* message dsp flag */ + public short axis_num; /* axis num */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string alm_msg = new string(' ', 64); /* alarm message */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] g_modal; /* G code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public char[] g_dp; /* #7:1 Block */ + /* #6乣#0 dp*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] a_modal; /* B,D,E,F,H,M,N,O,S,T code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public char[] a_dp; /* #7:1 Block */ + /* 6乣#0 dp*/ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] abs_pos; /* Abs pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public char[] abs_dp; /* Abs dp */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] mcn_pos; /* Mcn pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public char[] mcn_dp; /* Mcn dp */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MAL4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_MAL4 data = new REC_MAL4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_OPM4 + { + public short dsp_flg; /* Dysplay flag(ON/OFF) */ + public short om_no; /* message number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* Hour */ + public short minute; /* Minute */ + public short second; /* Second */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string ope_msg = new string(' ', 256); /* Messege */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_OPM4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_OPM4 data = new REC_OPM4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_OFS4 + { + public short ofs_grp; /* Tool offset group */ + public short ofs_no; /* Tool offset number */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + public int ofs_old; /* old data */ + public int ofs_new; /* new data */ + public short old_dp; /* old data decimal point */ + public short new_dp; /* new data decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_OFS4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_OFS4 data = new REC_OFS4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_PRM4 + { + public short prm_grp; /* paramater group */ + public short prm_num; /* paramater number */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short prm_len; /* paramater data length */ + public int prm_no; /* paramater no */ + public int prm_old; /* old data */ + public int prm_new; /* new data */ + public short old_dp; /* old data decimal point */ + public short new_dp; /* new data decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_PRM4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_PRM4 data = new REC_PRM4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_WOF4 + { + public short ofs_grp; /* Work offset group */ + public short ofs_no; /* Work offset number */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + public short axis_no; /* path axis num $*/ + public short dummy; + public int ofs_old; /* old data */ + public int ofs_new; /* new data */ + public short old_dp; /* old data decimal point */ + public short new_dp; /* new data decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_WOF4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_WOF4 data = new REC_WOF4(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MAC4 + { + public short mac_no; /* macro val number */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short pth_no; /* path index */ + public int mac_old; /* old data */ + public int mac_new; /* new data */ + public short old_dp; /* old data decimal point */ + public short new_dp; /* old data decimal point */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REC_MAC4_data + { + public short rec_len; /* length */ + public short rec_type; /* record type */ + public REC_MAC4 data = new REC_MAC4(); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_1 + { + public REC_MDI4_data rec_mdi1 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi2 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi3 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi4 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi5 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi6 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi7 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi8 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi9 = new REC_MDI4_data(); + public REC_MDI4_data rec_mdi10 = new REC_MDI4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_2 + { + public REC_SGN4_data rec_sgn1 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn2 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn3 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn4 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn5 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn6 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn7 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn8 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn9 = new REC_SGN4_data(); + public REC_SGN4_data rec_sgn10 = new REC_SGN4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_3 + { + public REC_ALM4_data rec_alm1 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm2 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm3 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm4 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm5 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm6 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm7 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm8 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm9 = new REC_ALM4_data(); + public REC_ALM4_data rec_alm10 = new REC_ALM4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_4 + { + public REC_DATE4_data rec_date1 = new REC_DATE4_data(); + public REC_DATE4_data rec_date2 = new REC_DATE4_data(); + public REC_DATE4_data rec_date3 = new REC_DATE4_data(); + public REC_DATE4_data rec_date4 = new REC_DATE4_data(); + public REC_DATE4_data rec_date5 = new REC_DATE4_data(); + public REC_DATE4_data rec_date6 = new REC_DATE4_data(); + public REC_DATE4_data rec_date7 = new REC_DATE4_data(); + public REC_DATE4_data rec_date8 = new REC_DATE4_data(); + public REC_DATE4_data rec_date9 = new REC_DATE4_data(); + public REC_DATE4_data rec_date10 = new REC_DATE4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_5 + { + public REC_IAL4_data rec_ial1 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial2 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial3 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial4 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial5 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial6 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial7 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial8 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial9 = new REC_IAL4_data(); + public REC_IAL4_data rec_ial10 = new REC_IAL4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_6 + { + public REC_MAL4_data rec_mal1 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal2 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal3 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal4 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal5 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal6 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal7 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal8 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal9 = new REC_MAL4_data(); + public REC_MAL4_data rec_mal10 = new REC_MAL4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_7 + { + public REC_OPM4_data rec_opm1 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm2 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm3 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm4 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm5 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm6 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm7 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm8 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm9 = new REC_OPM4_data(); + public REC_OPM4_data rec_opm10 = new REC_OPM4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_8 + { + public REC_OFS4_data rec_ofs1 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs2 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs3 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs4 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs5 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs6 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs7 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs8 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs9 = new REC_OFS4_data(); + public REC_OFS4_data rec_ofs10 = new REC_OFS4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_9 + { + public REC_PRM4_data rec_prm1 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm2 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm3 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm4 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm5 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm6 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm7 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm8 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm9 = new REC_PRM4_data(); + public REC_PRM4_data rec_prm10 = new REC_PRM4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_10 + { + public REC_WOF4_data rec_wof1 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof2 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof3 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof4 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof5 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof6 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof7 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof8 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof9 = new REC_WOF4_data(); + public REC_WOF4_data rec_wof10 = new REC_WOF4_data(); + } /* In case that the number of data is 10 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOPHIS4_11 + { + public REC_MAC4_data rec_mac1 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac2 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac3 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac4 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac5 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac6 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac7 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac8 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac9 = new REC_MAC4_data(); + public REC_MAC4_data rec_mac10 = new REC_MAC4_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdalmhistry:read alarm history data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ALM_HIS_data + { + public short dummy; + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public byte axis_no; /* axis number */ + public byte year; /* year */ + public byte month; /* month */ + public byte day; /* day */ + public byte hour; /* hour */ + public byte minute; /* minute */ + public byte second; /* second */ + public byte dummy2; + public short len_msg; /* alarm message length */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string alm_msg = new string(' ', 32); /* alarm message */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALM_HIS1 + { + public ALM_HIS_data data1 = new ALM_HIS_data(); + public ALM_HIS_data data2 = new ALM_HIS_data(); + public ALM_HIS_data data3 = new ALM_HIS_data(); + public ALM_HIS_data data4 = new ALM_HIS_data(); + public ALM_HIS_data data5 = new ALM_HIS_data(); + public ALM_HIS_data data6 = new ALM_HIS_data(); + public ALM_HIS_data data7 = new ALM_HIS_data(); + public ALM_HIS_data data8 = new ALM_HIS_data(); + public ALM_HIS_data data9 = new ALM_HIS_data(); + public ALM_HIS_data data10 = new ALM_HIS_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAHIS + { + public ushort s_no; /* start number */ + public short type; /* dummy */ + public ushort e_no; /* end number */ + public ALM_HIS1 alm_his = new ALM_HIS1(); + } + + /* cnc_rdalmhistry2:read alarm history data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ALM_HIS2_data + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short len_msg; /* alarm message length */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string alm_msg = new string(' ', 32); /* alarm message */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALM_HIS2 + { + public ALM_HIS2_data data1 = new ALM_HIS2_data(); + public ALM_HIS2_data data2 = new ALM_HIS2_data(); + public ALM_HIS2_data data3 = new ALM_HIS2_data(); + public ALM_HIS2_data data4 = new ALM_HIS2_data(); + public ALM_HIS2_data data5 = new ALM_HIS2_data(); + public ALM_HIS2_data data6 = new ALM_HIS2_data(); + public ALM_HIS2_data data7 = new ALM_HIS2_data(); + public ALM_HIS2_data data8 = new ALM_HIS2_data(); + public ALM_HIS2_data data9 = new ALM_HIS2_data(); + public ALM_HIS2_data data10 = new ALM_HIS2_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAHIS2 + { + public ushort s_no; /* start number */ + public ushort e_no; /* end number */ + public ALM_HIS2 alm_his = new ALM_HIS2(); + } + + /* cnc_rdalmhistry3:read alarm history data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ALM_HIS3_data + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short len_msg; /* alarm message length */ + public short pth_no; /* path index */ + public short dummy; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string alm_msg = new string(' ', 32); /* alarm message */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALM_HIS3 + { + public ALM_HIS3_data data1 = new ALM_HIS3_data(); + public ALM_HIS3_data data2 = new ALM_HIS3_data(); + public ALM_HIS3_data data3 = new ALM_HIS3_data(); + public ALM_HIS3_data data4 = new ALM_HIS3_data(); + public ALM_HIS3_data data5 = new ALM_HIS3_data(); + public ALM_HIS3_data data6 = new ALM_HIS3_data(); + public ALM_HIS3_data data7 = new ALM_HIS3_data(); + public ALM_HIS3_data data8 = new ALM_HIS3_data(); + public ALM_HIS3_data data9 = new ALM_HIS3_data(); + public ALM_HIS3_data data10 = new ALM_HIS3_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAHIS3 + { + public ushort s_no; /* start number */ + public ushort e_no; /* end number */ + public ALM_HIS3 alm_his = new ALM_HIS3(); + } + + /* cnc_rdalmhistry5:read alarm history data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ALM_HIS5_data + { + public short alm_grp; /* alarm group */ + public short alm_no; /* alarm number */ + public short axis_no; /* axis number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* minute */ + public short second; /* second */ + public short len_msg; /* alarm message length */ + public short pth_no; /* path index */ + public short dummy; /* dummy */ + public short dsp_flg; /* Flag for displaying */ + public short axis_num; /* Total axis number */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string alm_msg = new string(' ', 64); /* alarm message */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] g_modal; /* G code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public byte[] g_dp; /* #7:1 Block #6乣#0 dp */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public int[] a_modal; /* B,D,E,F,H,M,N,O,S,T code Modal */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public byte[] a_dp; /* #7:1 Block #6乣#0 dp */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] abs_pos; /* Abs pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] abs_dp; /* Abs dp */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public int[] mcn_pos; /* Mcn pos */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] mcn_dp; /* Mcn dp */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALM_HIS5 + { + public ALM_HIS5_data data1 = new ALM_HIS5_data(); + public ALM_HIS5_data data2 = new ALM_HIS5_data(); + public ALM_HIS5_data data3 = new ALM_HIS5_data(); + public ALM_HIS5_data data4 = new ALM_HIS5_data(); + public ALM_HIS5_data data5 = new ALM_HIS5_data(); + public ALM_HIS5_data data6 = new ALM_HIS5_data(); + public ALM_HIS5_data data7 = new ALM_HIS5_data(); + public ALM_HIS5_data data8 = new ALM_HIS5_data(); + public ALM_HIS5_data data9 = new ALM_HIS5_data(); + public ALM_HIS5_data data10 = new ALM_HIS5_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAHIS5 + { + public ushort s_no; /* start number */ + public ushort e_no; /* end number */ + public ALM_HIS5 alm_his = new ALM_HIS5(); + } + + /* cnc_rdomhistry2:read operater message history data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBOMHIS2_data + { + public short dsp_flg; /* Dysplay flag(ON/OFF) */ + public short om_no; /* operater message number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* Hour */ + public short minute; /* Minute */ + public short second; /* Second */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string alm_msg = new string(' ', 256); /* alarm message */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OPM_HIS + { + public ODBOMHIS2_data data1 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data2 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data3 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data4 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data5 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data6 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data7 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data8 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data9 = new ODBOMHIS2_data(); + public ODBOMHIS2_data data10 = new ODBOMHIS2_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOMHIS2 + { + public ushort s_no; /* start number */ + public ushort e_no; /* end number */ + public OPM_HIS opm_his = new OPM_HIS(); + } + + /* cnc_rdhissgnl:read signals related operation history */ + /* cnc_wrhissgnl:write signals related operation history */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBSIG_data + { + public short ent_no; /* entry number */ + public short sig_no; /* signal number */ + public byte sig_name; /* signal name */ + public byte mask_pat; /* signal mask pattern */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG1 + { + public IODBSIG_data data1 = new IODBSIG_data(); + public IODBSIG_data data2 = new IODBSIG_data(); + public IODBSIG_data data3 = new IODBSIG_data(); + public IODBSIG_data data4 = new IODBSIG_data(); + public IODBSIG_data data5 = new IODBSIG_data(); + public IODBSIG_data data6 = new IODBSIG_data(); + public IODBSIG_data data7 = new IODBSIG_data(); + public IODBSIG_data data8 = new IODBSIG_data(); + public IODBSIG_data data9 = new IODBSIG_data(); + public IODBSIG_data data10 = new IODBSIG_data(); + public IODBSIG_data data11 = new IODBSIG_data(); + public IODBSIG_data data12 = new IODBSIG_data(); + public IODBSIG_data data13 = new IODBSIG_data(); + public IODBSIG_data data14 = new IODBSIG_data(); + public IODBSIG_data data15 = new IODBSIG_data(); + public IODBSIG_data data16 = new IODBSIG_data(); + public IODBSIG_data data17 = new IODBSIG_data(); + public IODBSIG_data data18 = new IODBSIG_data(); + public IODBSIG_data data19 = new IODBSIG_data(); + public IODBSIG_data data20 = new IODBSIG_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG + { + public short datano; /* dummy */ + public short type; /* dummy */ + public IODBSIG1 data = new IODBSIG1(); + } + + /* cnc_rdhissgnl2:read signals related operation history 2 */ + /* cnc_wrhissgnl2:write signals related operation history 2 */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class _IODBSIG2_data + { + public short ent_no; /* entry number */ + public short sig_no; /* signal number */ + public byte sig_name; /* signal name */ + public byte mask_pat; /* signal mask pattern */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG2_data + { + public _IODBSIG2_data data1 = new _IODBSIG2_data(); + public _IODBSIG2_data data2 = new _IODBSIG2_data(); + public _IODBSIG2_data data3 = new _IODBSIG2_data(); + public _IODBSIG2_data data4 = new _IODBSIG2_data(); + public _IODBSIG2_data data5 = new _IODBSIG2_data(); + public _IODBSIG2_data data6 = new _IODBSIG2_data(); + public _IODBSIG2_data data7 = new _IODBSIG2_data(); + public _IODBSIG2_data data8 = new _IODBSIG2_data(); + public _IODBSIG2_data data9 = new _IODBSIG2_data(); + public _IODBSIG2_data data10 = new _IODBSIG2_data(); + public _IODBSIG2_data data11 = new _IODBSIG2_data(); + public _IODBSIG2_data data12 = new _IODBSIG2_data(); + public _IODBSIG2_data data13 = new _IODBSIG2_data(); + public _IODBSIG2_data data14 = new _IODBSIG2_data(); + public _IODBSIG2_data data15 = new _IODBSIG2_data(); + public _IODBSIG2_data data16 = new _IODBSIG2_data(); + public _IODBSIG2_data data17 = new _IODBSIG2_data(); + public _IODBSIG2_data data18 = new _IODBSIG2_data(); + public _IODBSIG2_data data19 = new _IODBSIG2_data(); + public _IODBSIG2_data data20 = new _IODBSIG2_data(); + public _IODBSIG2_data data31 = new _IODBSIG2_data(); + public _IODBSIG2_data data32 = new _IODBSIG2_data(); + public _IODBSIG2_data data33 = new _IODBSIG2_data(); + public _IODBSIG2_data data34 = new _IODBSIG2_data(); + public _IODBSIG2_data data35 = new _IODBSIG2_data(); + public _IODBSIG2_data data36 = new _IODBSIG2_data(); + public _IODBSIG2_data data37 = new _IODBSIG2_data(); + public _IODBSIG2_data data38 = new _IODBSIG2_data(); + public _IODBSIG2_data data39 = new _IODBSIG2_data(); + public _IODBSIG2_data data40 = new _IODBSIG2_data(); + public _IODBSIG2_data data41 = new _IODBSIG2_data(); + public _IODBSIG2_data data42 = new _IODBSIG2_data(); + public _IODBSIG2_data data43 = new _IODBSIG2_data(); + public _IODBSIG2_data data44 = new _IODBSIG2_data(); + public _IODBSIG2_data data45 = new _IODBSIG2_data(); + + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG2 + { + public short datano; /* dummy */ + public short type; /* dummy */ + public IODBSIG2_data data = new IODBSIG2_data(); + } + + /* cnc_rdhissgnl3:read signals related operation history */ + /* cnc_wrhissgnl3:write signals related operation history */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class _IODBSIG3_data + { + public short ent_no; /* entry number */ + public short pmc_no; /* pmc number */ + public short sig_no; /* signal number */ + public byte sig_name; /* signal name */ + public byte mask_pat; /* signal mask pattern */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG3_data + { + public _IODBSIG3_data data1 = new _IODBSIG3_data(); + public _IODBSIG3_data data2 = new _IODBSIG3_data(); + public _IODBSIG3_data data3 = new _IODBSIG3_data(); + public _IODBSIG3_data data4 = new _IODBSIG3_data(); + public _IODBSIG3_data data5 = new _IODBSIG3_data(); + public _IODBSIG3_data data6 = new _IODBSIG3_data(); + public _IODBSIG3_data data7 = new _IODBSIG3_data(); + public _IODBSIG3_data data8 = new _IODBSIG3_data(); + public _IODBSIG3_data data9 = new _IODBSIG3_data(); + public _IODBSIG3_data data10 = new _IODBSIG3_data(); + public _IODBSIG3_data data11 = new _IODBSIG3_data(); + public _IODBSIG3_data data12 = new _IODBSIG3_data(); + public _IODBSIG3_data data13 = new _IODBSIG3_data(); + public _IODBSIG3_data data14 = new _IODBSIG3_data(); + public _IODBSIG3_data data15 = new _IODBSIG3_data(); + public _IODBSIG3_data data16 = new _IODBSIG3_data(); + public _IODBSIG3_data data17 = new _IODBSIG3_data(); + public _IODBSIG3_data data18 = new _IODBSIG3_data(); + public _IODBSIG3_data data19 = new _IODBSIG3_data(); + public _IODBSIG3_data data20 = new _IODBSIG3_data(); + public _IODBSIG3_data data21 = new _IODBSIG3_data(); + public _IODBSIG3_data data22 = new _IODBSIG3_data(); + public _IODBSIG3_data data23 = new _IODBSIG3_data(); + public _IODBSIG3_data data24 = new _IODBSIG3_data(); + public _IODBSIG3_data data25 = new _IODBSIG3_data(); + public _IODBSIG3_data data26 = new _IODBSIG3_data(); + public _IODBSIG3_data data27 = new _IODBSIG3_data(); + public _IODBSIG3_data data28 = new _IODBSIG3_data(); + public _IODBSIG3_data data29 = new _IODBSIG3_data(); + public _IODBSIG3_data data30 = new _IODBSIG3_data(); + public _IODBSIG3_data data31 = new _IODBSIG3_data(); + public _IODBSIG3_data data32 = new _IODBSIG3_data(); + public _IODBSIG3_data data33 = new _IODBSIG3_data(); + public _IODBSIG3_data data34 = new _IODBSIG3_data(); + public _IODBSIG3_data data35 = new _IODBSIG3_data(); + public _IODBSIG3_data data36 = new _IODBSIG3_data(); + public _IODBSIG3_data data37 = new _IODBSIG3_data(); + public _IODBSIG3_data data38 = new _IODBSIG3_data(); + public _IODBSIG3_data data39 = new _IODBSIG3_data(); + public _IODBSIG3_data data40 = new _IODBSIG3_data(); + public _IODBSIG3_data data41 = new _IODBSIG3_data(); + public _IODBSIG3_data data42 = new _IODBSIG3_data(); + public _IODBSIG3_data data43 = new _IODBSIG3_data(); + public _IODBSIG3_data data44 = new _IODBSIG3_data(); + public _IODBSIG3_data data45 = new _IODBSIG3_data(); + public _IODBSIG3_data data46 = new _IODBSIG3_data(); + public _IODBSIG3_data data47 = new _IODBSIG3_data(); + public _IODBSIG3_data data48 = new _IODBSIG3_data(); + public _IODBSIG3_data data49 = new _IODBSIG3_data(); + public _IODBSIG3_data data50 = new _IODBSIG3_data(); + public _IODBSIG3_data data51 = new _IODBSIG3_data(); + public _IODBSIG3_data data52 = new _IODBSIG3_data(); + public _IODBSIG3_data data53 = new _IODBSIG3_data(); + public _IODBSIG3_data data54 = new _IODBSIG3_data(); + public _IODBSIG3_data data55 = new _IODBSIG3_data(); + public _IODBSIG3_data data56 = new _IODBSIG3_data(); + public _IODBSIG3_data data57 = new _IODBSIG3_data(); + public _IODBSIG3_data data58 = new _IODBSIG3_data(); + public _IODBSIG3_data data59 = new _IODBSIG3_data(); + public _IODBSIG3_data data60 = new _IODBSIG3_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIG3 + { + public short datano; /* dummy */ + public short type; /* dummy */ + public IODBSIG3_data data = new IODBSIG3_data(); + } + + /*-------------*/ + /* CNC: Others */ + /*-------------*/ + + /* cnc_sysinfo:read CNC system information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYS + { + public short addinfo; + public short max_axis; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public char[] cnc_type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public char[] mt_type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public char[] series; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public char[] version; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public char[] axes; + } + +#if FS15D + /* cnc_statinfo:read CNC status information */ + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBST + { + [MarshalAs(UnmanagedType.ByValArray,SizeConst=2)] + public short[] dummy; /* dummy */ + public short aut; /* selected automatic mode */ + public short manual; /* selected manual mode */ + public short run; /* running status */ + public short edit; /* editting status */ + public short motion; /* axis, dwell status */ + public short mstb; /* m, s, t, b status */ + public short emergency; /* emergency stop status */ + public short write; /* writting status */ + public short labelskip; /* label skip status */ + public short alarm; /* alarm status */ + public short warning; /* warning status */ + public short battery; /* battery status */ + } +#else + /* cnc_statinfo:read CNC status information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBST + { + public short dummy; /* dummy 笨蛋*/ + public short tmmode; /* T/M mode */ + public short aut; /* selected automatic mode */ + public short run; /* running status */ + public short motion; /* axis, dwell status 轴,停留状态*/ + public short mstb; /* m, s, t, b status */ + public short emergency; /* emergency stop status 紧急停止状态*/ + public short alarm; /* alarm status */ + public short edit; /* editting status 编辑状态*/ + } +#endif + + /* cnc_alarm:read alarm status */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBALM + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] dummy = { 0, 0 }; + public ushort data = 0; + } + + /* cnc_rdalminfo:read alarm information */ +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ALMINFO1_data + { + public int axis; + public short alm_no; + } + + [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi,Pack=4)] + public class ALMINFO2_data + { + public int axis=0 ; + public short alm_no=0 ; + public short msg_len=0 ; + [MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)] + public string alm_msg= new string(' ',32) ; + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALMINFO1_data + { + public short axis; + public short alm_no; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ALMINFO2_data + { + public short axis = 0; + public short alm_no = 0; + public short msg_len = 0; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string alm_msg = new string(' ', 32); + } +#endif + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALMINFO_1 + { + public ALMINFO1_data msg1 = new ALMINFO1_data(); + public ALMINFO1_data msg2 = new ALMINFO1_data(); + public ALMINFO1_data msg3 = new ALMINFO1_data(); + public ALMINFO1_data msg4 = new ALMINFO1_data(); + public ALMINFO1_data msg5 = new ALMINFO1_data(); + public short data_end; + } /* In case that the number of alarm is 5 */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ALMINFO_2 + { + public ALMINFO2_data msg1 = new ALMINFO2_data(); + public ALMINFO2_data msg2 = new ALMINFO2_data(); + public ALMINFO2_data msg3 = new ALMINFO2_data(); + public ALMINFO2_data msg4 = new ALMINFO2_data(); + public ALMINFO2_data msg5 = new ALMINFO2_data(); + public short dataend = 0; + } /* In case that the number of alarm is 5 */ + + /* cnc_rdalmmsg:read alarm messages */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBALMMSG_data + { + public int alm_no; + public short type; + public short axis; + public short dummy; + public short msg_len; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string alm_msg = new string(' ', 32); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBALMMSG + { + public ODBALMMSG_data msg1 = new ODBALMMSG_data(); + public ODBALMMSG_data msg2 = new ODBALMMSG_data(); + public ODBALMMSG_data msg3 = new ODBALMMSG_data(); + public ODBALMMSG_data msg4 = new ODBALMMSG_data(); + public ODBALMMSG_data msg5 = new ODBALMMSG_data(); + public ODBALMMSG_data msg6 = new ODBALMMSG_data(); + public ODBALMMSG_data msg7 = new ODBALMMSG_data(); + public ODBALMMSG_data msg8 = new ODBALMMSG_data(); + public ODBALMMSG_data msg9 = new ODBALMMSG_data(); + public ODBALMMSG_data msg10 = new ODBALMMSG_data(); + } /* In case that the number of alarm is 10 */ + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBALMMSG2_data + { + public int alm_no; + public short type; + public short axis; + public short dummy; + public short msg_len; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string alm_msg = new string(' ', 64); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBALMMSG2 + { + public ODBALMMSG2_data msg1 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg2 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg3 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg4 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg5 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg6 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg7 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg8 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg9 = new ODBALMMSG2_data(); + public ODBALMMSG2_data msg10 = new ODBALMMSG2_data(); + } /* In case that the number of alarm is 10 */ + + /* cnc_modal:read modal data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class MODAL_AUX_data + { + public int aux_data; + public byte flag1; + public byte flag2; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class MODAL_RAUX1_data + { + public MODAL_AUX_data data1 = new MODAL_AUX_data(); + public MODAL_AUX_data data2 = new MODAL_AUX_data(); + public MODAL_AUX_data data3 = new MODAL_AUX_data(); + public MODAL_AUX_data data4 = new MODAL_AUX_data(); + public MODAL_AUX_data data5 = new MODAL_AUX_data(); + public MODAL_AUX_data data6 = new MODAL_AUX_data(); + public MODAL_AUX_data data7 = new MODAL_AUX_data(); + public MODAL_AUX_data data8 = new MODAL_AUX_data(); + public MODAL_AUX_data data9 = new MODAL_AUX_data(); + public MODAL_AUX_data data10 = new MODAL_AUX_data(); + public MODAL_AUX_data data11 = new MODAL_AUX_data(); + public MODAL_AUX_data data12 = new MODAL_AUX_data(); + public MODAL_AUX_data data13 = new MODAL_AUX_data(); + public MODAL_AUX_data data14 = new MODAL_AUX_data(); + public MODAL_AUX_data data15 = new MODAL_AUX_data(); + public MODAL_AUX_data data16 = new MODAL_AUX_data(); + public MODAL_AUX_data data17 = new MODAL_AUX_data(); + public MODAL_AUX_data data18 = new MODAL_AUX_data(); + public MODAL_AUX_data data19 = new MODAL_AUX_data(); + public MODAL_AUX_data data20 = new MODAL_AUX_data(); + public MODAL_AUX_data data21 = new MODAL_AUX_data(); + public MODAL_AUX_data data22 = new MODAL_AUX_data(); + public MODAL_AUX_data data23 = new MODAL_AUX_data(); + public MODAL_AUX_data data24 = new MODAL_AUX_data(); + public MODAL_AUX_data data25 = new MODAL_AUX_data(); + public MODAL_AUX_data data26 = new MODAL_AUX_data(); + public MODAL_AUX_data data27 = new MODAL_AUX_data(); + } +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class MODAL_RAUX2_data + { + public MODAL_AUX_data data1 = new MODAL_AUX_data(); + public MODAL_AUX_data data2 = new MODAL_AUX_data(); + public MODAL_AUX_data data3 = new MODAL_AUX_data(); + public MODAL_AUX_data data4 = new MODAL_AUX_data(); + public MODAL_AUX_data data5 = new MODAL_AUX_data(); + public MODAL_AUX_data data6 = new MODAL_AUX_data(); + public MODAL_AUX_data data7 = new MODAL_AUX_data(); + public MODAL_AUX_data data8 = new MODAL_AUX_data(); + public MODAL_AUX_data data9 = new MODAL_AUX_data(); + public MODAL_AUX_data data10= new MODAL_AUX_data(); + public MODAL_AUX_data data11= new MODAL_AUX_data(); + public MODAL_AUX_data data12= new MODAL_AUX_data(); + public MODAL_AUX_data data13= new MODAL_AUX_data(); + public MODAL_AUX_data data14= new MODAL_AUX_data(); + public MODAL_AUX_data data15= new MODAL_AUX_data(); + public MODAL_AUX_data data16= new MODAL_AUX_data(); + public MODAL_AUX_data data17= new MODAL_AUX_data(); + public MODAL_AUX_data data18= new MODAL_AUX_data(); + public MODAL_AUX_data data19= new MODAL_AUX_data(); + public MODAL_AUX_data data20= new MODAL_AUX_data(); + public MODAL_AUX_data data21= new MODAL_AUX_data(); + public MODAL_AUX_data data22= new MODAL_AUX_data(); + public MODAL_AUX_data data23= new MODAL_AUX_data(); + public MODAL_AUX_data data24= new MODAL_AUX_data(); + } +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class MODAL_RAUX2_data + { + public MODAL_AUX_data data1 = new MODAL_AUX_data(); + public MODAL_AUX_data data2 = new MODAL_AUX_data(); + public MODAL_AUX_data data3 = new MODAL_AUX_data(); + public MODAL_AUX_data data4 = new MODAL_AUX_data(); + public MODAL_AUX_data data5 = new MODAL_AUX_data(); + public MODAL_AUX_data data6 = new MODAL_AUX_data(); + public MODAL_AUX_data data7 = new MODAL_AUX_data(); + public MODAL_AUX_data data8 = new MODAL_AUX_data(); + public MODAL_AUX_data data9 = new MODAL_AUX_data(); + public MODAL_AUX_data data10= new MODAL_AUX_data(); + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class MODAL_RAUX2_data + { + public MODAL_AUX_data data1 = new MODAL_AUX_data(); + public MODAL_AUX_data data2 = new MODAL_AUX_data(); + public MODAL_AUX_data data3 = new MODAL_AUX_data(); + public MODAL_AUX_data data4 = new MODAL_AUX_data(); + public MODAL_AUX_data data5 = new MODAL_AUX_data(); + public MODAL_AUX_data data6 = new MODAL_AUX_data(); + public MODAL_AUX_data data7 = new MODAL_AUX_data(); + public MODAL_AUX_data data8 = new MODAL_AUX_data(); + } +#endif + + [StructLayout(LayoutKind.Explicit)] + public class ODBMDL_1 + { + [FieldOffset(0)] + public short datano; + [FieldOffset(2)] + public short type; + [FieldOffset(4)] + public byte g_data; + } + [StructLayout(LayoutKind.Explicit)] + public class ODBMDL_2 + { + [FieldOffset(0)] + public short datano; + [FieldOffset(2)] + public short type; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public byte[] g_1shot = new byte[4]; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 35)] + public byte[] g_rdata = new byte[35]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMDL_3 + { + public short datano; + public short type; + public MODAL_AUX_data aux = new MODAL_AUX_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMDL_4 + { + public short datano; + public short type; + public MODAL_RAUX1_data raux1 = new MODAL_RAUX1_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMDL_5 + { + public short datano; + public short type; + public MODAL_RAUX2_data raux2 = new MODAL_RAUX2_data(); + } + + /* cnc_rdgcode: read G code */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBGCD_data + { + public short group; + public short flag; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string code = new string(' ', 8); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBGCD + { + public ODBGCD_data gcd0 = new ODBGCD_data(); + public ODBGCD_data gcd1 = new ODBGCD_data(); + public ODBGCD_data gcd2 = new ODBGCD_data(); + public ODBGCD_data gcd3 = new ODBGCD_data(); + public ODBGCD_data gcd4 = new ODBGCD_data(); + public ODBGCD_data gcd5 = new ODBGCD_data(); + public ODBGCD_data gcd6 = new ODBGCD_data(); + public ODBGCD_data gcd7 = new ODBGCD_data(); + public ODBGCD_data gcd8 = new ODBGCD_data(); + public ODBGCD_data gcd9 = new ODBGCD_data(); + public ODBGCD_data gcd10 = new ODBGCD_data(); + public ODBGCD_data gcd11 = new ODBGCD_data(); + public ODBGCD_data gcd12 = new ODBGCD_data(); + public ODBGCD_data gcd13 = new ODBGCD_data(); + public ODBGCD_data gcd14 = new ODBGCD_data(); + public ODBGCD_data gcd15 = new ODBGCD_data(); + public ODBGCD_data gcd16 = new ODBGCD_data(); + public ODBGCD_data gcd17 = new ODBGCD_data(); + public ODBGCD_data gcd18 = new ODBGCD_data(); + public ODBGCD_data gcd19 = new ODBGCD_data(); + public ODBGCD_data gcd20 = new ODBGCD_data(); + public ODBGCD_data gcd21 = new ODBGCD_data(); + public ODBGCD_data gcd22 = new ODBGCD_data(); + public ODBGCD_data gcd23 = new ODBGCD_data(); + public ODBGCD_data gcd24 = new ODBGCD_data(); + public ODBGCD_data gcd25 = new ODBGCD_data(); + public ODBGCD_data gcd26 = new ODBGCD_data(); + public ODBGCD_data gcd27 = new ODBGCD_data(); + } + + /* cnc_rdcommand: read command value */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBCMD_data + { + public byte adrs; + public byte num; + public short flag; + public int cmd_val; + public int dec_val; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBCMD + { + public ODBCMD_data cmd0 = new ODBCMD_data(); + public ODBCMD_data cmd1 = new ODBCMD_data(); + public ODBCMD_data cmd2 = new ODBCMD_data(); + public ODBCMD_data cmd3 = new ODBCMD_data(); + public ODBCMD_data cmd4 = new ODBCMD_data(); + public ODBCMD_data cmd5 = new ODBCMD_data(); + public ODBCMD_data cmd6 = new ODBCMD_data(); + public ODBCMD_data cmd7 = new ODBCMD_data(); + public ODBCMD_data cmd8 = new ODBCMD_data(); + public ODBCMD_data cmd9 = new ODBCMD_data(); + public ODBCMD_data cmd10 = new ODBCMD_data(); + public ODBCMD_data cmd11 = new ODBCMD_data(); + public ODBCMD_data cmd12 = new ODBCMD_data(); + public ODBCMD_data cmd13 = new ODBCMD_data(); + public ODBCMD_data cmd14 = new ODBCMD_data(); + public ODBCMD_data cmd15 = new ODBCMD_data(); + public ODBCMD_data cmd16 = new ODBCMD_data(); + public ODBCMD_data cmd17 = new ODBCMD_data(); + public ODBCMD_data cmd18 = new ODBCMD_data(); + public ODBCMD_data cmd19 = new ODBCMD_data(); + public ODBCMD_data cmd20 = new ODBCMD_data(); + public ODBCMD_data cmd21 = new ODBCMD_data(); + public ODBCMD_data cmd22 = new ODBCMD_data(); + public ODBCMD_data cmd23 = new ODBCMD_data(); + public ODBCMD_data cmd24 = new ODBCMD_data(); + public ODBCMD_data cmd25 = new ODBCMD_data(); + public ODBCMD_data cmd26 = new ODBCMD_data(); + public ODBCMD_data cmd27 = new ODBCMD_data(); + public ODBCMD_data cmd28 = new ODBCMD_data(); + public ODBCMD_data cmd29 = new ODBCMD_data(); + } + + /* cnc_diagnoss:read diagnosis data */ + /* cnc_diagnosr:read diagnosis data(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REALDGN + { + public int dgn_val; /* data of real diagnoss */ + public int dec_val; /* decimal point of real diagnoss */ + } + +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class REALDGNS + { + public REALDGN rdata1=new REALDGN(); + public REALDGN rdata2=new REALDGN(); + public REALDGN rdata3=new REALDGN(); + public REALDGN rdata4=new REALDGN(); + public REALDGN rdata5=new REALDGN(); + public REALDGN rdata6=new REALDGN(); + public REALDGN rdata7=new REALDGN(); + public REALDGN rdata8=new REALDGN(); + public REALDGN rdata9=new REALDGN(); + public REALDGN rdata10=new REALDGN(); + public REALDGN rdata11=new REALDGN(); + public REALDGN rdata12=new REALDGN(); + public REALDGN rdata13=new REALDGN(); + public REALDGN rdata14=new REALDGN(); + public REALDGN rdata15=new REALDGN(); + public REALDGN rdata16=new REALDGN(); + public REALDGN rdata17=new REALDGN(); + public REALDGN rdata18=new REALDGN(); + public REALDGN rdata19=new REALDGN(); + public REALDGN rdata20=new REALDGN(); + public REALDGN rdata21=new REALDGN(); + public REALDGN rdata22=new REALDGN(); + public REALDGN rdata23=new REALDGN(); + public REALDGN rdata24=new REALDGN(); + } /* In case that the number of alarm is 24 */ +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class REALDGNS + { + public REALDGN rdata1=new REALDGN(); + public REALDGN rdata2=new REALDGN(); + public REALDGN rdata3=new REALDGN(); + public REALDGN rdata4=new REALDGN(); + public REALDGN rdata5=new REALDGN(); + public REALDGN rdata6=new REALDGN(); + public REALDGN rdata7=new REALDGN(); + public REALDGN rdata8=new REALDGN(); + public REALDGN rdata9=new REALDGN(); + public REALDGN rdata10=new REALDGN(); + } /* In case that the number of alarm is 10 */ +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class REALDGNS + { + public REALDGN rdata1 = new REALDGN(); + public REALDGN rdata2 = new REALDGN(); + public REALDGN rdata3 = new REALDGN(); + public REALDGN rdata4 = new REALDGN(); + public REALDGN rdata5 = new REALDGN(); + public REALDGN rdata6 = new REALDGN(); + public REALDGN rdata7 = new REALDGN(); + public REALDGN rdata8 = new REALDGN(); + } /* In case that the number of alarm is 8 */ +#endif + + [StructLayout(LayoutKind.Explicit)] + public class ODBDGN_1 + { + [FieldOffset(0)] + public short datano; /* data number */ + [FieldOffset(2)] + public short type; /* axis number */ + [FieldOffset(4)] + public byte cdata; /* parameter / setting data */ + [FieldOffset(4)] + public short idata; + [FieldOffset(4)] + public int ldata; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_2 + { + public short datano; /* data number */ + public short type; /* axis number */ + public REALDGN rdata = new REALDGN(); + } + [StructLayout(LayoutKind.Explicit)] + public class ODBDGN_3 + { + [FieldOffset(0)] + public short datano; /* data number */ + [FieldOffset(2)] + public short type; /* axis number */ + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public byte[] cdatas; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public short[] idatas; + [FieldOffset(4), + MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ldatas; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_4 + { + public short datano; /* data number */ + public short type; /* axis number */ + public REALDGNS rdatas = new REALDGNS(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_A + { + public ODBDGN_1 data1 = new ODBDGN_1(); + public ODBDGN_1 data2 = new ODBDGN_1(); + public ODBDGN_1 data3 = new ODBDGN_1(); + public ODBDGN_1 data4 = new ODBDGN_1(); + public ODBDGN_1 data5 = new ODBDGN_1(); + public ODBDGN_1 data6 = new ODBDGN_1(); + public ODBDGN_1 data7 = new ODBDGN_1(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_B + { + public ODBDGN_2 data1 = new ODBDGN_2(); + public ODBDGN_2 data2 = new ODBDGN_2(); + public ODBDGN_2 data3 = new ODBDGN_2(); + public ODBDGN_2 data4 = new ODBDGN_2(); + public ODBDGN_2 data5 = new ODBDGN_2(); + public ODBDGN_2 data6 = new ODBDGN_2(); + public ODBDGN_2 data7 = new ODBDGN_2(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_C + { + public ODBDGN_3 data1 = new ODBDGN_3(); + public ODBDGN_3 data2 = new ODBDGN_3(); + public ODBDGN_3 data3 = new ODBDGN_3(); + public ODBDGN_3 data4 = new ODBDGN_3(); + public ODBDGN_3 data5 = new ODBDGN_3(); + public ODBDGN_3 data6 = new ODBDGN_3(); + public ODBDGN_3 data7 = new ODBDGN_3(); + } /* (sample) must be modified */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDGN_D + { + public ODBDGN_4 data1 = new ODBDGN_4(); + public ODBDGN_4 data2 = new ODBDGN_4(); + public ODBDGN_4 data3 = new ODBDGN_4(); + public ODBDGN_4 data4 = new ODBDGN_4(); + public ODBDGN_4 data5 = new ODBDGN_4(); + public ODBDGN_4 data6 = new ODBDGN_4(); + public ODBDGN_4 data7 = new ODBDGN_4(); + } /* (sample) must be modified */ + + /* cnc_adcnv:read A/D conversion data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAD + { + public short datano; /* input analog voltage type */ + public short type; /* analog voltage type */ + public short data; /* digital voltage data */ + } + +#if FS15D + /* cnc_rdopmsg:read operator's message */ + [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi,Pack=4)] + public class OPMSG_data + { + public short datano ; /* operator's message number */ + public short type ; /* operator's message type */ + public short char_num ; /* message string length */ + [MarshalAs(UnmanagedType.ByValTStr,SizeConst=129)] + public string data= new string(' ',129) ; /* operator's message string */ + } /* In case that the data length is 129 */ +#else + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class OPMSG_data + { + public short datano; /* operator's message number */ + public short type; /* operator's message type */ + public short char_num; /* message string length */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string data = new string(' ', 256); /* operator's message string */ + } /* In case that the data length is 256 */ +#endif + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OPMSG + { + public OPMSG_data msg1 = new OPMSG_data(); + public OPMSG_data msg2 = new OPMSG_data(); + public OPMSG_data msg3 = new OPMSG_data(); + public OPMSG_data msg4 = new OPMSG_data(); + public OPMSG_data msg5 = new OPMSG_data(); + } + + /* cnc_rdopmsg2:read operator's message */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class OPMSG2_data + { + public short datano; /* operator's message number */ + public short type; /* operator's message type */ + public short char_num; /* message string length */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string data = new string(' ', 64); /* operator's message string */ + } /* In case that the data length is 64 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OPMSG2 + { + public OPMSG2_data msg1 = new OPMSG2_data(); + public OPMSG2_data msg2 = new OPMSG2_data(); + public OPMSG2_data msg3 = new OPMSG2_data(); + public OPMSG2_data msg4 = new OPMSG2_data(); + public OPMSG2_data msg5 = new OPMSG2_data(); + } + + /* cnc_rdopmsg3:read operator's message */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class OPMSG3_data + { + public short datano; /* operator's message number */ + public short type; /* operator's message type */ + public short char_num; /* message string length */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string data = new string(' ', 256); /* operator's message string */ + } /* In case that the data length is 256 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class OPMSG3 + { + public OPMSG3_data msg1 = new OPMSG3_data(); + public OPMSG3_data msg2 = new OPMSG3_data(); + public OPMSG3_data msg3 = new OPMSG3_data(); + public OPMSG3_data msg4 = new OPMSG3_data(); + public OPMSG3_data msg5 = new OPMSG3_data(); + } + + /* cnc_sysconfig:read CNC configuration information */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBSYSC + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_p; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_l; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] mod_id; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] soft_id; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_series16 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string s_version16 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] dummy; + public short m_rom; + public short s_rom; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public char[] svo_soft; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public char[] pmc_soft; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public char[] lad_soft; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public char[] mcr_soft; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public char[] spl1_soft; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public char[] spl2_soft; + public short frmmin; + public short drmmin; + public short srmmin; + public short pmcmin; + public short crtmin; + public short sv1min; + public short sv3min; + public short sicmin; + public short posmin; + public short drmmrc; + public short drmarc; + public short pmcmrc; + public short dmaarc; + public short iopt; + public short hdiio; + public short frmsub; + public short drmsub; + public short srmsub; + public short sv5sub; + public short sv7sub; + public short sicsub; + public short possub; + public short hamsub; + public short gm2gr1; + public short crtgr2; + public short gm1gr2; + public short gm2gr2; + public short cmmrb; + public short sv5axs; + public short sv7axs; + public short sicaxs; + public short posaxs; + public short hanaxs; + public short romr64; + public short srmr64; + public short dr1r64; + public short dr2r64; + public short iopio2; + public short hdiio2; + public short cmmrb2; + public short romfap; + public short srmfap; + public short drmfap; + } + + /* cnc_rdprstrinfo:read program restart information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPRS + { + public short datano; /* dummy */ + public short type; /* dummy */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] data_info; /* data setting information */ + public int rstr_bc; /* block counter */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 35)] + public int[] rstr_m; /* M code value */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] rstr_t; /* T code value */ + public int rstr_s; /* S code value */ + public int rstr_b; /* B code value */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] dest; /* program re-start position */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] dist; /* program re-start distance */ + } + +#if FS15D + /* cnc_rdopnlsgnl:read output signal image of software operator's panel */ + /* cnc_wropnlsgnl:write output signal of software operator's panel */ + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class IODBSGNL + { + public short datano; /* dummy */ + public short type; /* data select flag */ + public short mode; /* mode signal */ + public short hndl_ax; /* Manual handle feed axis selection signal */ + public short hndl_mv; /* Manual handle feed travel distance selection signal */ + public short rpd_ovrd; /* rapid traverse override signal */ + public short jog_ovrd; /* manual feedrate override signal */ + public short feed_ovrd; /* feedrate override signal */ + public short spdl_ovrd; /* spindle override signal */ + public short blck_del; /* optional block skip signal */ + public short sngl_blck; /* single block signal */ + public short machn_lock; /* machine lock signal */ + public short dry_run; /* dry run signal */ + public short mem_prtct; /* memory protection signal */ + public short feed_hold; /* automatic operation halt signal */ + public short manual_rpd; /* (not used) */ + [MarshalAs(UnmanagedType.ByValArray,SizeConst=2)] + public short[] dummy; /* (not used) */ + } +#else + /* cnc_rdopnlsgnl:read output signal image of software operator's panel */ + /* cnc_wropnlsgnl:write output signal of software operator's panel */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSGNL + { + public short datano; /* dummy */ + public short type; /* data select flag */ + public short mode; /* mode signal */ + public short hndl_ax; /* Manual handle feed axis selection signal */ + public short hndl_mv; /* Manual handle feed travel distance selection signal */ + public short rpd_ovrd; /* rapid traverse override signal */ + public short jog_ovrd; /* manual feedrate override signal */ + public short feed_ovrd; /* feedrate override signal */ + public short spdl_ovrd; /* (not used) */ + public short blck_del; /* optional block skip signal */ + public short sngl_blck; /* single block signal */ + public short machn_lock; /* machine lock signal */ + public short dry_run; /* dry run signal */ + public short mem_prtct; /* memory protection signal */ + public short feed_hold; /* automatic operation halt signal */ + } +#endif + + /* cnc_rdopnlgnrl:read general signal image of software operator's panel */ + /* cnc_wropnlgnrl:write general signal image of software operator's panel */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBGNRL + { + public short datano; /* dummy */ + public short type; /* data select flag */ + public byte sgnal; /* general signal */ + } + + /* cnc_rdopnlgsname:read general signal name of software operator's panel */ + /* cnc_wropnlgsname:write general signal name of software operator's panel*/ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBRDNA + { + public short datano; /* dummy */ + public short type; /* data select flag */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl1_name = new string(' ', 9); /* general signal 1 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl2_name = new string(' ', 9); /* general signal 2 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl3_name = new string(' ', 9); /* general signal 3 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl4_name = new string(' ', 9); /* general signal 4 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl5_name = new string(' ', 9); /* general signal 5 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl6_name = new string(' ', 9); /* general signal 6 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl7_name = new string(' ', 9); /* general signal 7 name */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string sgnl8_name = new string(' ', 9); /* general signal 8 name */ + } + + /* cnc_getdtailerr:get detail error */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBERR + { + public short err_no; + public short err_dtno; + } + + + /* cnc_rdparainfo:read informations of CNC parameter */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPARAIF_info + { + public short prm_no; + public short prm_type; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPARAIF1 + { + public ODBPARAIF_info info1 = new ODBPARAIF_info(); + public ODBPARAIF_info info2 = new ODBPARAIF_info(); + public ODBPARAIF_info info3 = new ODBPARAIF_info(); + public ODBPARAIF_info info4 = new ODBPARAIF_info(); + public ODBPARAIF_info info5 = new ODBPARAIF_info(); + public ODBPARAIF_info info6 = new ODBPARAIF_info(); + public ODBPARAIF_info info7 = new ODBPARAIF_info(); + public ODBPARAIF_info info8 = new ODBPARAIF_info(); + public ODBPARAIF_info info9 = new ODBPARAIF_info(); + public ODBPARAIF_info info10 = new ODBPARAIF_info(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPARAIF + { + public ushort info_no; + public short prev_no; + public short next_no; + public ODBPARAIF1 info = new ODBPARAIF1(); + } + + /* cnc_rdsetinfo:read informations of CNC setting data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSETIF_info + { + public short set_no; + public short set_type; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSETIF1 + { + public ODBSETIF_info info1 = new ODBSETIF_info(); + public ODBSETIF_info info2 = new ODBSETIF_info(); + public ODBSETIF_info info3 = new ODBSETIF_info(); + public ODBSETIF_info info4 = new ODBSETIF_info(); + public ODBSETIF_info info5 = new ODBSETIF_info(); + public ODBSETIF_info info6 = new ODBSETIF_info(); + public ODBSETIF_info info7 = new ODBSETIF_info(); + public ODBSETIF_info info8 = new ODBSETIF_info(); + public ODBSETIF_info info9 = new ODBSETIF_info(); + public ODBSETIF_info info10 = new ODBSETIF_info(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSETIF + { + public ushort info_no; + public short prev_no; + public short next_no; + public ODBSETIF1 info = new ODBSETIF1(); + } + + /* cnc_rddiaginfo:read informations of CNC diagnose data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDIAGIF_info + { + public short diag_no; + public short diag_type; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDIAGIF1 + { + public ODBDIAGIF_info info1 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info2 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info3 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info4 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info5 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info6 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info7 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info8 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info9 = new ODBDIAGIF_info(); + public ODBDIAGIF_info info10 = new ODBDIAGIF_info(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDIAGIF + { + public ushort info_no; + public short prev_no; + public short next_no; + public ODBDIAGIF1 info = new ODBDIAGIF1(); + } + + /* cnc_rdparanum:read maximum, minimum and total number of CNC parameter */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPARANUM + { + public ushort para_min; + public ushort para_max; + public ushort total_no; + } + + /* cnc_rdsetnum:read maximum, minimum and total number of CNC setting data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSETNUM + { + public ushort set_min; + public ushort set_max; + public ushort total_no; + } + + /* cnc_rddiagnum:read maximum, minimum and total number of CNC diagnose data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDIAGNUM + { + public ushort diag_min; + public ushort diag_max; + public ushort total_no; + } + + /* cnc_rdfrominfo:read F-ROM information on CNC */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBFINFO_info + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string sysname = new string(' ', 12); /* F-ROM SYSTEM data Name */ + public int fromsize; /* F-ROM Size */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBFINFO1 + { + public ODBFINFO_info info1 = new ODBFINFO_info(); + public ODBFINFO_info info2 = new ODBFINFO_info(); + public ODBFINFO_info info3 = new ODBFINFO_info(); + public ODBFINFO_info info4 = new ODBFINFO_info(); + public ODBFINFO_info info5 = new ODBFINFO_info(); + public ODBFINFO_info info6 = new ODBFINFO_info(); + public ODBFINFO_info info7 = new ODBFINFO_info(); + public ODBFINFO_info info8 = new ODBFINFO_info(); + public ODBFINFO_info info9 = new ODBFINFO_info(); + public ODBFINFO_info info10 = new ODBFINFO_info(); + public ODBFINFO_info info11 = new ODBFINFO_info(); + public ODBFINFO_info info12 = new ODBFINFO_info(); + public ODBFINFO_info info13 = new ODBFINFO_info(); + public ODBFINFO_info info14 = new ODBFINFO_info(); + public ODBFINFO_info info15 = new ODBFINFO_info(); + public ODBFINFO_info info16 = new ODBFINFO_info(); + public ODBFINFO_info info17 = new ODBFINFO_info(); + public ODBFINFO_info info18 = new ODBFINFO_info(); + public ODBFINFO_info info19 = new ODBFINFO_info(); + public ODBFINFO_info info20 = new ODBFINFO_info(); + public ODBFINFO_info info21 = new ODBFINFO_info(); + public ODBFINFO_info info22 = new ODBFINFO_info(); + public ODBFINFO_info info23 = new ODBFINFO_info(); + public ODBFINFO_info info24 = new ODBFINFO_info(); + public ODBFINFO_info info25 = new ODBFINFO_info(); + public ODBFINFO_info info26 = new ODBFINFO_info(); + public ODBFINFO_info info27 = new ODBFINFO_info(); + public ODBFINFO_info info28 = new ODBFINFO_info(); + public ODBFINFO_info info29 = new ODBFINFO_info(); + public ODBFINFO_info info30 = new ODBFINFO_info(); + public ODBFINFO_info info31 = new ODBFINFO_info(); + public ODBFINFO_info info32 = new ODBFINFO_info(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBFINFO + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string slotname = new string(' ', 12); /* Slot Name */ + public int fromnum; /* Number of F-ROM SYSTEM data */ + public ODBFINFO1 info = new ODBFINFO1(); + } + + /* cnc_getfrominfo:read F-ROM information on CNC */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBFINFORM_info + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string sysname = new string(' ', 12); /* F-ROM SYSTEM data Name */ + public int fromsize; /* F-ROM Size */ + public int fromattrib; /* F-ROM data attribute */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBFINFORM1 + { + public ODBFINFORM_info info1 = new ODBFINFORM_info(); + public ODBFINFORM_info info2 = new ODBFINFORM_info(); + public ODBFINFORM_info info3 = new ODBFINFORM_info(); + public ODBFINFORM_info info4 = new ODBFINFORM_info(); + public ODBFINFORM_info info5 = new ODBFINFORM_info(); + public ODBFINFORM_info info6 = new ODBFINFORM_info(); + public ODBFINFORM_info info7 = new ODBFINFORM_info(); + public ODBFINFORM_info info8 = new ODBFINFORM_info(); + public ODBFINFORM_info info9 = new ODBFINFORM_info(); + public ODBFINFORM_info info10 = new ODBFINFORM_info(); + public ODBFINFORM_info info11 = new ODBFINFORM_info(); + public ODBFINFORM_info info12 = new ODBFINFORM_info(); + public ODBFINFORM_info info13 = new ODBFINFORM_info(); + public ODBFINFORM_info info14 = new ODBFINFORM_info(); + public ODBFINFORM_info info15 = new ODBFINFORM_info(); + public ODBFINFORM_info info16 = new ODBFINFORM_info(); + public ODBFINFORM_info info17 = new ODBFINFORM_info(); + public ODBFINFORM_info info18 = new ODBFINFORM_info(); + public ODBFINFORM_info info19 = new ODBFINFORM_info(); + public ODBFINFORM_info info20 = new ODBFINFORM_info(); + public ODBFINFORM_info info21 = new ODBFINFORM_info(); + public ODBFINFORM_info info22 = new ODBFINFORM_info(); + public ODBFINFORM_info info23 = new ODBFINFORM_info(); + public ODBFINFORM_info info24 = new ODBFINFORM_info(); + public ODBFINFORM_info info25 = new ODBFINFORM_info(); + public ODBFINFORM_info info26 = new ODBFINFORM_info(); + public ODBFINFORM_info info27 = new ODBFINFORM_info(); + public ODBFINFORM_info info28 = new ODBFINFORM_info(); + public ODBFINFORM_info info29 = new ODBFINFORM_info(); + public ODBFINFORM_info info30 = new ODBFINFORM_info(); + public ODBFINFORM_info info31 = new ODBFINFORM_info(); + public ODBFINFORM_info info32 = new ODBFINFORM_info(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBFINFORM + { + public int slotno; /* Slot Number */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string slotname = new string(' ', 12); /* Slot Name */ + public int fromnum; /* Number of F-ROM SYSTEM data */ + public ODBFINFORM1 info = new ODBFINFORM1(); + } + + /* cnc_rdsraminfo:read S-RAM information on CNC */ + /* cnc_getsraminfo:read S-RAM information on CNC */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBSINFO_info + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string sramname = new string(' ', 12); /* S-RAM data Name */ + public int sramsize; /* S-RAM data Size */ + public short divnumber; /* Division number of S-RAM file */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname1 = new string(' ', 16); /* S-RAM data Name1 */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname2 = new string(' ', 16); /* S-RAM data Name2 */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname3 = new string(' ', 16); /* S-RAM data Name3 */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname4 = new string(' ', 16); /* S-RAM data Name4 */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname5 = new string(' ', 16); /* S-RAM data Name5 */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string fname6 = new string(' ', 16); /* S-RAM data Name6 */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSINFO1 + { + public ODBSINFO_info info1 = new ODBSINFO_info(); + public ODBSINFO_info info2 = new ODBSINFO_info(); + public ODBSINFO_info info3 = new ODBSINFO_info(); + public ODBSINFO_info info4 = new ODBSINFO_info(); + public ODBSINFO_info info5 = new ODBSINFO_info(); + public ODBSINFO_info info6 = new ODBSINFO_info(); + public ODBSINFO_info info7 = new ODBSINFO_info(); + public ODBSINFO_info info8 = new ODBSINFO_info(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSINFO + { + public int sramnum; /* Number of S-RAM data */ + public ODBSINFO1 info = new ODBSINFO1(); + } + + /* cnc_rdsramaddr:read S-RAM address on CNC */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class SRAMADDR + { + public short type; /* SRAM data type */ + public int size; /* SRAM data size */ + public int offset; /* offset from top address of SRAM */ + } + + /* cnc_dtsvrdpgdir:read file directory in Data Server */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBDSDIR_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string file_name = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string comment = new string(' ', 64); + public int size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string date = new string(' ', 16); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDSDIR1 + { + public ODBDSDIR_data data1 = new ODBDSDIR_data(); + public ODBDSDIR_data data2 = new ODBDSDIR_data(); + public ODBDSDIR_data data3 = new ODBDSDIR_data(); + public ODBDSDIR_data data4 = new ODBDSDIR_data(); + public ODBDSDIR_data data5 = new ODBDSDIR_data(); + public ODBDSDIR_data data6 = new ODBDSDIR_data(); + public ODBDSDIR_data data7 = new ODBDSDIR_data(); + public ODBDSDIR_data data8 = new ODBDSDIR_data(); + public ODBDSDIR_data data9 = new ODBDSDIR_data(); + public ODBDSDIR_data data10 = new ODBDSDIR_data(); + public ODBDSDIR_data data11 = new ODBDSDIR_data(); + public ODBDSDIR_data data12 = new ODBDSDIR_data(); + public ODBDSDIR_data data13 = new ODBDSDIR_data(); + public ODBDSDIR_data data14 = new ODBDSDIR_data(); + public ODBDSDIR_data data15 = new ODBDSDIR_data(); + public ODBDSDIR_data data16 = new ODBDSDIR_data(); + public ODBDSDIR_data data17 = new ODBDSDIR_data(); + public ODBDSDIR_data data18 = new ODBDSDIR_data(); + public ODBDSDIR_data data19 = new ODBDSDIR_data(); + public ODBDSDIR_data data20 = new ODBDSDIR_data(); + public ODBDSDIR_data data21 = new ODBDSDIR_data(); + public ODBDSDIR_data data22 = new ODBDSDIR_data(); + public ODBDSDIR_data data23 = new ODBDSDIR_data(); + public ODBDSDIR_data data24 = new ODBDSDIR_data(); + public ODBDSDIR_data data25 = new ODBDSDIR_data(); + public ODBDSDIR_data data26 = new ODBDSDIR_data(); + public ODBDSDIR_data data27 = new ODBDSDIR_data(); + public ODBDSDIR_data data28 = new ODBDSDIR_data(); + public ODBDSDIR_data data29 = new ODBDSDIR_data(); + public ODBDSDIR_data data30 = new ODBDSDIR_data(); + public ODBDSDIR_data data31 = new ODBDSDIR_data(); + public ODBDSDIR_data data32 = new ODBDSDIR_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDSDIR + { + public int file_num; + public int remainder; + public short data_num; + public ODBDSDIR1 data = new ODBDSDIR1(); + } + + /* cnc_dtsvrdset:read setting data for Data Server */ + /* cnc_dtsvwrset:write setting data for Data Server */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBDSSET + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string host_ip = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string host_uname = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string host_passwd = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string host_dir = new string(' ', 128); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 13)] + public string dtsv_mac = new string(' ', 13); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string dtsv_ip = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string dtsv_mask = new string(' ', 16); + } + + /* cnc_dtsvmntinfo:read maintenance information for Data Server */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDSMNT + { + public int empty_cnt; + public int total_size; + public int read_ptr; + public int write_ptr; + } + + /* cnc_rdposerrs2:read the position deviation S1 and S2 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPSER + { + public int poserr1; + public int poserr2; + } + + /* cnc_rdctrldi:read the control input signal */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDI_data + { + public byte sgnl1; + public byte sgnl2; + public byte sgnl3; + public byte sgnl4; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDI + { + public ODBSPDI_data di1 = new ODBSPDI_data(); + public ODBSPDI_data di2 = new ODBSPDI_data(); + public ODBSPDI_data di3 = new ODBSPDI_data(); + public ODBSPDI_data di4 = new ODBSPDI_data(); + } + + /* cnc_rdctrldo:read the control output signal */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDO_data + { + public byte sgnl1; + public byte sgnl2; + public byte sgnl3; + public byte sgnl4; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDO + { + public ODBSPDO_data do1 = new ODBSPDO_data(); + public ODBSPDO_data do2 = new ODBSPDO_data(); + public ODBSPDO_data do3 = new ODBSPDO_data(); + public ODBSPDO_data do4 = new ODBSPDO_data(); + } + + /* cnc_rdwaveprm:read the parameter of wave diagnosis */ + /* cnc_wrwaveprm:write the parameter of wave diagnosis */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWAVE_io + { + public byte adr; + public byte bit; + public short no; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWAVE_axis + { + public short axis; + } + [StructLayout(LayoutKind.Explicit)] + public class IODBWAVE_u + { + [FieldOffset(0)] + public IODBWAVE_io io = new IODBWAVE_io(); + [FieldOffset(0)] + public IODBWAVE_axis axis = new IODBWAVE_axis(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWAVE_ch_data + { + public short kind; + public IODBWAVE_u u = new IODBWAVE_u(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWAVE_ch + { + public IODBWAVE_ch_data ch1 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch2 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch3 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch4 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch5 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch6 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch7 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch8 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch9 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch10 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch11 = new IODBWAVE_ch_data(); + public IODBWAVE_ch_data ch12 = new IODBWAVE_ch_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWAVE + { + public short condition; + public char trg_adr; + public byte trg_bit; + public short trg_no; + public short delay; + public short t_range; + public IODBWAVE_ch ch = new IODBWAVE_ch(); + } + + /* cnc_rdwaveprm2:read the parameter of wave diagnosis 2 */ + /* cnc_wrwaveprm2:write the parameter of wave diagnosis 2 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWVPRM_io + { + public byte adr; + public byte bit; + public short no; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWVPRM_axis + { + public short axis; + } + [StructLayout(LayoutKind.Explicit)] + public class IODBWVPRM_u + { + [FieldOffset(0)] + public IODBWVPRM_io io = new IODBWVPRM_io(); + [FieldOffset(0)] + public IODBWVPRM_axis axis = new IODBWVPRM_axis(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWVPRM_ch_data + { + public short kind; + public IODBWVPRM_u u = new IODBWVPRM_u(); + public int reserve2; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWVPRM_ch + { + public IODBWVPRM_ch_data ch1 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch2 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch3 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch4 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch5 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch6 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch7 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch8 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch9 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch10 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch11 = new IODBWVPRM_ch_data(); + public IODBWVPRM_ch_data ch12 = new IODBWVPRM_ch_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWVPRM + { + public short condition; + public byte trg_adr; + public byte trg_bit; + public short trg_no; + public short reserve1; + public int delay; + public int t_range; + public IODBWVPRM_ch ch = new IODBWVPRM_ch(); + } + + /* cnc_rdwavedata:read the data of wave diagnosis */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBWVDT_io + { + public byte adr; + public byte bit; + public short no; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBWVDT_axis + { + public short axis; + } + [StructLayout(LayoutKind.Explicit)] + public class ODBWVDT_u + { + [FieldOffset(0)] + public ODBWVDT_io io = new ODBWVDT_io(); + [FieldOffset(0)] + public ODBWVDT_axis axis = new ODBWVDT_axis(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBWVDT + { + public short channel; + public short kind; + public ODBWVDT_u u = new ODBWVDT_u(); + public byte year; + public byte month; + public byte day; + public byte hour; + public byte minute; + public byte second; + public short t_cycle; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8192)] + public short[] data; + } + + /* cnc_rdrmtwaveprm:read the parameter of wave diagnosis for remort diagnosis */ + /* cnc_wrrmtwaveprm:write the parameter of wave diagnosis for remort diagnosis */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBRMTPRM_alm + { + public short no; + public sbyte axis; + public byte type; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBRMTPRM_io + { + public char adr; + public byte bit; + public short no; + } + [StructLayout(LayoutKind.Explicit)] + public class IODBRMTPRM_trg + { + [FieldOffset(0)] + public IODBRMTPRM_alm alm = new IODBRMTPRM_alm(); + [FieldOffset(0)] + public IODBRMTPRM_io io = new IODBRMTPRM_io(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBRMTPRM_smpl + { + public char adr; + public byte bit; + public short no; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBRMTPRM1 + { + public IODBRMTPRM_smpl ampl1 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl2 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl3 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl4 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl5 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl6 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl7 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl8 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl9 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl10 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl11 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl12 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl13 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl14 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl15 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl16 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl17 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl18 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl19 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl20 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl21 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl22 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl23 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl24 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl25 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl26 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl27 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl28 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl29 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl30 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl31 = new IODBRMTPRM_smpl(); + public IODBRMTPRM_smpl ampl32 = new IODBRMTPRM_smpl(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBRMTPRM + { + public short condition; + public short reserve; + public IODBRMTPRM_trg trg = new IODBRMTPRM_trg(); + public int delay; + public short wv_intrvl; + public short io_intrvl; + public short kind1; + public short kind2; + public IODBRMTPRM1 ampl = new IODBRMTPRM1(); + } + + /* cnc_rdrmtwavedt:read the data of wave diagnosis for remort diagnosis */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBRMTDT + { + public short channel; + public short kind; + public byte year; + public byte month; + public byte day; + public byte hour; + public byte minute; + public byte second; + public short t_intrvl; + public short trg_data; + public int ins_ptr; + public short t_delta; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1917)] + public short[] data; + } + + /* cnc_rdsavsigadr:read of address for PMC signal batch save */ + /* cnc_wrsavsigadr:write of address for PMC signal batch save */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSIGAD + { + public byte adr; + public byte reserve; + public short no; + public short size; + } + + /* cnc_rdmgrpdata:read M-code group data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBMGRP_data + { + public int m_code; + public short grp_no; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] + public string m_name = new string(' ', 21); + public byte dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMGRP + { + public ODBMGRP_data mgrp1 = new ODBMGRP_data(); + public ODBMGRP_data mgrp2 = new ODBMGRP_data(); + public ODBMGRP_data mgrp3 = new ODBMGRP_data(); + public ODBMGRP_data mgrp4 = new ODBMGRP_data(); + public ODBMGRP_data mgrp5 = new ODBMGRP_data(); + public ODBMGRP_data mgrp6 = new ODBMGRP_data(); + public ODBMGRP_data mgrp7 = new ODBMGRP_data(); + public ODBMGRP_data mgrp8 = new ODBMGRP_data(); + public ODBMGRP_data mgrp9 = new ODBMGRP_data(); + public ODBMGRP_data mgrp10 = new ODBMGRP_data(); + } + + /* cnc_wrmgrpdata:write M-code group data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBMGRP + { + public short s_no; + public short dummy; + public short num; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 500)] + public short[] group = new short[500]; + } + + /* cnc_rdexecmcode:read executing M-code group data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXEM_data + { + public int no; + public short flag; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXEM1 + { + public ODBEXEM_data m_code1 = new ODBEXEM_data(); + public ODBEXEM_data m_code2 = new ODBEXEM_data(); + public ODBEXEM_data m_code3 = new ODBEXEM_data(); + public ODBEXEM_data m_code4 = new ODBEXEM_data(); + public ODBEXEM_data m_code5 = new ODBEXEM_data(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBEXEM + { + public short grp_no; + public short mem_no; + public ODBEXEM1 m_code = new ODBEXEM1(); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] + public string m_name = new string(' ', 21); + public byte dummy; + } + + /* cnc_rdrstrmcode:read program restart M-code group data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class M_CODE_data + { + public int no; + public short flag; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class M_CODE1 + { + public M_CODE_data m_code1 = new M_CODE_data(); + public M_CODE_data m_code2 = new M_CODE_data(); + public M_CODE_data m_code3 = new M_CODE_data(); + public M_CODE_data m_code4 = new M_CODE_data(); + public M_CODE_data m_code5 = new M_CODE_data(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBRSTRM + { + public short grp_no; + public short mem_no; + public M_CODE1 m_code = new M_CODE1(); + } + + /* cnc_rdproctime:read processing time stamp data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPTIME_data + { + public int prg_no; + public short hour; + public byte minute; + public byte second; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPTIME1 + { + public ODBPTIME_data data1 = new ODBPTIME_data(); + public ODBPTIME_data data2 = new ODBPTIME_data(); + public ODBPTIME_data data3 = new ODBPTIME_data(); + public ODBPTIME_data data4 = new ODBPTIME_data(); + public ODBPTIME_data data5 = new ODBPTIME_data(); + public ODBPTIME_data data6 = new ODBPTIME_data(); + public ODBPTIME_data data7 = new ODBPTIME_data(); + public ODBPTIME_data data8 = new ODBPTIME_data(); + public ODBPTIME_data data9 = new ODBPTIME_data(); + public ODBPTIME_data data10 = new ODBPTIME_data(); + } /* In case that the number of data is 10 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPTIME + { + public short num; + public ODBPTIME1 data = new ODBPTIME1(); + } + + /* cnc_rdprgdirtime:read program directory for processing time data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIRTM_data + { + public int prg_no; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 51)] + public string comment = new string(' ', 51); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 13)] + public string cuttime = new string(' ', 13); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIRTM + { + public PRGDIRTM_data data1 = new PRGDIRTM_data(); + public PRGDIRTM_data data2 = new PRGDIRTM_data(); + public PRGDIRTM_data data3 = new PRGDIRTM_data(); + public PRGDIRTM_data data4 = new PRGDIRTM_data(); + public PRGDIRTM_data data5 = new PRGDIRTM_data(); + public PRGDIRTM_data data6 = new PRGDIRTM_data(); + public PRGDIRTM_data data7 = new PRGDIRTM_data(); + public PRGDIRTM_data data8 = new PRGDIRTM_data(); + public PRGDIRTM_data data9 = new PRGDIRTM_data(); + public PRGDIRTM_data data10 = new PRGDIRTM_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdprogdir2:read program directory 2 */ +#if (!ONO8D) + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR2_data + { + public short number; + public int length; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 51)] + public string comment = new string(' ', 51); + public byte dummy; + } +#else + [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi,Pack=4)] + public class PRGDIR2_data + { + public int number ; + public int length ; + [MarshalAs(UnmanagedType.ByValTStr,SizeConst=51)] + public string comment= new string(' ',51) ; + public byte dummy ; + } +#endif + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR2 + { + public PRGDIR2_data dir1 = new PRGDIR2_data(); + public PRGDIR2_data dir2 = new PRGDIR2_data(); + public PRGDIR2_data dir3 = new PRGDIR2_data(); + public PRGDIR2_data dir4 = new PRGDIR2_data(); + public PRGDIR2_data dir5 = new PRGDIR2_data(); + public PRGDIR2_data dir6 = new PRGDIR2_data(); + public PRGDIR2_data dir7 = new PRGDIR2_data(); + public PRGDIR2_data dir8 = new PRGDIR2_data(); + public PRGDIR2_data dir9 = new PRGDIR2_data(); + public PRGDIR2_data dir10 = new PRGDIR2_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdprogdir3:read program directory 3 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class DIR3_MDATE + { + public short year; + public short month; + public short day; + public short hour; + public short minute; + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class DIR3_CDATE + { + public short year; + public short month; + public short day; + public short hour; + public short minute; + public short dummy; + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR3_data + { + public int number; + public int length; + public int page; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 52)] + public string comment = new string(' ', 52); + public DIR3_MDATE mdate = new DIR3_MDATE(); + public DIR3_CDATE cdate = new DIR3_CDATE(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR3 + { + public PRGDIR3_data dir1 = new PRGDIR3_data(); + public PRGDIR3_data dir2 = new PRGDIR3_data(); + public PRGDIR3_data dir3 = new PRGDIR3_data(); + public PRGDIR3_data dir4 = new PRGDIR3_data(); + public PRGDIR3_data dir5 = new PRGDIR3_data(); + public PRGDIR3_data dir6 = new PRGDIR3_data(); + public PRGDIR3_data dir7 = new PRGDIR3_data(); + public PRGDIR3_data dir8 = new PRGDIR3_data(); + public PRGDIR3_data dir9 = new PRGDIR3_data(); + public PRGDIR3_data dir10 = new PRGDIR3_data(); + } /* In case that the number of data is 10 */ + + + /* cnc_rdprogdir4:read program directory 4 */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class DIR4_MDATE + { + public short year; + public short month; + public short day; + public short hour; + public short minute; + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class DIR4_CDATE + { + public short year; + public short month; + public short day; + public short hour; + public short minute; + public short dummy; + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR4_data + { + public int number; + public int length; + public int page; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 52)] + public string comment = new string(' ', 52); + public DIR4_MDATE mdate = new DIR4_MDATE(); + public DIR4_CDATE cdate = new DIR4_CDATE(); + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class PRGDIR4 + { + public PRGDIR4_data dir1 = new PRGDIR4_data(); + public PRGDIR4_data dir2 = new PRGDIR4_data(); + public PRGDIR4_data dir3 = new PRGDIR4_data(); + public PRGDIR4_data dir4 = new PRGDIR4_data(); + public PRGDIR4_data dir5 = new PRGDIR4_data(); + public PRGDIR4_data dir6 = new PRGDIR4_data(); + public PRGDIR4_data dir7 = new PRGDIR4_data(); + public PRGDIR4_data dir8 = new PRGDIR4_data(); + public PRGDIR4_data dir9 = new PRGDIR4_data(); + public PRGDIR4_data dir10 = new PRGDIR4_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdcomparam:read communication parameter for DNC1, DNC2, OSI-Ethernet */ + /* cnc_wrcomparam:write communication parameter for DNC1, DNC2, OSI-Ethernet */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBCPRM + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)] + public string NcApli = new string(' ', 65); + public byte Dummy1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)] + public string HostApli = new string(' ', 65); + public byte Dummy2; + public uint StatPstv; + public uint StatNgtv; + public uint Statmask; + public uint AlarmStat; + public uint PsclHaddr; + public uint PsclLaddr; + public ushort SvcMode1; + public ushort SvcMode2; + public int FileTout; + public int RemTout; + } + + /* cnc_rdintchk:read interference check */ + /* cnc_wrintchk:write interference check */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBINT + { + public short datano_s; /* start offset No. */ + public short type; /* kind of position */ + public short datano_e; /* end offset No. */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8 * 3)] + public int[] data = new int[8 * 3]; /* position value of area for not attach */ + } + + /* cnc_rdwkcdshft:read work coordinate shift */ + /* cnc_wrwkcdshft:write work coordinate shift */ + /* cnc_rdwkcdsfms:read work coordinate shift measure */ + /* cnc_wrwkcdsfms:write work coordinate shift measure */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBWCSF + { + public short datano; /* datano */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] data = new int[MAX_AXIS]; /* data */ + } + + /* cnc_rdomhisinfo:read operator message history information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOMIF + { + public ushort om_max; /* maximum operator message history */ + public ushort om_sum; /* actually operator message history */ + public ushort om_char; /* maximum character (include NULL) */ + } + + /* cnc_rdomhistry:read operator message history */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBOMHIS_data + { + public short om_no; /* operator message number */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* mimute */ + public short second; /* second */ + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string om_msg = new string(' ', 256); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBOMHIS + { + public ODBOMHIS_data omhis1 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis2 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis3 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis4 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis5 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis6 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis7 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis8 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis9 = new ODBOMHIS_data(); + public ODBOMHIS_data omhis10 = new ODBOMHIS_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdbtofsr:read b-axis tool offset value(area specified) */ + /* cnc_wrbtofsr:write b-axis tool offset value(area specified) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBBTO + { + public short datano_s; /* start offset number */ + public short type; /* offset type */ + public short datano_e; /* end offset number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] + public int[] ofs = new int[18]; /* offset */ + } /* In case that the number of data is 9 (B type) */ + + /* cnc_rdbtofsinfo:read b-axis tool offset information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBBTLINF + { + public short ofs_type; /* memory type */ + public short use_no; /* sum of b-axis offset */ + public short sub_no; /* sub function number of offset cancel */ + } + + /* cnc_rdbaxis:read b-axis command */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBBAXIS + { + public short flag; /* b-axis command exist or not */ + public short command; /* b-axis command */ + public ushort speed; /* b-axis speed */ + public int sub_data; /* b-axis sub data */ + } + + /* cnc_rdsyssoft:read CNC system soft series and version */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBSYSS + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_p; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_l; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] module_id; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] soft_id; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series16 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version16 = new string(' ', 5); + public short soft_inst; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string boot_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string boot_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string servo_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string servo_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string ladder_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string ladder_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrlib_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrlib_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrapl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrapl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl1_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl1_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl2_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl2_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl3_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl3_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exelib_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exelib_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exeapl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exeapl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string int_vga_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string int_vga_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string out_vga_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string out_vga_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmm_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmm_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_mng_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_mng_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shin_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shin_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shout_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shout_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_c_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_c_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_edit_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_edit_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_mng_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_mng_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_apl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_apl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl4_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl4_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr2_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr2_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr3_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr3_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string eth_boot_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string eth_boot_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8 * 5)] + public byte[] reserve; + } + + /* cnc_rdsyssoft2:read CNC system soft series and version (2) */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBSYSS2 + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_p; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] slot_no_l; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] module_id; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] soft_id; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_series16 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version1 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version2 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version3 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version4 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version5 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version6 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version7 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version8 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version9 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version10 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version11 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version12 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version13 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version14 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version15 = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string soft_version16 = new string(' ', 5); + public short soft_inst; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string boot_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string boot_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string servo_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string servo_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string ladder_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string ladder_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrlib_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrlib_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrapl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcrapl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl1_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl1_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl2_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl2_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl3_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl3_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exelib_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exelib_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exeapl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string c_exeapl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string int_vga_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string int_vga_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string out_vga_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string out_vga_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmm_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmm_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_mng_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_mng_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shin_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shin_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shout_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_shout_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_c_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_c_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_edit_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string pmc_edit_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_mng_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_mng_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_apl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string lddr_apl_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl4_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string spl4_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr2_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr2_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr3_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string mcr3_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string eth_boot_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string eth_boot_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8 * 5)] + public byte[] reserve; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string embEthe_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string embEthe_ver = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 38 * 5)] + public byte[] reserve2; + } + + /* cnc_rdsyssoft3:read CNC system soft series and version (3) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSS3_data + { + public short soft_id; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public char[] soft_series; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public char[] soft_edition; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSS3 + { + public ODBSYSS3_data p1 = new ODBSYSS3_data(); + public ODBSYSS3_data p2 = new ODBSYSS3_data(); + public ODBSYSS3_data p3 = new ODBSYSS3_data(); + public ODBSYSS3_data p4 = new ODBSYSS3_data(); + public ODBSYSS3_data p5 = new ODBSYSS3_data(); + public ODBSYSS3_data p6 = new ODBSYSS3_data(); + public ODBSYSS3_data p7 = new ODBSYSS3_data(); + public ODBSYSS3_data p8 = new ODBSYSS3_data(); + public ODBSYSS3_data p9 = new ODBSYSS3_data(); + public ODBSYSS3_data p10 = new ODBSYSS3_data(); + public ODBSYSS3_data p11 = new ODBSYSS3_data(); + public ODBSYSS3_data p12 = new ODBSYSS3_data(); + public ODBSYSS3_data p13 = new ODBSYSS3_data(); + public ODBSYSS3_data p14 = new ODBSYSS3_data(); + public ODBSYSS3_data p15 = new ODBSYSS3_data(); + public ODBSYSS3_data p16 = new ODBSYSS3_data(); + public ODBSYSS3_data p17 = new ODBSYSS3_data(); + public ODBSYSS3_data p18 = new ODBSYSS3_data(); + public ODBSYSS3_data p19 = new ODBSYSS3_data(); + public ODBSYSS3_data p20 = new ODBSYSS3_data(); + public ODBSYSS3_data p21 = new ODBSYSS3_data(); + public ODBSYSS3_data p22 = new ODBSYSS3_data(); + public ODBSYSS3_data p23 = new ODBSYSS3_data(); + public ODBSYSS3_data p24 = new ODBSYSS3_data(); + public ODBSYSS3_data p25 = new ODBSYSS3_data(); + public ODBSYSS3_data p26 = new ODBSYSS3_data(); + public ODBSYSS3_data p27 = new ODBSYSS3_data(); + public ODBSYSS3_data p28 = new ODBSYSS3_data(); + public ODBSYSS3_data p29 = new ODBSYSS3_data(); + public ODBSYSS3_data p30 = new ODBSYSS3_data(); + public ODBSYSS3_data p31 = new ODBSYSS3_data(); + public ODBSYSS3_data p32 = new ODBSYSS3_data(); + public ODBSYSS3_data p33 = new ODBSYSS3_data(); + public ODBSYSS3_data p34 = new ODBSYSS3_data(); + public ODBSYSS3_data p35 = new ODBSYSS3_data(); + public ODBSYSS3_data p36 = new ODBSYSS3_data(); + public ODBSYSS3_data p37 = new ODBSYSS3_data(); + public ODBSYSS3_data p38 = new ODBSYSS3_data(); + public ODBSYSS3_data p39 = new ODBSYSS3_data(); + public ODBSYSS3_data p40 = new ODBSYSS3_data(); + } + + /* cnc_rdsyshard:read CNC system hard info */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSH_data + { + public uint id1; + public uint id2; + public short group_id; + public short hard_id; + public short hard_num; + public short slot_no; + public short id1_format; + public short id2_format; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSH + { + public ODBSYSH_data data1 = new ODBSYSH_data(); + public ODBSYSH_data data2 = new ODBSYSH_data(); + public ODBSYSH_data data3 = new ODBSYSH_data(); + public ODBSYSH_data data4 = new ODBSYSH_data(); + public ODBSYSH_data data5 = new ODBSYSH_data(); + public ODBSYSH_data data6 = new ODBSYSH_data(); + public ODBSYSH_data data7 = new ODBSYSH_data(); + public ODBSYSH_data data8 = new ODBSYSH_data(); + public ODBSYSH_data data9 = new ODBSYSH_data(); + public ODBSYSH_data data10 = new ODBSYSH_data(); + public ODBSYSH_data data11 = new ODBSYSH_data(); + public ODBSYSH_data data12 = new ODBSYSH_data(); + public ODBSYSH_data data13 = new ODBSYSH_data(); + public ODBSYSH_data data14 = new ODBSYSH_data(); + public ODBSYSH_data data15 = new ODBSYSH_data(); + public ODBSYSH_data data16 = new ODBSYSH_data(); + public ODBSYSH_data data17 = new ODBSYSH_data(); + public ODBSYSH_data data18 = new ODBSYSH_data(); + public ODBSYSH_data data19 = new ODBSYSH_data(); + public ODBSYSH_data data20 = new ODBSYSH_data(); + public ODBSYSH_data data21 = new ODBSYSH_data(); + public ODBSYSH_data data22 = new ODBSYSH_data(); + public ODBSYSH_data data23 = new ODBSYSH_data(); + public ODBSYSH_data data24 = new ODBSYSH_data(); + public ODBSYSH_data data25 = new ODBSYSH_data(); + } + + /* cnc_rdmdlconfig:read CNC module configuration information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMDLC + { + public short from; + public short dram; + public short sram; + public short pmc; + public short crtc; + public short servo12; + public short servo34; + public short servo56; + public short servo78; + public short sic; + public short pos_lsi; + public short hi_aio; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] + public short[] reserve; + public short drmmrc; + public short drmarc; + public short pmcmrc; + public short dmaarc; + public short iopt; + public short hdiio; + public short gm2gr1; + public short crtgr2; + public short gm1gr2; + public short gm2gr2; + public short cmmrb; + public short sv5axs; + public short sv7axs; + public short sicaxs; + public short posaxs; + public short hamaxs; + public short romr64; + public short srmr64; + public short dr1r64; + public short dr2r64; + public short iopio2; + public short hdiio2; + public short cmmrb2; + public short romfap; + public short srmfap; + public short drmfap; + public short drmare; + public short pmcmre; + public short dmaare; + public short frmbgg; + public short drmbgg; + public short asrbgg; + public short edtpsc; + public short slcpsc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 34)] + public short[] reserve2; + } + + /* cnc_rdpscdproc:read processing condition file (processing data) */ + /* cnc_wrpscdproc:write processing condition file (processing data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSCD_data + { + public short slct; + public int feed; + public short power; + public short freq; + public short duty; + public short g_press; + public short g_kind; + public short g_ready_t; + public short displace; + public int supple; + public short edge_slt; + public short appr_slt; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] reserve = new short[5]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPSCD + { + public IODBPSCD_data data1 = new IODBPSCD_data(); + public IODBPSCD_data data2 = new IODBPSCD_data(); + public IODBPSCD_data data3 = new IODBPSCD_data(); + public IODBPSCD_data data4 = new IODBPSCD_data(); + public IODBPSCD_data data5 = new IODBPSCD_data(); + public IODBPSCD_data data6 = new IODBPSCD_data(); + public IODBPSCD_data data7 = new IODBPSCD_data(); + public IODBPSCD_data data8 = new IODBPSCD_data(); + public IODBPSCD_data data9 = new IODBPSCD_data(); + public IODBPSCD_data data10 = new IODBPSCD_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdpscdpirc:read processing condition file (piercing data) */ + /* cnc_wrpscdpirc:write processing condition file (piercing data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPIRC_data + { + public short slct; + public short power; + public short freq; + public short duty; + public short i_freq; + public short i_duty; + public short step_t; + public short step_sum; + public int pier_t; + public short g_press; + public short g_kind; + public short g_time; + public short def_pos; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public short[] reserve = new short[4]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPIRC + { + public IODBPIRC_data data1 = new IODBPIRC_data(); + public IODBPIRC_data data2 = new IODBPIRC_data(); + public IODBPIRC_data data3 = new IODBPIRC_data(); + } + + /* cnc_rdpscdedge:read processing condition file (edging data) */ + /* cnc_wrpscdedge:write processing condition file (edging data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBEDGE_data + { + public short slct; + public short angle; + public short power; + public short freq; + public short duty; + public int pier_t; + public short g_press; + public short g_kind; + public int r_len; + public short r_feed; + public short r_freq; + public short r_duty; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] reserve = new short[5]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBEDGE + { + public IODBEDGE_data data1 = new IODBEDGE_data(); + public IODBEDGE_data data2 = new IODBEDGE_data(); + public IODBEDGE_data data3 = new IODBEDGE_data(); + public IODBEDGE_data data4 = new IODBEDGE_data(); + public IODBEDGE_data data5 = new IODBEDGE_data(); + } + + /* cnc_rdpscdslop:read processing condition file (slope data) */ + /* cnc_wrpscdslop:write processing condition file (slope data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLOP_data + { + public int slct; + public int upleng; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public short[] upsp = new short[10]; + public int dwleng; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public short[] dwsp = new short[10]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public short[] reserve = new short[10]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLOP + { + public IODBSLOP_data data1 = new IODBSLOP_data(); + public IODBSLOP_data data2 = new IODBSLOP_data(); + public IODBSLOP_data data3 = new IODBSLOP_data(); + public IODBSLOP_data data4 = new IODBSLOP_data(); + public IODBSLOP_data data5 = new IODBSLOP_data(); + } + + /* cnc_rdlpwrdty:read power controll duty data */ + /* cnc_wrlpwrdty:write power controll duty data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBLPWDT + { + public short slct; + public short dty_const; + public short dty_min; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public short[] reserve = new short[6]; + } + + /* cnc_rdlpwrdat:read laser power data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBLOPDT + { + public short slct; + public short pwr_mon; + public short pwr_ofs; + public short pwr_act; + public int feed_act; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public short[] reserve; + } + + /* cnc_rdlagslt:read laser assist gas selection */ + /* cnc_wrlagslt:write laser assist gas selection */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBLAGSL + { + public short slct; + public short ag_slt; + public short agflow_slt; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public short[] reserve = new short[6]; + } + + /* cnc_rdlagst:read laser assist gas flow */ + /* cnc_wrlagst:write laser assist gas flow */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class GASFLOW + { + public short slct; + public short pre_time; + public short pre_press; + public short proc_press; + public short end_time; + public short end_press; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public short[] reserve = new short[3]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBLAGST + { + public GASFLOW data1 = new GASFLOW(); + public GASFLOW data2 = new GASFLOW(); + public GASFLOW data3 = new GASFLOW(); + } + + /* cnc_rdledgprc:read laser power for edge processing */ + /* cnc_wrledgprc:write laser power for edge processing */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBLEGPR + { + public short slct; + public short power; + public short freq; + public short duty; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] reserve = new short[5]; + } + + /* cnc_rdlprcprc:read laser power for piercing */ + /* cnc_wrlprcprc:write laser power for piercing */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBLPCPR + { + public short slct; + public short power; + public short freq; + public short duty; + public int time; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public short[] reserve = new short[4]; + } + + /* cnc_rdlcmddat:read laser command data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBLCMDT + { + public short slct; + public int feed; + public short power; + public short freq; + public short duty; + public short g_kind; + public short g_ready_t; + public short g_press; + public short error; + public int dsplc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public short[] reserve = new short[7]; + } + + /* cnc_rdlactnum:read active number */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBLACTN + { + public short slct; + public short act_proc; + public short act_pirce; + public short act_slop; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] reserve = new short[5]; + } + + /* cnc_rdlcmmt:read laser comment */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBLCMMT + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 25)] + public string comment = new string(' ', 25); + } + + /* cnc_rdpwofsthis:read power correction factor history data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPWOFST_data + { + public int pwratio; + public int rfvolt; + public ushort year; + public ushort month; + public ushort day; + public ushort hour; + public ushort minute; + public ushort second; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPWOFST + { + public ODBPWOFST_data data1 = new ODBPWOFST_data(); + public ODBPWOFST_data data2 = new ODBPWOFST_data(); + public ODBPWOFST_data data3 = new ODBPWOFST_data(); + public ODBPWOFST_data data4 = new ODBPWOFST_data(); + public ODBPWOFST_data data5 = new ODBPWOFST_data(); + public ODBPWOFST_data data6 = new ODBPWOFST_data(); + public ODBPWOFST_data data7 = new ODBPWOFST_data(); + public ODBPWOFST_data data8 = new ODBPWOFST_data(); + public ODBPWOFST_data data9 = new ODBPWOFST_data(); + public ODBPWOFST_data data10 = new ODBPWOFST_data(); + public ODBPWOFST_data data11 = new ODBPWOFST_data(); + public ODBPWOFST_data data12 = new ODBPWOFST_data(); + public ODBPWOFST_data data13 = new ODBPWOFST_data(); + public ODBPWOFST_data data14 = new ODBPWOFST_data(); + public ODBPWOFST_data data15 = new ODBPWOFST_data(); + public ODBPWOFST_data data16 = new ODBPWOFST_data(); + public ODBPWOFST_data data17 = new ODBPWOFST_data(); + public ODBPWOFST_data data18 = new ODBPWOFST_data(); + public ODBPWOFST_data data19 = new ODBPWOFST_data(); + public ODBPWOFST_data data20 = new ODBPWOFST_data(); + public ODBPWOFST_data data21 = new ODBPWOFST_data(); + public ODBPWOFST_data data22 = new ODBPWOFST_data(); + public ODBPWOFST_data data23 = new ODBPWOFST_data(); + public ODBPWOFST_data data24 = new ODBPWOFST_data(); + public ODBPWOFST_data data25 = new ODBPWOFST_data(); + public ODBPWOFST_data data26 = new ODBPWOFST_data(); + public ODBPWOFST_data data27 = new ODBPWOFST_data(); + public ODBPWOFST_data data28 = new ODBPWOFST_data(); + public ODBPWOFST_data data29 = new ODBPWOFST_data(); + public ODBPWOFST_data data30 = new ODBPWOFST_data(); + } + + /* cnc_rdmngtime:read management time */ + /* cnc_wrmngtime:write management time */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMNGTIME_data + { + public uint life; + public uint total; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMNGTIME + { + public IODBMNGTIME_data data1 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data2 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data3 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data4 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data5 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data6 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data7 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data8 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data9 = new IODBMNGTIME_data(); + public IODBMNGTIME_data data10 = new IODBMNGTIME_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rddischarge:read data related to electrical discharge at power correction ends */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDISCHRG + { + public ushort aps; + public ushort year; + public ushort month; + public ushort day; + public ushort hour; + public ushort minute; + public ushort second; + public short hpc; + public short hfq; + public short hdt; + public short hpa; + public int hce; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] rfi; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] rfv; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dci; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dcv; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dcw; + } + + /* cnc_rddischrgalm:read alarm history data related to electrical discharg */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDISCHRGALM_data + { + public ushort year; + public ushort month; + public ushort day; + public ushort hour; + public ushort minute; + public ushort second; + public int almnum; + public uint psec; + public short hpc; + public short hfq; + public short hdt; + public short hpa; + public int hce; + public ushort asq; + public ushort psu; + public ushort aps; + public short dummy; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] rfi; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] rfv; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dci; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dcv; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] dcw; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public short[] almcd; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBDISCHRGALM + { + public ODBDISCHRGALM_data data1 = new ODBDISCHRGALM_data(); + public ODBDISCHRGALM_data data2 = new ODBDISCHRGALM_data(); + public ODBDISCHRGALM_data data3 = new ODBDISCHRGALM_data(); + public ODBDISCHRGALM_data data4 = new ODBDISCHRGALM_data(); + public ODBDISCHRGALM_data data5 = new ODBDISCHRGALM_data(); + } + + /* cnc_gettimer:get date and time from cnc */ + /* cnc_settimer:set date and time for cnc */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct TIMER_DATE + { + public short year; + public short month; + public short date; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct TIMER_TIME + { + public short hour; + public short minute; + public short second; + } + [StructLayout(LayoutKind.Explicit)] + public class IODBTIMER + { + [FieldOffset(0)] + public short type; + [FieldOffset(2)] + public short dummy; + [FieldOffset(4)] + public TIMER_DATE date; + [FieldOffset(4)] + public TIMER_TIME time; + } + + /* cnc_rdtimer:read timer data from cnc */ + /* cnc_wrtimer:write timer data for cnc */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTIME + { + public int minute; + public int msec; + } + + /* cnc_rdtlctldata: read tool controll data */ + /* cnc_wrtlctldata: write tool controll data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLCTL + { + public short slct; + public short used_tool; + public short turret_indx; + public int zero_tl_no; + public int t_axis_move; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] total_punch = new int[2]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] + public short[] reserve = new short[11]; + } + + /* cnc_rdtooldata: read tool data */ + /* cnc_wrtooldata: read tool data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLDT_data + { + public short slct; + public int tool_no; + public int x_axis_ofs; + public int y_axis_ofs; + public int turret_pos; + public int chg_tl_no; + public int punch_count; + public int tool_life; + public int m_tl_radius; + public int m_tl_angle; + public byte tl_shape; + public int tl_size_i; + public int tl_size_j; + public int tl_angle; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public int[] reserve = new int[3]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLDT + { + public IODBTLDT_data data1 = new IODBTLDT_data(); + public IODBTLDT_data data2 = new IODBTLDT_data(); + public IODBTLDT_data data3 = new IODBTLDT_data(); + public IODBTLDT_data data4 = new IODBTLDT_data(); + public IODBTLDT_data data5 = new IODBTLDT_data(); + public IODBTLDT_data data6 = new IODBTLDT_data(); + public IODBTLDT_data data7 = new IODBTLDT_data(); + public IODBTLDT_data data8 = new IODBTLDT_data(); + public IODBTLDT_data data9 = new IODBTLDT_data(); + public IODBTLDT_data data10 = new IODBTLDT_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdmultitldt: read multi tool data */ + /* cnc_wrmultitldt: write multi tool data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMLTTL_data + { + public short slct; + public short m_tl_no; + public int m_tl_radius; + public int m_tl_angle; + public int x_axis_ofs; + public int y_axis_ofs; + public byte tl_shape; + public int tl_size_i; + public int tl_size_j; + public int tl_angle; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public int[] reserve = new int[7]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMLTTL + { + public IODBMLTTL_data data1 = new IODBMLTTL_data(); + public IODBMLTTL_data data2 = new IODBMLTTL_data(); + public IODBMLTTL_data data3 = new IODBMLTTL_data(); + public IODBMLTTL_data data4 = new IODBMLTTL_data(); + public IODBMLTTL_data data5 = new IODBMLTTL_data(); + public IODBMLTTL_data data6 = new IODBMLTTL_data(); + public IODBMLTTL_data data7 = new IODBMLTTL_data(); + public IODBMLTTL_data data8 = new IODBMLTTL_data(); + public IODBMLTTL_data data9 = new IODBMLTTL_data(); + public IODBMLTTL_data data10 = new IODBMLTTL_data(); + } /* In case that the number of data is 10 */ + + /* cnc_rdmtapdata: read multi tap data */ + /* cnc_wrmtapdata: write multi tap data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMTAP_data + { + public short slct; + public int tool_no; + public int x_axis_ofs; + public int y_axis_ofs; + public int punch_count; + public int tool_life; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] + public int[] reserve = new int[11]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBMTAP + { + public IODBMTAP_data data1 = new IODBMTAP_data(); + public IODBMTAP_data data2 = new IODBMTAP_data(); + public IODBMTAP_data data3 = new IODBMTAP_data(); + public IODBMTAP_data data4 = new IODBMTAP_data(); + public IODBMTAP_data data5 = new IODBMTAP_data(); + public IODBMTAP_data data6 = new IODBMTAP_data(); + public IODBMTAP_data data7 = new IODBMTAP_data(); + public IODBMTAP_data data8 = new IODBMTAP_data(); + public IODBMTAP_data data9 = new IODBMTAP_data(); + public IODBMTAP_data data10 = new IODBMTAP_data(); + } + + /* cnc_rdtoolinfo: read tool information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPTLINF + { + public short tld_max; + public short mlt_max; + public short reserve; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] tld_size; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] mlt_size; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public short[] reserves; + } + + /* cnc_rdsafetyzone: read safetyzone data */ + /* cnc_wrsafetyzone: write safetyzone data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSAFE_data + { + public short slct; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public int[] data = new int[3]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSAFE + { + public IODBSAFE_data data1 = new IODBSAFE_data(); + public IODBSAFE_data data2 = new IODBSAFE_data(); + public IODBSAFE_data data3 = new IODBSAFE_data(); + public IODBSAFE_data data4 = new IODBSAFE_data(); + } /* In case that the number of data is 4 */ + + /* cnc_rdtoolzone: read toolzone data */ + /* cnc_wrtoolzone: write toolzone data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLZN_data + { + public short slct; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] data = new int[12]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBTLZN + { + public IODBTLZN_data data1 = new IODBTLZN_data(); + public IODBTLZN_data data2 = new IODBTLZN_data(); + public IODBTLZN_data data3 = new IODBTLZN_data(); + public IODBTLZN_data data4 = new IODBTLZN_data(); + public IODBTLZN_data data5 = new IODBTLZN_data(); + public IODBTLZN_data data6 = new IODBTLZN_data(); + public IODBTLZN_data data7 = new IODBTLZN_data(); + public IODBTLZN_data data8 = new IODBTLZN_data(); + public IODBTLZN_data data9 = new IODBTLZN_data(); + public IODBTLZN_data data10 = new IODBTLZN_data(); + public IODBTLZN_data data11 = new IODBTLZN_data(); + public IODBTLZN_data data12 = new IODBTLZN_data(); + } /* In case that the number of data is 12 */ + + /* cnc_rdacttlzone: read active toolzone data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBACTTLZN + { + public short act_no; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] data; + } + + /* cnc_rdbrstrinfo:read block restart information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBBRS + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] dest; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] dist; + } /* In case that the number of axes is MAX_AXIS */ + + /* cnc_rdradofs:read tool radius offset for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBROFS + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] pln_axes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] ofsvct; + } + + /* cnc_rdlenofs:read tool length offset for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBLOFS + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ofsvct; + } /* In case that the number of axes is MAX_AXIS */ + + /* cnc_rdfixcycle:read fixed cycle for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBFIX + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] pln_axes; + public short drl_axes; + public int i_pos; + public int r_pos; + public int z_pos; + public int cmd_cnt; + public int act_cnt; + public int cut; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] shift; + } + + /* cnc_rdcdrotate:read coordinate rotate for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBROT + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] pln_axes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] center; + public int angle; + } + + /* cnc_rd3dcdcnv:read 3D coordinate convert for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DCD + { + public short mode; + public short dno; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public short[] cd_axes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2 * 3)] + public int[] center; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2 * 3)] + public int[] direct; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] angle; + } + + /* cnc_rdmirimage:read programable mirror image for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBMIR + { + public short mode; + public int mir_flag; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] mir_pos; + } /* In case that the number of axes is MAX_AXIS */ + + /* cnc_rdscaling:read scaling data for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSCL + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] center; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] magnif; + } /* In case that the number of axes is MAX_AXIS */ + + /* cnc_rd3dtofs:read 3D tool offset for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DTO + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public short[] ofs_axes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public int[] ofsvct; + } + + /* cnc_rdposofs:read tool position offset for position data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPOFS + { + public short mode; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public int[] ofsvct; + } /* In case that the number of axes is MAX_AXIS */ + + /* cnc_rdhpccset:read hpcc setting data */ + /* cnc_wrhpccset:write hpcc setting data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBHPST + { + public short slct; + public short hpcc; + public short multi; + public short ovr1; + public short ign_f; + public short foward; + public int max_f; + public short ovr2; + public short ovr3; + public short ovr4; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public int[] reserve = new int[7]; + } + + /* cnc_rdhpcctupr:read hpcc tuning data ( parameter input ) */ + /* cnc_wrhpcctupr:write hpcc tuning data ( parameter input ) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBHPPR_tune + { + public short slct; + public short diff; + public short fine; + public short acc_lv; + public int max_f; + public short bipl; + public short aipl; + public int corner; + public short clamp; + public int radius; + public int max_cf; + public int min_cf; + public int foward; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] reserve = new int[5]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBHPPR + { + public IODBHPPR_tune tune1 = new IODBHPPR_tune(); + public IODBHPPR_tune tune2 = new IODBHPPR_tune(); + public IODBHPPR_tune tune3 = new IODBHPPR_tune(); + } + + /* cnc_rdhpcctuac:read hpcc tuning data ( acc input ) */ + /* cnc_wrhpcctuac:write hpcc tuning data ( acc input ) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBHPAC_tune + { + public short slct; + public short diff; + public short fine; + public short acc_lv; + public int bipl; + public short aipl; + public int corner; + public int clamp; + public int c_acc; + public int foward; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public int[] reserve = new int[8]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBHPAC + { + public IODBHPAC_tune tune1 = new IODBHPAC_tune(); + public IODBHPAC_tune tune2 = new IODBHPAC_tune(); + public IODBHPAC_tune tune3 = new IODBHPAC_tune(); + } + + /* cnc_rd3dtooltip:read tip of tool for 3D handle */ + /* cnc_rd3dmovrlap:read move overrlap of tool for 3D handle */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DHDL_data + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] axes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] data; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DHDL + { + public ODB3DHDL_data data1 = new ODB3DHDL_data(); + public ODB3DHDL_data data2 = new ODB3DHDL_data(); + } + + /* cnc_rd3dpulse:read pulse for 3D handle */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DPLS_data + { + public int right_angle_x; + public int right_angle_y; + public int tool_axis; + public int tool_tip_a_b; + public int tool_tip_c; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODB3DPLS + { + public ODB3DPLS_data pls1 = new ODB3DPLS_data(); + public ODB3DPLS_data pls2 = new ODB3DPLS_data(); + } + + /* cnc_rdaxisname: read axis name */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAXISNAME_data + { + public byte name; /* axis name */ + public byte suff; /* suffix */ + } +#if M_AXIS2 + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBAXISNAME + { + public ODBAXISNAME_data data1 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data2 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data3 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data4 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data5 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data6 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data7 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data8 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data9 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data10= new ODBAXISNAME_data(); + public ODBAXISNAME_data data11= new ODBAXISNAME_data(); + public ODBAXISNAME_data data12= new ODBAXISNAME_data(); + public ODBAXISNAME_data data13= new ODBAXISNAME_data(); + public ODBAXISNAME_data data14= new ODBAXISNAME_data(); + public ODBAXISNAME_data data15= new ODBAXISNAME_data(); + public ODBAXISNAME_data data16= new ODBAXISNAME_data(); + public ODBAXISNAME_data data17= new ODBAXISNAME_data(); + public ODBAXISNAME_data data18= new ODBAXISNAME_data(); + public ODBAXISNAME_data data19= new ODBAXISNAME_data(); + public ODBAXISNAME_data data20= new ODBAXISNAME_data(); + public ODBAXISNAME_data data21= new ODBAXISNAME_data(); + public ODBAXISNAME_data data22= new ODBAXISNAME_data(); + public ODBAXISNAME_data data23= new ODBAXISNAME_data(); + public ODBAXISNAME_data data24= new ODBAXISNAME_data(); + } +#elif FS15D + [StructLayout(LayoutKind.Sequential,Pack=4)] + public class ODBAXISNAME + { + public ODBAXISNAME_data data1 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data2 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data3 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data4 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data5 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data6 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data7 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data8 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data9 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data10= new ODBAXISNAME_data(); + } +#else + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBAXISNAME + { + public ODBAXISNAME_data data1 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data2 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data3 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data4 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data5 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data6 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data7 = new ODBAXISNAME_data(); + public ODBAXISNAME_data data8 = new ODBAXISNAME_data(); + } +#endif + + /* cnc_rdspdlname: read spindle name */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDLNAME_data + { + public byte name; /* spindle name */ + public byte suff1; /* suffix */ + public byte suff2; /* suffix */ + public byte suff3; /* suffix */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSPDLNAME + { + public ODBSPDLNAME_data data1 = new ODBSPDLNAME_data(); + public ODBSPDLNAME_data data2 = new ODBSPDLNAME_data(); + public ODBSPDLNAME_data data3 = new ODBSPDLNAME_data(); + public ODBSPDLNAME_data data4 = new ODBSPDLNAME_data(); + } + + /* cnc_exaxisname: read extended axis name */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBEXAXISNAME + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname1 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname2 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname3 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname4 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname5 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname6 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname7 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname8 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname9 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname10 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname11 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname12 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname13 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname14 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname15 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname16 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname17 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname18 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname19 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname20 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname21 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname22 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname23 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname24 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname25 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname26 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname27 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname28 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname29 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname30 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname31 = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string axname32 = new string(' ', 4); + } + + /* cnc_wrunsolicprm: Set the unsolicited message parameters */ + /* cnc_rdunsolicprm: Get the unsolicited message parameters */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct IODBUNSOLIC_pmc + { + public short type; + public short rdaddr; + public short rdno; + public short rdsize; + private int dummy; + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBUNSOLIC + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string ipaddr = new string(' ', 16); + public ushort port; + public short reqaddr; + public short pmcno; + public short retry; + public short timeout; + public short alivetime; + public short setno; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public IODBUNSOLIC_pmc[] rddata = new IODBUNSOLIC_pmc[3]; + } + + /* cnc_rdunsolicmsg: Reads the unsolicited message data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct IDBUNSOLICMSG_msg + { + public short rdsize; + public IntPtr data; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBUNSOLICMSG + { + public short getno; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public IDBUNSOLICMSG_msg[] msg = new IDBUNSOLICMSG_msg[3]; + } + + /* cnc_rdpm_cncitem: read cnc maintenance item */ + /* cnc_rdpm_mcnitem: read machine specific maintenance item */ + /* cnc_wrpm_mcnitem: write machine specific maintenance item */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBITEM + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name1 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name2 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name3 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name4 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name5 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name6 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name7 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name8 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name9 = new string(' ', 62); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name10 = new string(' ', 62); + } + + /* cnc_rdpm_item:read maintenance item status */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMAINTE_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 62)] + public string name = new string(' ', 62); /* name */ + public int type; /* life count type */ + public int total; /* total life time (minite basis) */ + public int remain; /* life rest time */ + public int stat; /* life state */ + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMAINTE + { + public IODBPMAINTE_data data1 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data2 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data3 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data4 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data5 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data6 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data7 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data8 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data9 = new IODBPMAINTE_data(); + public IODBPMAINTE_data data10 = new IODBPMAINTE_data(); + } + + /* cnc_sysinfo_ex:read CNC system path information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSEX_path + { + public short system; + public short group; + public short attrib; + public short ctrl_axis; + public short ctrl_srvo; + public short ctrl_spdl; + public short mchn_no; + public short reserved; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSEX_data + { + public ODBSYSEX_path data1 = new ODBSYSEX_path(); + public ODBSYSEX_path data2 = new ODBSYSEX_path(); + public ODBSYSEX_path data3 = new ODBSYSEX_path(); + public ODBSYSEX_path data4 = new ODBSYSEX_path(); + public ODBSYSEX_path data5 = new ODBSYSEX_path(); + public ODBSYSEX_path data6 = new ODBSYSEX_path(); + public ODBSYSEX_path data7 = new ODBSYSEX_path(); + public ODBSYSEX_path data8 = new ODBSYSEX_path(); + public ODBSYSEX_path data9 = new ODBSYSEX_path(); + public ODBSYSEX_path data10 = new ODBSYSEX_path(); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSYSEX + { + public short max_axis; + public short max_spdl; + public short max_path; + public short max_mchn; + public short ctrl_axis; + public short ctrl_srvo; + public short ctrl_spdl; + public short ctrl_path; + public short ctrl_mchn; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public short[] reserved = new short[3]; + public ODBSYSEX_data path = new ODBSYSEX_data(); + } + + /*------------------*/ + /* CNC : SERCOS I/F */ + /*------------------*/ + + /* cnc_srcsrdidinfo:Read ID information of SERCOS I/F */ + /* cnc_srcswridinfo:Write ID information of SERCOS I/F */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class IODBIDINF + { + public int id_no; + public short drv_no; + public short acc_element; + public short err_general; + public short err_id_no; + public short err_id_name; + public short err_attr; + public short err_unit; + public short err_min_val; + public short err_max_val; + public short id_name_len; + public short id_name_max; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 60)] + public string id_name = new string(' ', 60); + public int attr; + public short unit_len; + public short unit_max; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] + public byte[] unit = new byte[12]; + public int min_val; + public int max_val; + } + + /* cnc_srcsrdexstat:Get execution status of reading/writing operation data of SERCOS I/F */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSRCSST + { + public short acc_element; + public short err_general; + public short err_id_no; + public short err_attr; + public short err_op_data; + } + + /* cnc_srcsrdlayout:Read drive assign of SERCOS I/F */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBSRCSLYT + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public short[] spndl; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public short[] servo; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string axis_name = new string(' ', 8); + } + + /*----------------------------*/ + /* CNC : Servo Guide */ + /*----------------------------*/ + /* cnc_sdsetchnl:Servo Guide (Channel data set) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBCHAN_data + { + public byte chno; + public sbyte axis; + public int datanum; + public ushort datainf; + public short dataadr; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBCHAN + { + public IDBCHAN_data data1 = new IDBCHAN_data(); + public IDBCHAN_data data2 = new IDBCHAN_data(); + public IDBCHAN_data data3 = new IDBCHAN_data(); + public IDBCHAN_data data4 = new IDBCHAN_data(); + public IDBCHAN_data data5 = new IDBCHAN_data(); + public IDBCHAN_data data6 = new IDBCHAN_data(); + public IDBCHAN_data data7 = new IDBCHAN_data(); + public IDBCHAN_data data8 = new IDBCHAN_data(); + } + + /* cnc_sdsetchnl:Servo Guide (read Sampling data) */ + /* cnc_sfbreadsmpl:Servo feedback data (read Sampling data) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSD + { + public IntPtr chadata; + public IntPtr count; + } + + /* cnc_sfbsetchnl:Servo feedback data (Channel data set) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IDBSFBCHAN + { + public byte chno; + public sbyte axis; + public ushort shift; + } + + + /*-------------------------*/ + /* CNC : FS18-LN function */ + /*-------------------------*/ + + /* cnc_allowcnd:read allowanced state */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBCAXIS + { + public short dummy; /* dummy */ + public short type; /* axis number */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AXIS)] + public sbyte[] data; /* data value */ + } + + + /*---------------------------------*/ + /* CNC : C-EXE SRAM file function */ + /*---------------------------------*/ + + /* read C-EXE SRAM disk directory */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class CFILEINFO_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] + public string fname = new string(' ', 12); /* file name */ + public int file_size; /* file size (bytes) */ + public int file_attr; /* attribute */ + public short year; /* year */ + public short month; /* month */ + public short day; /* day */ + public short hour; /* hour */ + public short minute; /* mimute */ + public short second; /* second */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class CFILEINFO + { + public CFILEINFO_data data1 = new CFILEINFO_data(); + public CFILEINFO_data data2 = new CFILEINFO_data(); + public CFILEINFO_data data3 = new CFILEINFO_data(); + public CFILEINFO_data data4 = new CFILEINFO_data(); + public CFILEINFO_data data5 = new CFILEINFO_data(); + public CFILEINFO_data data6 = new CFILEINFO_data(); + public CFILEINFO_data data7 = new CFILEINFO_data(); + public CFILEINFO_data data8 = new CFILEINFO_data(); + public CFILEINFO_data data9 = new CFILEINFO_data(); + public CFILEINFO_data data10 = new CFILEINFO_data(); + } + + /*-----*/ + /* PMC */ + /*-----*/ + + /* pmc_rdpmcrng:read PMC data(area specified) */ + /* pmc_wrpmcrng:write PMC data(area specified) */ + [StructLayout(LayoutKind.Explicit)] + public class IODBPMC0 + { + [FieldOffset(0)] + public short type_a; /* PMC address type */ + [FieldOffset(2)] + public short type_d; /* PMC data type */ + [FieldOffset(4)] + public short datano_s; /* start PMC address */ + [FieldOffset(6)] + public short datano_e; /* end PMC address */ + [FieldOffset(8), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public byte[] cdata; /* PMC data */ + } /* In case that the number of data is 5 */ + + [StructLayout(LayoutKind.Explicit)] + public class IODBPMC1 + { + [FieldOffset(0)] + public short type_a; /* PMC address type */ + [FieldOffset(2)] + public short type_d; /* PMC data type */ + [FieldOffset(4)] + public short datano_s; /* start PMC address */ + [FieldOffset(6)] + public short datano_e; /* end PMC address */ + [FieldOffset(8), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public short[] idata; + } /* In case that the number of data is 5 */ + + [StructLayout(LayoutKind.Explicit)] + public class IODBPMC2 + { + [FieldOffset(0)] + public short type_a; /* PMC address type */ + [FieldOffset(2)] + public short type_d; /* PMC data type */ + [FieldOffset(4)] + public short datano_s; /* start PMC address */ + [FieldOffset(6)] + public short datano_e; /* end PMC address */ + [FieldOffset(8), + MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] ldata; + } /* In case that the number of data is 5 */ + + /* pmc_rdpmcinfo:read informations of PMC data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCINF_info + { + public char pmc_adr; + public byte adr_attr; + public ushort top_num; + public ushort last_num; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCINF1 + { + public ODBPMCINF_info info1 = new ODBPMCINF_info(); + public ODBPMCINF_info info2 = new ODBPMCINF_info(); + public ODBPMCINF_info info3 = new ODBPMCINF_info(); + public ODBPMCINF_info info4 = new ODBPMCINF_info(); + public ODBPMCINF_info info5 = new ODBPMCINF_info(); + public ODBPMCINF_info info6 = new ODBPMCINF_info(); + public ODBPMCINF_info info7 = new ODBPMCINF_info(); + public ODBPMCINF_info info8 = new ODBPMCINF_info(); + public ODBPMCINF_info info9 = new ODBPMCINF_info(); + public ODBPMCINF_info info10 = new ODBPMCINF_info(); + public ODBPMCINF_info info11 = new ODBPMCINF_info(); + public ODBPMCINF_info info12 = new ODBPMCINF_info(); + public ODBPMCINF_info info13 = new ODBPMCINF_info(); + public ODBPMCINF_info info14 = new ODBPMCINF_info(); + public ODBPMCINF_info info15 = new ODBPMCINF_info(); + public ODBPMCINF_info info16 = new ODBPMCINF_info(); + public ODBPMCINF_info info17 = new ODBPMCINF_info(); + public ODBPMCINF_info info18 = new ODBPMCINF_info(); + public ODBPMCINF_info info19 = new ODBPMCINF_info(); + public ODBPMCINF_info info20 = new ODBPMCINF_info(); + public ODBPMCINF_info info21 = new ODBPMCINF_info(); + public ODBPMCINF_info info22 = new ODBPMCINF_info(); + public ODBPMCINF_info info23 = new ODBPMCINF_info(); + public ODBPMCINF_info info24 = new ODBPMCINF_info(); + public ODBPMCINF_info info25 = new ODBPMCINF_info(); + public ODBPMCINF_info info26 = new ODBPMCINF_info(); + public ODBPMCINF_info info27 = new ODBPMCINF_info(); + public ODBPMCINF_info info28 = new ODBPMCINF_info(); + public ODBPMCINF_info info29 = new ODBPMCINF_info(); + public ODBPMCINF_info info30 = new ODBPMCINF_info(); + public ODBPMCINF_info info31 = new ODBPMCINF_info(); + public ODBPMCINF_info info32 = new ODBPMCINF_info(); + public ODBPMCINF_info info33 = new ODBPMCINF_info(); + public ODBPMCINF_info info34 = new ODBPMCINF_info(); + public ODBPMCINF_info info35 = new ODBPMCINF_info(); + public ODBPMCINF_info info36 = new ODBPMCINF_info(); + public ODBPMCINF_info info37 = new ODBPMCINF_info(); + public ODBPMCINF_info info38 = new ODBPMCINF_info(); + public ODBPMCINF_info info39 = new ODBPMCINF_info(); + public ODBPMCINF_info info40 = new ODBPMCINF_info(); + public ODBPMCINF_info info41 = new ODBPMCINF_info(); + public ODBPMCINF_info info42 = new ODBPMCINF_info(); + public ODBPMCINF_info info43 = new ODBPMCINF_info(); + public ODBPMCINF_info info44 = new ODBPMCINF_info(); + public ODBPMCINF_info info45 = new ODBPMCINF_info(); + public ODBPMCINF_info info46 = new ODBPMCINF_info(); + public ODBPMCINF_info info47 = new ODBPMCINF_info(); + public ODBPMCINF_info info48 = new ODBPMCINF_info(); + public ODBPMCINF_info info49 = new ODBPMCINF_info(); + public ODBPMCINF_info info50 = new ODBPMCINF_info(); + public ODBPMCINF_info info51 = new ODBPMCINF_info(); + public ODBPMCINF_info info52 = new ODBPMCINF_info(); + public ODBPMCINF_info info53 = new ODBPMCINF_info(); + public ODBPMCINF_info info54 = new ODBPMCINF_info(); + public ODBPMCINF_info info55 = new ODBPMCINF_info(); + public ODBPMCINF_info info56 = new ODBPMCINF_info(); + public ODBPMCINF_info info57 = new ODBPMCINF_info(); + public ODBPMCINF_info info58 = new ODBPMCINF_info(); + public ODBPMCINF_info info59 = new ODBPMCINF_info(); + public ODBPMCINF_info info60 = new ODBPMCINF_info(); + public ODBPMCINF_info info61 = new ODBPMCINF_info(); + public ODBPMCINF_info info62 = new ODBPMCINF_info(); + public ODBPMCINF_info info63 = new ODBPMCINF_info(); + public ODBPMCINF_info info64 = new ODBPMCINF_info(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCINF + { + public short datano; + public ODBPMCINF1 info = new ODBPMCINF1(); + } + + /* pmc_rdcntldata:read PMC parameter data table control data */ + /* pmc_wrcntldata:write PMC parameter data table control data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMCCNTL_info + { + public byte tbl_prm; + public byte data_type; + public ushort data_size; + public ushort data_dsp; + public short dummy; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMCCNTL1 + { + public IODBPMCCNTL_info info1 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info2 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info3 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info4 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info5 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info6 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info7 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info8 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info9 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info10 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info11 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info12 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info13 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info14 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info15 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info16 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info17 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info18 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info19 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info20 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info21 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info22 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info23 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info24 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info25 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info26 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info27 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info28 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info29 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info30 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info31 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info32 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info33 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info34 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info35 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info36 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info37 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info38 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info39 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info40 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info41 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info42 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info43 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info44 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info45 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info46 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info47 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info48 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info49 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info50 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info51 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info52 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info53 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info54 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info55 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info56 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info57 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info58 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info59 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info60 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info61 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info62 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info63 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info64 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info65 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info66 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info67 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info68 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info69 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info70 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info71 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info72 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info73 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info74 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info75 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info76 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info77 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info78 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info79 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info80 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info81 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info82 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info83 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info84 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info85 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info86 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info87 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info88 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info89 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info90 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info91 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info92 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info93 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info94 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info95 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info96 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info97 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info98 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info99 = new IODBPMCCNTL_info(); + public IODBPMCCNTL_info info100 = new IODBPMCCNTL_info(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMCCNTL + { + public short datano_s; + public short dummy; + public short datano_e; + public IODBPMCCNTL1 info = new IODBPMCCNTL1(); + } + + /* pmc_rdalmmsg:read PMC alarm message */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPMCALM_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string almmsg = new string(' ', 128); /* alarm message */ + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCALM + { + public ODBPMCALM_data msg1 = new ODBPMCALM_data(); + public ODBPMCALM_data msg2 = new ODBPMCALM_data(); + public ODBPMCALM_data msg3 = new ODBPMCALM_data(); + public ODBPMCALM_data msg4 = new ODBPMCALM_data(); + public ODBPMCALM_data msg5 = new ODBPMCALM_data(); + public ODBPMCALM_data msg6 = new ODBPMCALM_data(); + public ODBPMCALM_data msg7 = new ODBPMCALM_data(); + public ODBPMCALM_data msg8 = new ODBPMCALM_data(); + public ODBPMCALM_data msg9 = new ODBPMCALM_data(); + public ODBPMCALM_data msg10 = new ODBPMCALM_data(); + } /* In case that the number of data is 10 */ + + /* pmc_getdtailerr:get detail error for pmc */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCERR + { + public short err_no; + public short err_dtno; + } + + /* pmc_rdpmctitle:read pmc title data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPMCTITLE + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string mtb = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string machine = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string type = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string prgno = new string(' ', 8); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + public string prgvers = new string(' ', 4); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string prgdraw = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string date = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string design = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string written = new string(' ', 48); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] + public string remarks = new string(' ', 48); + } + + /* pmc_rdpmcrng_ext:read PMC data */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPMCEXT + { + public short type_a; /* PMC address type */ + public short type_d; /* PMC data type */ + public short datano_s; /* start PMC address */ + public short datano_e; /* end PMC address */ + public short err_code; /* error code */ + public short reserved; /* reserved */ + [MarshalAs(UnmanagedType.AsAny)] + public object data; /* pointer to buffer */ + } + + /* pmc_rdpmcaddr:read PMC address information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCADR_info + { + public byte pmc_adr; + public byte adr_attr; + public ushort offset; + public ushort top; + public ushort num; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCADR1 + { + public ODBPMCADR_info info1 = new ODBPMCADR_info(); + public ODBPMCADR_info info2 = new ODBPMCADR_info(); + public ODBPMCADR_info info3 = new ODBPMCADR_info(); + public ODBPMCADR_info info4 = new ODBPMCADR_info(); + public ODBPMCADR_info info5 = new ODBPMCADR_info(); + public ODBPMCADR_info info6 = new ODBPMCADR_info(); + public ODBPMCADR_info info7 = new ODBPMCADR_info(); + public ODBPMCADR_info info8 = new ODBPMCADR_info(); + public ODBPMCADR_info info9 = new ODBPMCADR_info(); + public ODBPMCADR_info info10 = new ODBPMCADR_info(); + public ODBPMCADR_info info11 = new ODBPMCADR_info(); + public ODBPMCADR_info info12 = new ODBPMCADR_info(); + public ODBPMCADR_info info13 = new ODBPMCADR_info(); + public ODBPMCADR_info info14 = new ODBPMCADR_info(); + public ODBPMCADR_info info15 = new ODBPMCADR_info(); + public ODBPMCADR_info info16 = new ODBPMCADR_info(); + public ODBPMCADR_info info17 = new ODBPMCADR_info(); + public ODBPMCADR_info info18 = new ODBPMCADR_info(); + public ODBPMCADR_info info19 = new ODBPMCADR_info(); + public ODBPMCADR_info info20 = new ODBPMCADR_info(); + public ODBPMCADR_info info21 = new ODBPMCADR_info(); + public ODBPMCADR_info info22 = new ODBPMCADR_info(); + public ODBPMCADR_info info23 = new ODBPMCADR_info(); + public ODBPMCADR_info info24 = new ODBPMCADR_info(); + public ODBPMCADR_info info25 = new ODBPMCADR_info(); + public ODBPMCADR_info info26 = new ODBPMCADR_info(); + public ODBPMCADR_info info27 = new ODBPMCADR_info(); + public ODBPMCADR_info info28 = new ODBPMCADR_info(); + public ODBPMCADR_info info29 = new ODBPMCADR_info(); + public ODBPMCADR_info info30 = new ODBPMCADR_info(); + public ODBPMCADR_info info31 = new ODBPMCADR_info(); + public ODBPMCADR_info info32 = new ODBPMCADR_info(); + public ODBPMCADR_info info33 = new ODBPMCADR_info(); + public ODBPMCADR_info info34 = new ODBPMCADR_info(); + public ODBPMCADR_info info35 = new ODBPMCADR_info(); + public ODBPMCADR_info info36 = new ODBPMCADR_info(); + public ODBPMCADR_info info37 = new ODBPMCADR_info(); + public ODBPMCADR_info info38 = new ODBPMCADR_info(); + public ODBPMCADR_info info39 = new ODBPMCADR_info(); + public ODBPMCADR_info info40 = new ODBPMCADR_info(); + public ODBPMCADR_info info41 = new ODBPMCADR_info(); + public ODBPMCADR_info info42 = new ODBPMCADR_info(); + public ODBPMCADR_info info43 = new ODBPMCADR_info(); + public ODBPMCADR_info info44 = new ODBPMCADR_info(); + public ODBPMCADR_info info45 = new ODBPMCADR_info(); + public ODBPMCADR_info info46 = new ODBPMCADR_info(); + public ODBPMCADR_info info47 = new ODBPMCADR_info(); + public ODBPMCADR_info info48 = new ODBPMCADR_info(); + public ODBPMCADR_info info49 = new ODBPMCADR_info(); + public ODBPMCADR_info info50 = new ODBPMCADR_info(); + public ODBPMCADR_info info51 = new ODBPMCADR_info(); + public ODBPMCADR_info info52 = new ODBPMCADR_info(); + public ODBPMCADR_info info53 = new ODBPMCADR_info(); + public ODBPMCADR_info info54 = new ODBPMCADR_info(); + public ODBPMCADR_info info55 = new ODBPMCADR_info(); + public ODBPMCADR_info info56 = new ODBPMCADR_info(); + public ODBPMCADR_info info57 = new ODBPMCADR_info(); + public ODBPMCADR_info info58 = new ODBPMCADR_info(); + public ODBPMCADR_info info59 = new ODBPMCADR_info(); + public ODBPMCADR_info info60 = new ODBPMCADR_info(); + public ODBPMCADR_info info61 = new ODBPMCADR_info(); + public ODBPMCADR_info info62 = new ODBPMCADR_info(); + public ODBPMCADR_info info63 = new ODBPMCADR_info(); + public ODBPMCADR_info info64 = new ODBPMCADR_info(); + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBPMCADR + { + public uint io_adr; + public short datano; + public ODBPMCADR1 info = new ODBPMCADR1(); + } + + + /*--------------------------*/ + /* PROFIBUS function */ + /*--------------------------*/ + + /* pmc_prfrdconfig:read PROFIBUS configration data */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBPRFCNF + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string master_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 3)] + public string master_ver = new string(' ', 3); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string slave_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 3)] + public string slave_ver = new string(' ', 3); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] + public string cntl_ser = new string(' ', 5); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 3)] + public string cntl_ver = new string(' ', 3); + } + + /* pmc_prfrdbusprm:read bus parameter for master function */ + /* pmc_prfwrbusprm:write bus parameter for master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBBUSPRM + { + public sbyte fdl_add; + public sbyte baudrate; + public ushort tsl; + public ushort min_tsdr; + public ushort max_tsdr; + public byte tqui; + public byte tset; + public int ttr; + public sbyte gap; + public sbyte hsa; + public sbyte max_retry; + public byte bp_flag; + public ushort min_slv_int; + public ushort poll_tout; + public ushort data_cntl; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public byte[] reserve1 = new byte[6]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] cls2_name = new byte[32]; + public short user_dlen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 62)] + public byte[] user_data = new byte[62]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 96)] + public byte[] reserve2 = new byte[96]; + } + + /* pmc_prfrdslvprm:read slave parameter for master function */ + /* pmc_prfwrslvprm:write slave parameter for master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLVPRM + { + public short dis_enb; + public ushort ident_no; + public byte slv_flag; + public byte slv_type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] + public byte[] reserve1 = new byte[12]; + public byte slv_stat; + public byte wd_fact1; + public byte wd_fact2; + public byte min_tsdr; + public char reserve2; + public byte grp_ident; + public short user_plen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] user_pdata = new byte[32]; + public short cnfg_dlen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 126)] + public byte[] cnfg_data = new byte[126]; + public short slv_ulen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)] + public byte[] slv_udata = new byte[30]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] reserve3 = new byte[8]; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLVPRM2 + { + public short dis_enb; + public ushort ident_no; + public byte slv_flag; + public byte slv_type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] + public byte[] reserve1 = new byte[12]; + public byte slv_stat; + public byte wd_fact1; + public byte wd_fact2; + public byte min_tsdr; + public sbyte reserve2; + public byte grp_ident; + public short user_plen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 206)] + public byte[] user_pdata = new byte[206]; + public short cnfg_dlen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 126)] + public byte[] cnfg_data = new byte[126]; + public short slv_ulen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)] + public byte[] slv_udata = new byte[30]; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] reserve3 = new byte[8]; + } + + /* pmc_prfrdallcadr:read allocation address for master function */ + /* pmc_prfwrallcadr:set allocation address for master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBPRFADR + { + public byte di_size; + public byte di_type; + public ushort di_addr; + public short reserve1; + public byte do_size; + public byte do_type; + public ushort do_addr; + public short reserve2; + public byte dgn_size; + public byte dgn_type; + public ushort dgn_addr; + } + + /* pmc_prfrdslvaddr:read allocation address for slave function */ + /* pmc_prfwrslvaddr:set allocation address for slave function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLVADR + { + public byte slave_no; + public byte di_size; + public byte di_type; + public ushort di_addr; + public byte do_size; + public byte do_type; + public ushort do_addr; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public byte[] reserve = new byte[7]; + } + + /* pmc_prfrdslvstat:read status for slave function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBSLVST + { + public byte cnfg_stat; + public byte prm_stat; + public sbyte wdg_stat; + public byte live_stat; + public short ident_no; + } + + /* pmc_prfrdslvid:Reads slave index data of master function */ + /* pmc_prfwrslvid:Writes slave index data of master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLVID + { + public short dis_enb; + public short slave_no; + public short nsl; + public byte dgn_size; + public char dgn_type; + public ushort dgn_addr; + } + + /* pmc_prfrdslvprm2:Reads slave parameter of master function(2) */ + /* pmc_prfwrslvprm2:Writes slave parameter of master function(2) */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBSLVPRM3 + { + public ushort ident_no; + public byte slv_flag; + public byte slv_type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] + public char[] reserve1 = new char[12]; + public byte slv_stat; + public byte wd_fact1; + public byte wd_fact2; + public byte min_tsdr; + public char reserve2; + public byte grp_ident; + public short user_plen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 206)] + public char[] user_pdata = new char[206]; + public short slv_ulen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)] + public char[] slv_udata = new char[30]; + } + + /* pmc_prfrddido:Reads DI/DO parameter of master function */ + /* pmc_prfwrdido:Writes DI/DO parameter of master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBDIDO + { + public short slave_no; + public short slot_no; + public byte di_size; + public char di_type; + public ushort di_addr; + public byte do_size; + public char do_type; + public ushort do_addr; + public short shift; + public byte module_dlen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] + public char[] module_data = new char[128]; + } + + /* pmc_prfrdindiadr:Reads indication address of master function */ + /* pmc_prfwrindiadr:Writes indication address of master function */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBINDEADR + { + public byte dummy; + public char indi_type; + public ushort indi_addr; + } + + /*-----------------------------------------------*/ + /* DS : Data server & Ethernet board function */ + /*-----------------------------------------------*/ + + /* etb_rdparam : read丂the parameter of the Ethernet board */ + /* etb_wrparam : write the parameter of the Ethernet board */ + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class TCPPRM + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string OwnIPAddress = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string SubNetMask = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string RouterIPAddress = new string(' ', 16); + } + + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class HOSTPRM + { + public short DataServerPort; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string DataServerIPAddress = new string(' ', 16); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string DataServerUserName = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string DataServerPassword = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string DataServerLoginDirectory = new string(' ', 128); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class FTPPRM + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string FTPServerUserName = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string FTPServerPassword = new string(' ', 32); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string FTPServerLoginDirectory = new string(' ', 128); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ETBPRM + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 13)] + public string OwnMACAddress = new string(' ', 128); + public short MaximumChannel; + public short HDDExistence; + public short NumberOfScreens; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBETP + { + public short Dummy_ParameterType; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 210)] + public byte[] prm = new byte[210]; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBETP_TCP + { + public short ParameterType; + public TCPPRM tcp; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBETP_HOST + { + public short ParameterType; + public HOSTPRM host; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBETP_FTP + { + public short ParameterType; + public FTPPRM ftp; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class IODBETP_ETB + { + public short ParameterType; + public ETBPRM etb; + } + + /* etb_rderrmsg : read the error message of the Ethernet board */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBETMSG + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)] + public string title = new string(' ', 33); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 390)] + public string message = new string(' ', 390); + } + + /* ds_rdhddinfo : read information of the Data Server's HDD */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHDDINF + { + public int file_num; + public int remainder_l; + public int remainder_h; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public char[] current_dir = new char[32]; + } + + /* ds_rdhdddir : read the file list of the Data Server's HDD */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHDDDIR_data + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string file_name = new string(' ', 64); + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] + public string comment = new string(' ', 80); + public short attribute; + public short reserved; + public int size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string date = new string(' ', 16); + } + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHDDDIR + { + public ODBHDDDIR_data data1 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data2 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data3 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data4 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data5 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data6 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data7 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data8 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data9 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data10 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data11 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data12 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data13 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data14 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data15 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data16 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data17 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data18 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data19 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data20 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data21 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data22 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data23 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data24 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data25 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data26 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data27 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data28 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data29 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data30 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data31 = new ODBHDDDIR_data(); + public ODBHDDDIR_data data32 = new ODBHDDDIR_data(); + } + + /* ds_rdhostdir : read the file list of the host */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHOSTDIR_data + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] + public char[] host_file = new char[128]; + } + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class ODBHOSTDIR + { + public ODBHOSTDIR_data data1 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data2 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data3 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data4 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data5 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data6 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data7 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data8 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data9 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data10 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data11 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data12 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data13 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data14 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data15 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data16 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data17 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data18 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data19 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data20 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data21 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data22 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data23 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data24 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data25 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data26 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data27 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data28 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data29 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data30 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data31 = new ODBHOSTDIR_data(); + public ODBHOSTDIR_data data32 = new ODBHOSTDIR_data(); + } + + /* ds_rdmntinfo : read maintenance information */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public class DSMNTINFO + { + public ushort empty_cnt; + public uint total_size; + public ushort ReadPtr; + public ushort WritePtr; + }; + + /*--------------------------*/ + /* HSSB multiple connection */ + /*--------------------------*/ + + /* cnc_rdnodeinfo:read node informations */ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)] + public class ODBNODE + { + public int node_no; + public int io_base; + public int status; + public int cnc_type; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] + public string node_name = new string(' ', 20); + } + + + /*-------------------------------------*/ + /* CNC: Control axis / spindle related */ + //CNC:控制轴/主轴相关 + /*-------------------------------------*/ + + /* read actual axis feedrate(F) */ + /// + /// 读取实际轴进给速度(F) + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_actf")] + public static extern short cnc_actf(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBACT a); + + /* read absolute axis position */ + /// + /// 读取绝对轴位置 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_absolute")] + public static extern short cnc_absolute(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read machine axis position */ + /// + /// 读取机器轴位置 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_machine")] + public static extern short cnc_machine(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read relative axis position */ + /// + /// 读取相对轴位置 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_relative")] + public static extern short cnc_relative(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read distance to go */ + /// + /// 读取要走的距离 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_distance")] + public static extern short cnc_distance(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read skip position */ + /// + /// 读取跳过位置 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_skip")] + public static extern short cnc_skip(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read servo delay value */ + /// + /// 读取伺服延迟值 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srvdelay")] + public static extern short cnc_srvdelay(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read acceleration/deceleration delay value */ + /// + /// 读取加速/减速延迟值 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_accdecdly")] + public static extern short cnc_accdecdly(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read all dynamic data */ + /// + /// 读取所有动态数据 + /// + /// + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddynamic")] + public static extern short cnc_rddynamic(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDY_1 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddynamic")] + public static extern short cnc_rddynamic(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDY_2 c); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_rddynamico8")] + public static extern short cnc_rddynamic(ushort FlibHndl, + short a, short b, [Out,MarshalAs(UnmanagedType.LPStruct)] ODBDY_1 c); + [DllImport("FWLIB32.dll", EntryPoint="cnc_rddynamico8")] + public static extern short cnc_rddynamic(ushort FlibHndl, + short a, short b, [Out,MarshalAs(UnmanagedType.LPStruct)] ODBDY_2 c); +#endif + + /* read all dynamic data */ + /// + /// 读取所有动态数据 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddynamic2")] + public static extern short cnc_rddynamic2(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDY2_1 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddynamic2")] + public static extern short cnc_rddynamic2(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDY2_2 c); + + /* read actual spindle speed(S) */ + /// + /// 读取实际主轴转速 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_acts")] + public static extern short cnc_acts(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBACT a); + + /* read actual spindle speed(S) (All or spesified) */ + /// + /// 读取实际主轴转速(全部或指定) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_acts2")] + public static extern short cnc_acts2(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBACT2 b); + + /* set origin / preset relative axis position */ + /// + /// 设置原点/预设相对轴位置 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrrelpos")] + public static extern short cnc_wrrelpos(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBWRR b); + + /* preset work coordinate */ + /// + /// 预置工作坐标 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_prstwkcd")] + public static extern short cnc_prstwkcd(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBWRA b); + + /* read manual overlapped motion value */ + /// + /// 读取手动重叠运动值 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmovrlap")] + public static extern short cnc_rdmovrlap(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBOVL c); + + /* cancel manual overlapped motion value */ + /// + /// 取消手动重叠运动值 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_canmovrlap")] + public static extern short cnc_canmovrlap(ushort FlibHndl, short a); + + /* read load information of serial spindle */ + /// + /// 读取串行主轴的负载信息 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspload")] + public static extern short cnc_rdspload(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPN b); + + /* read maximum r.p.m. ratio of serial spindle */ + /// + /// 读取串行主轴的最大r.p.m.比 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspmaxrpm")] + public static extern short cnc_rdspmaxrpm(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPN b); + + /* read gear ratio of serial spindle */ + /// + /// 读取串行主轴的传动比 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspgear")] + public static extern short cnc_rdspgear(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPN b); + + /* read absolute axis position 2 */ + /// + /// 读取绝对轴位置2 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_absolute2")] + public static extern short cnc_absolute2(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read relative axis position 2 */ + /// + /// 读取相对轴位置2 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_relative2")] + public static extern short cnc_relative2(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* set wire vertival position */ + /// + /// 设置导线垂直位置 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setvrtclpos")] + public static extern short cnc_setvrtclpos(ushort FlibHndl, short a); + + /* set wire threading position */ + /// + /// 设置穿线位置 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setthrdngpos")] + public static extern short cnc_setthrdngpos(ushort FlibHndl); + + /* read tool position */ + /// + /// 读取刀具位置 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdposition")] + public static extern short cnc_rdposition(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPOS c); + + /* read current speed */ + /// + /// 读取当前速度 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspeed")] + public static extern short cnc_rdspeed(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPEED b); + + /* read servo load meter */ + /// + /// 读取伺服负载表 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsvmeter")] + public static extern short cnc_rdsvmeter(ushort FlibHndl, + ref short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSVLOAD b); + + /* read spindle load meter */ + /// + /// 读取主轴负荷表 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspmeter")] + public static extern short cnc_rdspmeter(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPLOAD c); + + /* read manual feed for 5-axis machining */ + /// + /// 读取5轴加工的手动进给 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd5axmandt")] + public static extern short cnc_rd5axmandt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB5AXMAN a); + + /* read amount of machine axes movement of manual feed for 5-axis machining */ + /// + /// 读取5轴加工手动进给的机床轴移动量 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd5axovrlap")] + public static extern short cnc_rd5axovrlap(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read handle interruption */ + /// + /// 读取句柄中断 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhndintrpt")] + public static extern short cnc_rdhndintrpt(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHND c); + + /* clear pulse values of manual feed for 5-axis machining */ + /// + /// 五轴加工的手动进给的清除脉冲值 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clr5axpls")] + public static extern short cnc_clr5axpls(ushort FlibHndl, short a); + + /* read constant surface speed */ + /// + /// 读取恒定表面速度 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspcss")] + public static extern short cnc_rdspcss(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBCSS a); + + /* read execution program pointer */ + /// + /// 读取执行程序指针 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdexecpt")] + public static extern short cnc_rdexecpt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGPNT a, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGPNT b); + + /* read various axis data */ + /// + /// 读取各种轴数据 + /// + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdaxisdata")] + public static extern short cnc_rdaxisdata(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, short c, ref short d, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXDT e); + + /*----------------------*/ + /* CNC: Program related */ + //CNC:程序相关 + /*----------------------*/ + + /* start downloading NC program */ + /// + /// 开始下载NC程序 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnstart")] + public static extern short cnc_dwnstart(ushort FlibHndl); + + /* download NC program */ + /// + /// 数控程序下载 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_download")] + public static extern short cnc_download(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b); + + /* download NC program(conditional) */ + /// + /// 下载NC程序(有条件) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cdownload")] + public static extern short cnc_cdownload(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b); + + /* end of downloading NC program */ + /// + /// 数控程序下载结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnend")] + public static extern short cnc_dwnend(ushort FlibHndl); + + /* end of downloading NC program 2 */ + /// + /// NC程序2下载结束 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnend2")] + public static extern short cnc_dwnend2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* start downloading NC program 3 */ + /// + /// 开始下载NC程序3 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnstart3")] + public static extern short cnc_dwnstart3(ushort FlibHndl, short a); + + /* start downloading NC program 3 special */ + /// + /// 开始下载NC程序3特殊 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnstart3_f")] + public static extern short cnc_dwnstart3_f(ushort FlibHndl, + short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, [In, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* download NC program 3 */ + /// + /// 下载NC程序3 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_download3")] + public static extern short cnc_download3(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of downloading NC program 3 */ + /// + /// NC程序3下载结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnend3")] + public static extern short cnc_dwnend3(ushort FlibHndl); + + /* start downloading NC program 4 */ + /// + /// 开始下载NC程序4 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnstart4")] + public static extern short cnc_dwnstart4(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* download NC program 4 */ + /// + /// 下载NC程序4 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_download4")] + public static extern short cnc_download4(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of downloading NC program 4 */ + /// + /// NC程序4下载结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dwnend4")] + public static extern short cnc_dwnend4(ushort FlibHndl); + + /* start verification of NC program */ + /// + /// 启动NC程序验证 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_vrfstart")] + public static extern short cnc_vrfstart(ushort FlibHndl); + + /* verify NC program */ + /// + /// 验证NC程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_verify")] + public static extern short cnc_verify(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b); + + /* verify NC program(conditional) */ + /// + /// 验证NC程序(有条件) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cverify")] + public static extern short cnc_cverify(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b); + + /* end of verification */ + /// + /// 验证结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_vrfend")] + public static extern short cnc_vrfend(ushort FlibHndl); + + /* start verification of NC program */ + /// + /// 启动NC程序验证 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_vrfstart4")] + public static extern short cnc_vrfstart4(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* verify NC program */ + /// + /// 验证NC程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_verify4")] + public static extern short cnc_verify4(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of verification */ + /// + /// 验证结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_vrfend4")] + public static extern short cnc_vrfend4(ushort FlibHndl); + + /* start downloading DNC program */ + /// + /// 开始下载DNC程序 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dncstart")] + public static extern short cnc_dncstart(ushort FlibHndl); + + /* download DNC program */ + /// + /// 下载DNC程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dnc")] + public static extern short cnc_dnc(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, ushort b); + + /* download DNC program(conditional) */ + /// + /// 下载DNC程序(有条件) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cdnc")] + public static extern short cnc_cdnc(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, ushort b); + + /* end of downloading DNC program */ + /// + /// DNC程序下载结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dncend")] + public static extern short cnc_dncend(ushort FlibHndl); + + /* start downloading DNC program 2 */ + /// + /// 开始下载DNC程序2 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dncstart2")] + public static extern short cnc_dncstart2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* download DNC program 2 */ + /// + /// 下载DNC程序2 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dnc2")] + public static extern short cnc_dnc2(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of downloading DNC program 2 */ + /// + /// 下载DNC程序2的nd + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dncend2")] + public static extern short cnc_dncend2(ushort FlibHndl, short a); + + /* read the diagnosis data of DNC operation */ + /// + /// 读取DNC操作的诊断数据 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddncdgndt")] + public static extern short cnc_rddncdgndt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDNCDGN a); + + /* start uploading NC program */ + /// + /// 开始上传NC程序 + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upstart")] + public static extern short cnc_upstart(ushort FlibHndl, short a); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_upstarto8")] + public static extern short cnc_upstart( ushort FlibHndl, int a ); +#endif + + /* upload NC program */ + /// + /// 上传NC程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upload")] + public static extern short cnc_upload(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBUP a, ref ushort b); + + /* upload NC program(conditional) */ + /// + /// 上传NC程序(有条件) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cupload")] + public static extern short cnc_cupload(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBUP a, ref ushort b); + + /* end of uploading NC program */ + /// + /// NC程序上传结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upend")] + public static extern short cnc_upend(ushort FlibHndl); + + /* start uploading NC program 3 */ + /// + /// 开始上传NC程序3 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upstart3")] + public static extern short cnc_upstart3(ushort FlibHndl, short a, int b, int c); + + /* start uploading NC program special 3 */ + /// + /// 开始上传NC程序特殊3 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upstart3_f")] + public static extern short cnc_upstart3_f(ushort FlibHndl, + short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, [In, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* upload NC program 3 */ + /// + /// 上传NC程序3 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upload3")] + public static extern short cnc_upload3(ushort FlibHndl, ref int a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of uploading NC program 3 */ + /// + /// NC程序3上传结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upend3")] + public static extern short cnc_upend3(ushort FlibHndl); + + /* start uploading NC program 4 */ + /// + /// 开始上传NC程序4 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upstart4")] + public static extern short cnc_upstart4(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* upload NC program 4 */ + /// + /// 上传NC程序4 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upload4")] + public static extern short cnc_upload4(ushort FlibHndl, ref int a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* end of uploading NC program 4 */ + /// + /// NC程序4上传结束 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_upend4")] + public static extern short cnc_upend4(ushort FlibHndl); + + /* read buffer status for downloading/verification NC program */ + /// + /// 读取下载/验证NC程序的缓冲区状态 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_buff")] + public static extern short cnc_buff(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBBUF a); + + /* search specified program */ + /// + /// 搜索指定程序 + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_search")] + public static extern short cnc_search(ushort FlibHndl, short a); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_searcho8")] + public static extern short cnc_search( ushort FlibHndl, int a ); +#endif + + /* search specified program */ + /// + /// 搜索指定程序 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_search2")] + public static extern short cnc_search2(ushort FlibHndl, int a); + + /* delete all programs */ + /// + /// 删除所有程序 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_delall")] + public static extern short cnc_delall(ushort FlibHndl); + + /* delete specified program */ + /// + /// 删除指定程序 + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_delete")] + public static extern short cnc_delete(ushort FlibHndl, short a); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_deleteo8")] + public static extern short cnc_delete( ushort FlibHndl, int a ); +#endif + + /* delete program (area specified) */ + /// + /// 删除程序(指定区域) + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_delrange")] + public static extern short cnc_delrange(ushort FlibHndl, int a, int b); + + /* read program directory */ + /// + /// 读取程序目录 + /// + /// + /// + /// + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogdir")] + public static extern short cnc_rdprogdir(ushort FlibHndl, + short a, short b, short c, ushort d, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGDIR e); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_rdprogdiro8")] + public static extern short cnc_rdprogdir( ushort FlibHndl, + short a, short b, short c, ushort d, [Out,MarshalAs(UnmanagedType.LPStruct)] PRGDIR e ); +#endif + + /* read program information */ + /// + /// 读取程序信息 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdproginfo")] + public static extern short cnc_rdproginfo(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBNC_1 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdproginfo")] + public static extern short cnc_rdproginfo(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBNC_2 c); + + /* read program number under execution */ + /// + /// 读取正在执行的程序号 + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprgnum")] + public static extern short cnc_rdprgnum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPRO a); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_rdprgnumo8")] + public static extern short cnc_rdprgnum( ushort FlibHndl, [Out,MarshalAs(UnmanagedType.LPStruct)] ODBPRO a ); +#endif + + /* read program name under execution */ + /// + /// 读取正在执行的程序名 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_exeprgname")] + public static extern short cnc_exeprgname(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBEXEPRG a); + + /* read sequence number under execution */ + /// + /// 读取正在执行的序列号 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdseqnum")] + public static extern short cnc_rdseqnum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSEQ a); + + /* search specified sequence number */ + /// + /// 搜索指定序列号 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_seqsrch")] + public static extern short cnc_seqsrch(ushort FlibHndl, int a); + + /* search specified sequence number (2) */ + /// + /// 搜索指定序列号(2) + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_seqsrch2")] + public static extern short cnc_seqsrch2(ushort FlibHndl, int a); + + /* rewind cursor of NC program */ + /// + /// 数控程序倒带光标 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rewind")] + public static extern short cnc_rewind(ushort FlibHndl); + + /* read block counter */ + /// + /// 读块计数器 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdblkcount")] + public static extern short cnc_rdblkcount(ushort FlibHndl, out int a); + + /* read program under execution */ + /// + /// 读取正在执行的程序 + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdexecprog")] + public static extern short cnc_rdexecprog(ushort FlibHndl, ref ushort a, out short b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* read program for MDI operation */ + /// + /// MDI操作的读取程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmdiprog")] + public static extern short cnc_rdmdiprog(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write program for MDI operation */ + /// + /// MDI操作的写入程序 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmdiprog")] + public static extern short cnc_wrmdiprog(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read execution pointer for MDI operation */ + /// + /// MDI操作的读取执行指针 + /// + /// + /// + /// +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmdipntr")] + public static extern short cnc_rdmdipntr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDIP a); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_rdmdipntro8")] + public static extern short cnc_rdmdipntr( ushort FlibHndl, [Out,MarshalAs(UnmanagedType.LPStruct)] ODBMDIP a ); +#endif + + /* write execution pointer for MDI operation */ + /// + /// MDI操作的写入执行指针 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmdipntr")] + public static extern short cnc_wrmdipntr(ushort FlibHndl, int a); + + /* register new program */ + /// + /// 注册新程序 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_newprog")] + public static extern short cnc_newprog(ushort FlibHndl, int a); + + /* copy program */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_copyprog")] + public static extern short cnc_copyprog(ushort FlibHndl, int a, int b); + + /* rename program */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_renameprog")] + public static extern short cnc_renameprog(ushort FlibHndl, int a, int b); + + /* condense program */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_condense")] + public static extern short cnc_condense(ushort FlibHndl, short a, int b); + + /* merge program */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_mergeprog")] + public static extern short cnc_mergeprog(ushort FlibHndl, short a, int b, uint c, int d); + + /* read current program and its pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdactpt")] + public static extern short cnc_rdactpt(ushort FlibHndl, out int a, out int b); + + /* read current program and its pointer and UV macro pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rduvactpt")] + public static extern short cnc_rduvactpt(ushort FlibHndl, out int a, out int b, out int c); + + /* set current program and its pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wractpt")] + public static extern short cnc_wractpt(ushort FlibHndl, int a, short b, ref int c); + + /* line edit (read program) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogline")] + public static extern short cnc_rdprogline(ushort FlibHndl, + int a, uint b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c, ref uint d, ref uint e); + + /* line edit (read program) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogline2")] + public static extern short cnc_rdprogline2(ushort FlibHndl, + int a, uint b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c, ref uint d, ref uint e); + + /* line edit (write program) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrprogline")] + public static extern short cnc_wrprogline(ushort FlibHndl, int a, uint b, [In, MarshalAs(UnmanagedType.AsAny)] Object c, uint d); + + /* line edit (delete line in program) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_delprogline")] + public static extern short cnc_delprogline(ushort FlibHndl, int a, uint b, uint c); + + /* line edit (search string) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_searchword")] + public static extern short cnc_searchword(ushort FlibHndl, + int a, uint b, short c, short d, uint e, [In, MarshalAs(UnmanagedType.AsAny)] Object f); + + /* line edit (search string) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_searchresult")] + public static extern short cnc_searchresult(ushort FlibHndl, out uint a); + + /* line edit (read program by file name) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_line")] + public static extern short cnc_rdpdf_line(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, uint b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c, ref uint d, ref uint e); + + /* program lock */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setpglock")] + public static extern short cnc_setpglock(ushort FlibHndl, int a); + + /* program unlock */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_resetpglock")] + public static extern short cnc_resetpglock(ushort FlibHndl, int a); + + /* read the status of the program lock */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpglockstat")] + public static extern short cnc_rdpglockstat(ushort FlibHndl, out int a, out int b); + + /* create file or directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_add")] + public static extern short cnc_pdf_add(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* condense program file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_cond")] + public static extern short cnc_pdf_cond(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* change attribute of program file and directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpdf_attr")] + public static extern short cnc_wrpdf_attr(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [Out, MarshalAs(UnmanagedType.LPStruct)] IDBPDFTDIR b); + + /* copy program file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_copy")] + public static extern short cnc_pdf_copy(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* delete file or directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_del")] + public static extern short cnc_pdf_del(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* line edit (write program by file name) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpdf_line")] + public static extern short cnc_wrpdf_line(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, uint b, [In, MarshalAs(UnmanagedType.AsAny)] Object c, uint d); + + /* line edit (delete line by file name) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_delline")] + public static extern short cnc_pdf_delline(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, uint b, uint c); + + /* move program file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_move")] + public static extern short cnc_pdf_move(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read current program and its pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_rdactpt")] + public static extern short cnc_pdf_rdactpt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a, out int b); + + /* read selected file name */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_rdmain")] + public static extern short cnc_pdf_rdmain(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* rename file or directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_rename")] + public static extern short cnc_pdf_rename(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* line edit (search string) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_searchword")] + public static extern short cnc_pdf_searchword(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, uint b, uint c, uint d, uint e, [In, MarshalAs(UnmanagedType.AsAny)] Object f); + + /* line edit (search string) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_searchresult")] + public static extern short cnc_pdf_searchresult(ushort FlibHndl, out uint a); + + /* select program file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_slctmain")] + public static extern short cnc_pdf_slctmain(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* set current program and its pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_pdf_wractpt")] + public static extern short cnc_pdf_wractpt(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b, ref int c); + + /* read program drive information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_inf")] + public static extern short cnc_rdpdf_inf(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* read program drive directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_drive")] + public static extern short cnc_rdpdf_drive(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read current directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_curdir")] + public static extern short cnc_rdpdf_curdir(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* set current directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpdf_curdir")] + public static extern short cnc_wrpdf_curdir(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read directory (sub directories) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_subdir")] + public static extern short cnc_rdpdf_subdir(ushort FlibHndl, + ref short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBPDFSDIR b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPDFSDIR c); + + /* read directory (all files) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_alldir")] + public static extern short cnc_rdpdf_alldir(ushort FlibHndl, ref short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* read file count in directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpdf_subdirn")] + public static extern short cnc_rdpdf_subdirn(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPDFNFIL b); + + /*---------------------------*/ + /* CNC: NC file data related */ + /*---------------------------*/ + + /* read tool offset value */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofs")] + public static extern short cnc_rdtofs(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTOFS d); + + /* write tool offset value */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofs")] + public static extern short cnc_wrtofs(ushort FlibHndl, short a, short b, short c, int d); + + /* read tool offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsr")] + public static extern short cnc_rdtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_1 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsr")] + public static extern short cnc_rdtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_2 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsr")] + public static extern short cnc_rdtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_3 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsr")] + public static extern short cnc_rdtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTO_2 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsr")] + public static extern short cnc_rdtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTO_3 e); + + /* write tool offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofsr")] + public static extern short cnc_wrtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_1 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofsr")] + public static extern short cnc_wrtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_2 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofsr")] + public static extern short cnc_wrtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTO_1_3 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofsr")] + public static extern short cnc_wrtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTO_2 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtofsr")] + public static extern short cnc_wrtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTO_3 b); + + /* read work zero offset value */ + /// + /// 读取工作零点偏移值 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdzofs")] + public static extern short cnc_rdzofs(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBZOFS d); + + /* write work zero offset value */ + /// + /// 写入工作零点偏移值 + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrzofs")] + public static extern short cnc_wrzofs(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBZOFS b); + + /* read work zero offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdzofsr")] + public static extern short cnc_rdzofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBZOR e); + + /* write work zero offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrzofsr")] + public static extern short cnc_wrzofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBZOR b); + + /* read mesured point value */ + /// + /// 读取测量点值 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmsptype")] + public static extern short cnc_rdmsptype(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBMSTP d); + + /* write mesured point value */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmsptype")] + public static extern short cnc_wrmsptype(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBMSTP d); + + /* read parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam")] + public static extern short cnc_rdparam(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_1 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam")] + public static extern short cnc_rdparam(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_2 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam")] + public static extern short cnc_rdparam(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_3 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam")] + public static extern short cnc_rdparam(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_4 d); + + /* write parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrparam")] + public static extern short cnc_wrparam(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_1 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrparam")] + public static extern short cnc_wrparam(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_2 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrparam")] + public static extern short cnc_wrparam(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_3 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrparam")] + public static extern short cnc_wrparam(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_4 b); + + /* read parameter(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparar")] + public static extern short cnc_rdparar(ushort FlibHndl, + ref short a, short b, ref short c, ref short d, [Out, MarshalAs(UnmanagedType.AsAny)] Object e); + // [DllImport("FWLIB32.dll", EntryPoint="cnc_rdparar")] + // public static extern short cnc_rdparar( ushort FlibHndl, + // ref short a, short b, ref short c, ref short d, [Out,MarshalAs(UnmanagedType.LPStruct)] IODBPSD_A e ); + // [DllImport("FWLIB32.dll", EntryPoint="cnc_rdparar")] + // public static extern short cnc_rdparar( ushort FlibHndl, + // ref short a, short b, ref short c, ref short d, [Out,MarshalAs(UnmanagedType.LPStruct)] IODBPSD_B e ); + // [DllImport("FWLIB32.dll", EntryPoint="cnc_rdparar")] + // public static extern short cnc_rdparar( ushort FlibHndl, + // ref short a, short b, ref short c, ref short d, [Out,MarshalAs(UnmanagedType.LPStruct)] IODBPSD_C e ); + // [DllImport("FWLIB32.dll", EntryPoint="cnc_rdparar")] + // public static extern short cnc_rdparar( ushort FlibHndl, + // ref short a, short b, ref short c, ref short d, [Out,MarshalAs(UnmanagedType.LPStruct)] IODBPSD_D e ); + + /* write parameter(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrparas")] + public static extern short cnc_wrparas(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdset")] + public static extern short cnc_rdset(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_1 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdset")] + public static extern short cnc_rdset(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_2 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdset")] + public static extern short cnc_rdset(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_3 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdset")] + public static extern short cnc_rdset(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_4 d); + + /* write setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrset")] + public static extern short cnc_wrset(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_1 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrset")] + public static extern short cnc_wrset(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_2 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrset")] + public static extern short cnc_wrset(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_3 b); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrset")] + public static extern short cnc_wrset(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_4 b); + + /* read setting data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsetr")] + public static extern short cnc_rdsetr(ushort FlibHndl, + ref short a, short b, ref short c, ref short d, [Out, MarshalAs(UnmanagedType.AsAny)] Object e); + + /* write setting data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrsets")] + public static extern short cnc_wrsets(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read parameters */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam_ext")] + public static extern short cnc_rdparam_ext(ushort FlibHndl, + [In, Out, MarshalAs(UnmanagedType.LPStruct)] IODBPRMNO a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPRM c); + + /* read parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam3")] + public static extern short cnc_rdparam3(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_1 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam3")] + public static extern short cnc_rdparam3(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_2 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam3")] + public static extern short cnc_rdparam3(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_3 e); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparam3")] + public static extern short cnc_rdparam3(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSD_4 e); + + /* async parameter write start */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_start_async_wrparam")] + public static extern short cnc_start_async_wrparam(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPRM a); + + /* async parameter write end */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_end_async_wrparam")] + public static extern short cnc_end_async_wrparam(ushort FlibHndl, out short a); + + /* read cause of busy for async parameter write */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_async_busy_state")] + public static extern short cnc_async_busy_state(ushort FlibHndl, out short a); + + /* read diagnosis data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddiag_ext")] + public static extern short cnc_rddiag_ext(ushort FlibHndl, + [In, Out, MarshalAs(UnmanagedType.LPStruct)] IODBPRMNO a, short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPRM c); + + /* read pitch error compensation data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpitchr")] + public static extern short cnc_rdpitchr(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPI d); + + /* write pitch error compensation data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpitchr")] + public static extern short cnc_wrpitchr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPI b); + + /* read custom macro variable */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmacro")] + public static extern short cnc_rdmacro(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBM c); + + /* write custom macro variable */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmacro")] + public static extern short cnc_wrmacro(ushort FlibHndl, short a, short b, int c, short d); + + /* read custom macro variables(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmacror")] + public static extern short cnc_rdmacror(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBMR d); + + /* write custom macro variables(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmacror")] + public static extern short cnc_wrmacror(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBMR b); + + /* read custom macro variables(IEEE double version) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmacror2")] + public static extern short cnc_rdmacror2(ushort FlibHndl, int a, ref int b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* write custom macro variables(IEEE double version) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmacror2")] + public static extern short cnc_wrmacror2(ushort FlibHndl, int a, ref int b, [In, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* read P code macro variable */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpmacro")] + public static extern short cnc_rdpmacro(ushort FlibHndl, int a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPM b); + + /* write P code macro variable */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpmacro")] + public static extern short cnc_wrpmacro(ushort FlibHndl, int a, int b, short c); + + /* read P code macro variables(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpmacror")] + public static extern short cnc_rdpmacror(ushort FlibHndl, + int a, int b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPR d); + + /* write P code macro variables(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpmacror")] + public static extern short cnc_wrpmacror(ushort FlibHndl, ushort a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPR b); + + /* read P code macro variables(IEEE double version) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpmacror2")] + public static extern short cnc_rdpmacror2(ushort FlibHndl, uint a, ref uint b, ushort c, [Out, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* write P code macro variables(IEEE double version) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpmacror2")] + public static extern short cnc_wrpmacror2(ushort FlibHndl, uint a, ref uint b, ushort c, [In, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* read tool offset information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsinfo")] + public static extern short cnc_rdtofsinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLINF a); + + /* read tool offset information(2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtofsinfo2")] + public static extern short cnc_rdtofsinfo2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLINF2 a); + + /* read work zero offset information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdzofsinfo")] + public static extern short cnc_rdzofsinfo(ushort FlibHndl, out short a); + + /* read pitch error compensation data information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpitchinfo")] + public static extern short cnc_rdpitchinfo(ushort FlibHndl, out short a); + + /* read custom macro variable information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmacroinfo")] + public static extern short cnc_rdmacroinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMVINF a); + + /* read P code macro variable information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpmacroinfo")] + public static extern short cnc_rdpmacroinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMINF a); + + /* read validity of tool offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_tofs_rnge")] + public static extern short cnc_tofs_rnge(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDATRNG c); + + /* read validity of work zero offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_zofs_rnge")] + public static extern short cnc_zofs_rnge(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDATRNG c); + + /* read validity of work zero offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wksft_rnge")] + public static extern short cnc_wksft_rnge(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDATRNG b); + + /* read the information for function cnc_rdhsparam() */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhsprminfo")] + public static extern short cnc_rdhsprminfo(ushort FlibHndl, int a, [Out, MarshalAs(UnmanagedType.LPStruct)] HSPINFO_data b); + + /* read parameters at the high speed */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhsparam")] + public static extern short cnc_rdhsparam(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.LPStruct)] HSPINFO b, [Out, MarshalAs(UnmanagedType.LPStruct)] HSPDATA_1 c); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhsparam")] + public static extern short cnc_rdhsparam(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.LPStruct)] HSPINFO b, [Out, MarshalAs(UnmanagedType.LPStruct)] HSPDATA_2 c); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhsparam")] + public static extern short cnc_rdhsparam(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.LPStruct)] HSPINFO b, [Out, MarshalAs(UnmanagedType.LPStruct)] HSPDATA_3 c); + + /*----------------------------------------*/ + /* CNC: Tool life management data related */ + /*----------------------------------------*/ + + /* read tool life management data(tool group number) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpid")] + public static extern short cnc_rdgrpid(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE1 b); + + /* read tool life management data(number of tool groups) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdngrp")] + public static extern short cnc_rdngrp(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE2 a); + + /* read tool life management data(number of tools) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdntool")] + public static extern short cnc_rdntool(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE3 b); + + /* read tool life management data(tool life) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlife")] + public static extern short cnc_rdlife(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE3 b); + + /* read tool life management data(tool lift counter) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcount")] + public static extern short cnc_rdcount(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE3 b); + + /* read tool life management data(tool length number-1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd1length")] + public static extern short cnc_rd1length(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(tool length number-2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd2length")] + public static extern short cnc_rd2length(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(cutter compensation no.-1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd1radius")] + public static extern short cnc_rd1radius(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(cutter compensation no.-2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd2radius")] + public static extern short cnc_rd2radius(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(tool information-1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_t1info")] + public static extern short cnc_t1info(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(tool information-2) */ + /// + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_t2info")] + public static extern short cnc_t2info(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(tool number) */ + /// + /// 读取刀具寿命管理数据(刀具编号) + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_toolnum")] + public static extern short cnc_toolnum(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE4 c); + + /* read tool life management data(tool number, tool life, tool life counter)(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtoolrng")] + public static extern short cnc_rdtoolrng(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTR d); + + /* read tool life management data(all data within group) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtoolgrp")] + public static extern short cnc_rdtoolgrp(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTG c); + + /* write tool life management data(tool life counter) (area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrcountr")] + public static extern short cnc_wrcountr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBWRC b); + + /* read tool life management data(used tool group number) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdusegrpid")] + public static extern short cnc_rdusegrpid(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBUSEGR a); + + /* read tool life management data(max. number of tool groups) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmaxgrp")] + public static extern short cnc_rdmaxgrp(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLFNO a); + + /* read tool life management data(maximum number of tool within group) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmaxtool")] + public static extern short cnc_rdmaxtool(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLFNO a); + + /* read tool life management data(used tool no. within group) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdusetlno")] + public static extern short cnc_rdusetlno(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLUSE d); + + /* read tool life management data(tool data1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd1tlifedata")] + public static extern short cnc_rd1tlifedata(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTD c); + + /* read tool life management data(tool data2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd2tlifedata")] + public static extern short cnc_rd2tlifedata(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTD c); + + /* write tool life management data(tool data1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wr1tlifedata")] + public static extern short cnc_wr1tlifedata(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTD a); + + /* write tool life management data(tool data2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wr2tlifedata")] + public static extern short cnc_wr2tlifedata(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTD a); + + /* read tool life management data(tool group information) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpinfo")] + public static extern short cnc_rdgrpinfo(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTGI d); + + /* read tool life management data(tool group information 2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpinfo2")] + public static extern short cnc_rdgrpinfo2(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTGI2 d); + + /* read tool life management data(tool group information 3) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpinfo3")] + public static extern short cnc_rdgrpinfo3(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTGI3 d); + + /* read tool life management data(tool group information 4) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpinfo4")] + public static extern short cnc_rdgrpinfo4(ushort FlibHndl, + short a, short b, short c, out short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTGI4 e); + + /* write tool life management data(tool group information) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrgrpinfo")] + public static extern short cnc_wrgrpinfo(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTGI b); + + /* write tool life management data(tool group information 2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrgrpinfo2")] + public static extern short cnc_wrgrpinfo2(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTGI2 b); + + /* write tool life management data(tool group information 3) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrgrpinfo3")] + public static extern short cnc_wrgrpinfo3(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTGI3 b); + + /* delete tool life management data(tool group) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_deltlifegrp")] + public static extern short cnc_deltlifegrp(ushort FlibHndl, short a); + + /* insert tool life management data(tool data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_instlifedt")] + public static extern short cnc_instlifedt(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IDBITD a); + + /* delete tool life management data(tool data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_deltlifedt")] + public static extern short cnc_deltlifedt(ushort FlibHndl, short a, short b); + + /* clear tool life management data(tool life counter, tool information)(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clrcntinfo")] + public static extern short cnc_clrcntinfo(ushort FlibHndl, short a, short b); + + /* read tool life management data(tool group number) 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrpid2")] + public static extern short cnc_rdgrpid2(ushort FlibHndl, int a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLIFE5 b); + + /* read tool life management data(tool data1) 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd1tlifedat2")] + public static extern short cnc_rd1tlifedat2(ushort FlibHndl, + short a, int b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTD2 c); + + /* write tool life management data(tool data1) 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wr1tlifedat2")] + public static extern short cnc_wr1tlifedat2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTD2 a); + + /* read tool life management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtlinfo")] + public static extern short cnc_rdtlinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBTLINFO a); + + /* read tool life management data(used tool group number) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtlusegrp")] + public static extern short cnc_rdtlusegrp(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBUSEGRP a); + + /* read tool life management data(tool group information 2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtlgrp")] + public static extern short cnc_rdtlgrp(ushort FlibHndl, + int a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLGRP c); + + /* read tool life management data (tool data1) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtltool")] + public static extern short cnc_rdtltool(ushort FlibHndl, + int a, int b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLTOOL d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdexchgtgrp")] + public static extern short cnc_rdexchgtgrp(ushort FlibHndl, + ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBEXGP c); + + /*-----------------------------------*/ + /* CNC: Tool management data related */ + /*-----------------------------------*/ + + /* new registration of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_regtool")] + public static extern short cnc_regtool(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG c); + + /* new registration of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_regtool_f2")] + public static extern short cnc_regtool_f2(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG_F2 c); + + /* deletion of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_deltool")] + public static extern short cnc_deltool(ushort FlibHndl, short a, ref short b); + + /* lead of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtool")] + public static extern short cnc_rdtool(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG c); + + /* lead of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtool_f2")] + public static extern short cnc_rdtool_f2(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG_F2 c); + + /* write of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtool")] + public static extern short cnc_wrtool(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG b); + + /* write of individual data of tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtool2")] + public static extern short cnc_wrtool2(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBTLM b); + + /* write tool management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtool_f2")] + public static extern short cnc_wrtool_f2(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMNG_F2_data b); + + /* new registration of magazine management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_regmagazine")] + public static extern short cnc_regmagazine(ushort FlibHndl, ref short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMAG b); + + /* deletion of magazine management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_delmagazine")] + public static extern short cnc_delmagazine(ushort FlibHndl, ref short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLMAG2 b); + + /* lead of magazine management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmagazine")] + public static extern short cnc_rdmagazine(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLMAG b); + + /* Individual write of magazine management data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmagazine")] + public static extern short cnc_wrmagazine(ushort FlibHndl, short a, short b, short c); + + + /*-------------------------------------*/ + /* CNC: Operation history data related */ + /*-------------------------------------*/ + + /* stop logging operation history data */ + /// + /// 停止记录操作历史数据 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopophis")] + public static extern short cnc_stopophis(ushort FlibHndl); + + /* restart logging operation history data */ + /// + /// 重新启动记录操作历史数据 + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startophis")] + public static extern short cnc_startophis(ushort FlibHndl); + + /* read number of operation history data */ + /// + /// 读取操作历史数据数 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophisno")] + public static extern short cnc_rdophisno(ushort FlibHndl, out ushort a); + + /* read operation history data */ + /// + /// 读取操作历史数据 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry")] + public static extern short cnc_rdophistry(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHIS d); + + /* read operation history data */ + /// + /// 读取操作历史数据 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry2")] + public static extern short cnc_rdophistry2(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* read operation history data F30i*/ + /// + /// 读取操作历史数据 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_1 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_2 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_3 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_4 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_5 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_6 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_7 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_8 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_9 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_10 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdophistry4")] + public static extern short cnc_rdophistry4(ushort FlibHndl, + ushort a, ref ushort b, ref ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOPHIS4_11 d); + + /* read number of alarm history data */ + /// + /// 读取报警历史数据数 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhisno")] + public static extern short cnc_rdalmhisno(ushort FlibHndl, out ushort a); + + /* read alarm history data */ + /// + /// 读取报警历史数据 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhistry")] + public static extern short cnc_rdalmhistry(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAHIS d); + + /* read alarm history data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhistry_w")] + public static extern short cnc_rdalmhistry_w(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAHIS d); + + /* read alarm history data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhistry2")] + public static extern short cnc_rdalmhistry2(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAHIS2 d); + + /* read alarm history data F30i*/ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhistry3")] + public static extern short cnc_rdalmhistry3(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAHIS3 d); + + /* read alarm history data F30i*/ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmhistry5")] + public static extern short cnc_rdalmhistry5(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAHIS5 d); + + /* clear operation history data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clearophis")] + public static extern short cnc_clearophis(ushort FlibHndl, short a); + + /* read signals related operation history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhissgnl")] + public static extern short cnc_rdhissgnl(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSIG a); + + /* read signals related operation history 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhissgnl2")] + public static extern short cnc_rdhissgnl2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSIG2 a); + + /* read signals related operation history 3 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhissgnl3")] + public static extern short cnc_rdhissgnl3(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSIG3 a); + + /* write signals related operation history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhissgnl")] + public static extern short cnc_wrhissgnl(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSIG a); + + /* write signals related operation history 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhissgnl2")] + public static extern short cnc_wrhissgnl2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSIG2 a); + + /* write signals related operation history for F30i*/ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhissgnl3")] + public static extern short cnc_wrhissgnl3(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSIG3 a); + + /* read number of operater message history data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdomhisno")] + public static extern short cnc_rdomhisno(ushort FlibHndl, out ushort a); + + /*-------------*/ + /* CNC: Others */ + /*-------------*/ + + /* read CNC system information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sysinfo")] + public static extern short cnc_sysinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYS a); + + /* read CNC status information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_statinfo")] + public static extern short cnc_statinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBST a); + + /* read alarm status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_alarm")] + public static extern short cnc_alarm(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBALM a); + + /* read alarm status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_alarm2")] + public static extern short cnc_alarm2(ushort FlibHndl, out int a); + + /* read alarm information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalminfo")] + public static extern short cnc_rdalminfo(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ALMINFO_1 d); + + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalminfo")] + public static extern short cnc_rdalminfo(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ALMINFO_2 d); + + /* read alarm message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmmsg")] + public static extern short cnc_rdalmmsg(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBALMMSG c); + + /* read alarm message(2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdalmmsg2")] + public static extern short cnc_rdalmmsg2(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBALMMSG2 c); + + /* clear CNC alarm */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clralm")] + public static extern short cnc_clralm(ushort FlibHndl, short a); + + /* read modal data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_modal")] + public static extern short cnc_modal(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDL_1 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_modal")] + public static extern short cnc_modal(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDL_2 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_modal")] + public static extern short cnc_modal(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDL_3 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_modal")] + public static extern short cnc_modal(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDL_4 c); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_modal")] + public static extern short cnc_modal(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDL_5 c); + + /* read G code */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgcode")] + public static extern short cnc_rdgcode(ushort FlibHndl, + short a, short b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBGCD d); + + /* read command value */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcommand")] + public static extern short cnc_rdcommand(ushort FlibHndl, + short a, short b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBCMD d); + + /* read diagnosis data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_diagnoss")] + public static extern short cnc_diagnoss(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDGN_1 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_diagnoss")] + public static extern short cnc_diagnoss(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDGN_2 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_diagnoss")] + public static extern short cnc_diagnoss(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDGN_3 d); + [DllImport("FWLIB32.dll", EntryPoint = "cnc_diagnoss")] + public static extern short cnc_diagnoss(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDGN_4 d); + + /* read diagnosis data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_diagnosr")] + public static extern short cnc_diagnosr(ushort FlibHndl, + ref short a, short b, ref short c, ref short d, [Out, MarshalAs(UnmanagedType.AsAny)] Object e); + // [DllImport("FWLIB32.dll", EntryPoint="cnc_diagnosr")] + // public static extern short cnc_diagnosr( ushort FlibHndl, + // ref short a, short b, ref short c, ref short d, [Out,MarshalAs(UnmanagedType.LPStruct)] ODBDGN e ); + + /* read A/D conversion data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_adcnv")] + public static extern short cnc_adcnv(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAD c); + + /* read operator's message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopmsg")] + public static extern short cnc_rdopmsg(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] OPMSG c); + + /* read operator's message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopmsg2")] + public static extern short cnc_rdopmsg2(ushort FlibHndl, short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] OPMSG2 c); + + /* read operator's message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopmsg3")] + public static extern short cnc_rdopmsg3(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] OPMSG3 c); + + /* set path number(for 4 axes lathes, multi-path) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setpath")] + public static extern short cnc_setpath(ushort FlibHndl, short a); + + /* get path number(for 4 axes lathes, multi-path) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getpath")] + public static extern short cnc_getpath(ushort FlibHndl, out short a, out short b); + + /* allocate library handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allclibhndl")] + public static extern short cnc_allclibhndl(out ushort FlibHndl); + + /* free library handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_freelibhndl")] + public static extern short cnc_freelibhndl(ushort FlibHndl); + + /* get library option */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getlibopt")] + public static extern short cnc_getlibopt(ushort FlibHndl, int a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* set library option */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setlibopt")] + public static extern short cnc_setlibopt(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, int c); + + /* get custom macro type */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getmactype")] + public static extern short cnc_getmactype(ushort FlibHndl, out short a); + + /* set custom macro type */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setmactype")] + public static extern short cnc_setmactype(ushort FlibHndl, short a); + + /* get P code macro type */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getpmactype")] + public static extern short cnc_getpmactype(ushort FlibHndl, out short a); + + /* set P code macro type */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setpmactype")] + public static extern short cnc_setpmactype(ushort FlibHndl, short a); + + /* get screen status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getcrntscrn")] + public static extern short cnc_getcrntscrn(ushort FlibHndl, out short a); + + /* change screen mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_slctscrn")] + public static extern short cnc_slctscrn(ushort FlibHndl, short a); + + /* read CNC configuration information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sysconfig")] + public static extern short cnc_sysconfig(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSC a); + + /* read program restart information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprstrinfo")] + public static extern short cnc_rdprstrinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPRS a); + + /* search sequence number for program restart */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rstrseqsrch")] + public static extern short cnc_rstrseqsrch(ushort FlibHndl, int a, int b, short c, short d); + + /* search sequence number for program restart 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rstrseqsrch2")] + public static extern short cnc_rstrseqsrch2(ushort FlibHndl, int a, int b, short c, short d, int e); + + /* read output signal image of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopnlsgnl")] + public static extern short cnc_rdopnlsgnl(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSGNL b); + + /* write output signal of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wropnlsgnl")] + public static extern short cnc_wropnlsgnl(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSGNL a); + + /* read general signal image of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopnlgnrl")] + public static extern short cnc_rdopnlgnrl(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBGNRL b); + + /* write general signal image of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wropnlgnrl")] + public static extern short cnc_wropnlgnrl(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBGNRL a); + + /* read general signal name of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopnlgsname")] + public static extern short cnc_rdopnlgsname(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBRDNA b); + + /* write general signal name of software operator's panel */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wropnlgsname")] + public static extern short cnc_wropnlgsname(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBRDNA a); + + /* get detail error */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getdtailerr")] + public static extern short cnc_getdtailerr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBERR a); + + /* read informations of CNC parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparainfo")] + public static extern short cnc_rdparainfo(ushort FlibHndl, + short a, ushort b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPARAIF c); + + /* read informations of CNC setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsetinfo")] + public static extern short cnc_rdsetinfo(ushort FlibHndl, + short a, ushort b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSETIF c); + + /* read informations of CNC diagnose data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddiaginfo")] + public static extern short cnc_rddiaginfo(ushort FlibHndl, + short a, ushort b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDIAGIF c); + + /* read maximum, minimum and total number of CNC parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdparanum")] + public static extern short cnc_rdparanum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPARANUM a); + + /* read maximum, minimum and total number of CNC setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsetnum")] + public static extern short cnc_rdsetnum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSETNUM a); + + /* read maximum, minimum and total number of CNC diagnose data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddiagnum")] + public static extern short cnc_rddiagnum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDIAGNUM a); + + /* get maximum valid figures and number of decimal places */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getfigure")] + public static extern short cnc_getfigure(ushort FlibHndl, + short a, out short b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c, [Out, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* read F-ROM information on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdfrominfo")] + public static extern short cnc_rdfrominfo(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBFINFO b); + + /* start of reading F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromsvstart")] + public static extern short cnc_fromsvstart(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, int c); + + /* read F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromsave")] + public static extern short cnc_fromsave(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* end of reading F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromsvend")] + public static extern short cnc_fromsvend(ushort FlibHndl); + + /* start of writing F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromldstart")] + public static extern short cnc_fromldstart(ushort FlibHndl, short a, int b); + + /* write F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromload")] + public static extern short cnc_fromload(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, ref int b); + + /* end of writing F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromldend")] + public static extern short cnc_fromldend(ushort FlibHndl); + + /* delete F-ROM data on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromdelete")] + public static extern short cnc_fromdelete(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, int c); + + /* read S-RAM information on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsraminfo")] + public static extern short cnc_rdsraminfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSINFO a); + + /* start of reading S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srambkstart")] + public static extern short cnc_srambkstart(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, int b); + + /* read S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srambackup")] + public static extern short cnc_srambackup(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* end of reading S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srambkend")] + public static extern short cnc_srambkend(ushort FlibHndl); + + /* read F-ROM information on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getfrominfo")] + public static extern short cnc_getfrominfo(ushort FlibHndl, + short a, out short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBFINFORM c); + + /* start of reading F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromgetstart")] + public static extern short cnc_fromgetstart(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromget")] + public static extern short cnc_fromget(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* end of reading F-ROM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromgetend")] + public static extern short cnc_fromgetend(ushort FlibHndl); + + /* start of writing F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromputstart")] + public static extern short cnc_fromputstart(ushort FlibHndl, short a); + + /* write F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromput")] + public static extern short cnc_fromput(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, ref int b); + + /* end of writing F-ROM data to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromputend")] + public static extern short cnc_fromputend(ushort FlibHndl); + + /* delete F-ROM data on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_fromremove")] + public static extern short cnc_fromremove(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read S-RAM information on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getsraminfo")] + public static extern short cnc_getsraminfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSINFO a); + + /* start of reading S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramgetstart")] + public static extern short cnc_sramgetstart(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* start of reading S-RAM data from CNC (2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramgetstart2")] + public static extern short cnc_sramgetstart2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramget")] + public static extern short cnc_sramget(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* read S-RAM data from CNC (2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramget2")] + public static extern short cnc_sramget2(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* end of reading S-RAM data from CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramgetend")] + public static extern short cnc_sramgetend(ushort FlibHndl); + + /* end of reading S-RAM data from CNC (2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sramgetend2")] + public static extern short cnc_sramgetend2(ushort FlibHndl); + + /* read number of S-RAM data kind on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsramnum")] + public static extern short cnc_rdsramnum(ushort FlibHndl, out short a); + + /* read S-RAM data address information on CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsramaddr")] + public static extern short cnc_rdsramaddr(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.LPStruct)] SRAMADDR b); + + /* get current NC data protection information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getlockstat")] + public static extern short cnc_getlockstat(ushort FlibHndl, short a, out byte b); + + /* change NC data protection status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_chgprotbit")] + public static extern short cnc_chgprotbit(ushort FlibHndl, short a, ref byte b, int c); + + /* transfer a file from host computer to CNC by FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvftpget")] + public static extern short cnc_dtsvftpget(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* transfer a file from CNC to host computer by FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvftpput")] + public static extern short cnc_dtsvftpput(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* get transfer status for FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvftpstat")] + public static extern short cnc_dtsvftpstat(ushort FlibHndl); + + /* read file directory in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvrdpgdir")] + public static extern short cnc_dtsvrdpgdir(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDSDIR c); + + /* delete files in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvdelete")] + public static extern short cnc_dtsvdelete(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* down load from CNC (transfer a file from CNC to MMC) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvdownload")] + public static extern short cnc_dtsvdownload(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* up load to CNC (transfer a file from MMC to CNC) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvupload")] + public static extern short cnc_dtsvupload(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* close upload/download between Data Server and CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvcnclupdn")] + public static extern short cnc_dtsvcnclupdn(ushort FlibHndl); + + /* get transfer status for up/down load */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvupdnstat")] + public static extern short cnc_dtsvupdnstat(ushort FlibHndl); + + /* get file name for DNC operation in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvgetdncpg")] + public static extern short cnc_dtsvgetdncpg(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* set program number of DNC oparation to CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvsetdncpg")] + public static extern short cnc_dtsvsetdncpg(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read setting data for Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvrdset")] + public static extern short cnc_dtsvrdset(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBDSSET a); + + /* write setting data for Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvwrset")] + public static extern short cnc_dtsvwrset(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBDSSET a); + + /* check hard disk in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvchkdsk")] + public static extern short cnc_dtsvchkdsk(ushort FlibHndl); + + /* format hard disk in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvhdformat")] + public static extern short cnc_dtsvhdformat(ushort FlibHndl); + + /* save interface area in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvsavecram")] + public static extern short cnc_dtsvsavecram(ushort FlibHndl); + + /* get interface area in Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvrdcram")] + public static extern short cnc_dtsvrdcram(ushort FlibHndl, int a, ref int b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* read maintenance information for Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvmntinfo")] + public static extern short cnc_dtsvmntinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDSMNT a); + + /* get Data Server mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvgetmode")] + public static extern short cnc_dtsvgetmode(ushort FlibHndl, out short a); + + /* set Data Server mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvsetmode")] + public static extern short cnc_dtsvsetmode(ushort FlibHndl, short a); + + /* read error message for Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvrderrmsg")] + public static extern short cnc_dtsvrderrmsg(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* transfar file from Pc to Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvwrfile")] + public static extern short cnc_dtsvwrfile(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, short c); + + /* transfar file from Data Server to Pc */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dtsvrdfile")] + public static extern short cnc_dtsvrdfile(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, short c); + + /* read the loop gain for each axis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdloopgain")] + public static extern short cnc_rdloopgain(ushort FlibHndl, out int a); + + /* read the actual current for each axis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcurrent")] + public static extern short cnc_rdcurrent(ushort FlibHndl, out short a); + + /* read the actual speed for each axis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsrvspeed")] + public static extern short cnc_rdsrvspeed(ushort FlibHndl, out int a); + + /* read the operation mode */ + /// + /// 读取操作模式 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdopmode")] + public static extern short cnc_rdopmode(ushort FlibHndl, out short a); + + /* read the position deviation S */ + /// + /// 读取位置偏差S + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdposerrs")] + public static extern short cnc_rdposerrs(ushort FlibHndl, out int a); + + /* read the position deviation S1 and S2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdposerrs2")] + public static extern short cnc_rdposerrs2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPSER a); + + /* read the position deviation Z in the rigid tap mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdposerrz")] + public static extern short cnc_rdposerrz(ushort FlibHndl, out int a); + + /* read the synchronous error in the synchronous control mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsynerrsy")] + public static extern short cnc_rdsynerrsy(ushort FlibHndl, out int a); + + /* read the synchronous error in the rigid tap mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsynerrrg")] + public static extern short cnc_rdsynerrrg(ushort FlibHndl, out int a); + + /* read the spindle alarm */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspdlalm")] + public static extern short cnc_rdspdlalm(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the control input signal */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdctrldi")] + public static extern short cnc_rdctrldi(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPDI a); + + /* read the control output signal */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdctrldo")] + public static extern short cnc_rdctrldo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPDO a); + + /* read the number of controled spindle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdnspdl")] + public static extern short cnc_rdnspdl(ushort FlibHndl, out short a); + + /* read data from FANUC BUS */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdfbusmem")] + public static extern short cnc_rdfbusmem(ushort FlibHndl, + short a, short b, int c, int d, [Out, MarshalAs(UnmanagedType.AsAny)] Object e); + + /* write data to FANUC BUS */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrfbusmem")] + public static extern short cnc_wrfbusmem(ushort FlibHndl, + short a, short b, int c, int d, [In, MarshalAs(UnmanagedType.AsAny)] Object e); + + /* read the parameter of wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdwaveprm")] + public static extern short cnc_rdwaveprm(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBWAVE a); + + /* write the parameter of wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrwaveprm")] + public static extern short cnc_wrwaveprm(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBWAVE a); + + /* read the parameter of wave diagnosis 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdwaveprm2")] + public static extern short cnc_rdwaveprm2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBWVPRM a); + + /* write the parameter of wave diagnosis 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrwaveprm2")] + public static extern short cnc_wrwaveprm2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBWVPRM a); + + /* start the sampling for wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wavestart")] + public static extern short cnc_wavestart(ushort FlibHndl); + + /* stop the sampling for wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wavestop")] + public static extern short cnc_wavestop(ushort FlibHndl); + + /* read the status of wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wavestat")] + public static extern short cnc_wavestat(ushort FlibHndl, out short a); + + /* read the data of wave diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdwavedata")] + public static extern short cnc_rdwavedata(ushort FlibHndl, + short a, short b, int c, ref int d, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBWVDT e); + + /* read the parameter of wave diagnosis for remort diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrmtwaveprm")] + public static extern short cnc_rdrmtwaveprm(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBRMTPRM a, short b); + + /* write the parameter of wave diagnosis for remort diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrrmtwaveprm")] + public static extern short cnc_wrrmtwaveprm(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBRMTPRM a); + + /* start the sampling for wave diagnosis for remort diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rmtwavestart")] + public static extern short cnc_rmtwavestart(ushort FlibHndl); + + /* stop the sampling for wave diagnosis for remort diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rmtwavestop")] + public static extern short cnc_rmtwavestop(ushort FlibHndl); + + /* read the status of wave diagnosis for remort diagnosis*/ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rmtwavestat")] + public static extern short cnc_rmtwavestat(ushort FlibHndl, out short a); + + /* read the data of wave diagnosis for remort diagnosis */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrmtwavedt")] + public static extern short cnc_rdrmtwavedt(ushort FlibHndl, + short a, int b, ref int c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBRMTDT d); + + /* read of address for PMC signal batch save */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsavsigadr")] + public static extern short cnc_rdsavsigadr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSIGAD a, short b); + + /* write of address for PMC signal batch save */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrsavsigadr")] + public static extern short cnc_wrsavsigadr(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSIGAD a, out short b); + + /* read of data for PMC signal batch save */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsavsigdata")] + public static extern short cnc_rdsavsigdata(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c, ref short d); + + /* read M-code group data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmgrpdata")] + public static extern short cnc_rdmgrpdata(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMGRP c); + + /* write M-code group data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmgrpdata")] + public static extern short cnc_wrmgrpdata(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IDBMGRP a); + + /* read executing M-code group data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdexecmcode")] + public static extern short cnc_rdexecmcode(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBEXEM c); + + /* read program restart M-code group data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrstrmcode")] + public static extern short cnc_rdrstrmcode(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBRSTRM c); + + /* read processing time stamp data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdproctime")] + public static extern short cnc_rdproctime(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPTIME a); + + /* read MDI program stat */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmdiprgstat")] + public static extern short cnc_rdmdiprgstat(ushort FlibHndl, out ushort a); + + /* read program directory for processing time data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprgdirtime")] + public static extern short cnc_rdprgdirtime(ushort FlibHndl, + ref int a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGDIRTM c); + + /* read program directory 2 */ +#if (!ONO8D) + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogdir2")] + public static extern short cnc_rdprogdir2(ushort FlibHndl, + short a, ref short b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGDIR2 d); +#else + [DllImport("FWLIB32.dll", EntryPoint="cnc_rdprogdir2o8")] + public static extern short cnc_rdprogdir2( ushort FlibHndl, + short a, ref short b, ref short c, [Out,MarshalAs(UnmanagedType.LPStruct)] PRGDIR2 d ); +#endif + + /* read program directory 3 */ + /// + /// 读取程序目录 + /// + /// + /// + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogdir3")] + public static extern short cnc_rdprogdir3(ushort FlibHndl, + short a, ref int b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGDIR3 d); + + /* read program directory 4 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdprogdir4")] + public static extern short cnc_rdprogdir4(ushort FlibHndl, + short a, int b, ref short c, [Out, MarshalAs(UnmanagedType.LPStruct)] PRGDIR4 d); + + /* read DNC file name for DNC1, DNC2, OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddncfname")] + public static extern short cnc_rddncfname(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* write DNC file name for DNC1, DNC2, OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrdncfname")] + public static extern short cnc_wrdncfname(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read communication parameter for DNC1, DNC2, OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcomparam")] + public static extern short cnc_rdcomparam(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBCPRM a); + + /* write communication parameter for DNC1, DNC2, OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrcomparam")] + public static extern short cnc_wrcomparam(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBCPRM a); + + /* read log message for DNC2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcomlogmsg")] + public static extern short cnc_rdcomlogmsg(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read operator message for DNC1, DNC2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcomopemsg")] + public static extern short cnc_rdcomopemsg(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read recieve message for OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrcvmsg")] + public static extern short cnc_rdrcvmsg(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read send message for OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsndmsg")] + public static extern short cnc_rdsndmsg(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* send message for OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sendmessage")] + public static extern short cnc_sendmessage(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* clear message buffer for OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clrmsgbuff")] + public static extern short cnc_clrmsgbuff(ushort FlibHndl, short a); + + /* read message recieve status for OSI-Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrcvstat")] + public static extern short cnc_rdrcvstat(ushort FlibHndl, out ushort a); + + /* read interference check */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdintchk")] + public static extern short cnc_rdintchk(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBINT e); + + /* write interference check */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrintchk")] + public static extern short cnc_wrintchk(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBINT b); + + /* read interference check information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdintinfo")] + public static extern short cnc_rdintinfo(ushort FlibHndl, out short a); + + /* read work coordinate shift */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdwkcdshft")] + public static extern short cnc_rdwkcdshft(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBWCSF c); + + /* write work coordinate shift */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrwkcdshft")] + public static extern short cnc_wrwkcdshft(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBWCSF b); + + /* read work coordinate shift measure */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdwkcdsfms")] + public static extern short cnc_rdwkcdsfms(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBWCSF c); + + /* write work coordinate shift measure */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrwkcdsfms")] + public static extern short cnc_wrwkcdsfms(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBWCSF b); + + /* stop the sampling for operator message history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopomhis")] + public static extern short cnc_stopomhis(ushort FlibHndl); + + /* start the sampling for operator message history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startomhis")] + public static extern short cnc_startomhis(ushort FlibHndl); + + /* read operator message history information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdomhisinfo")] + public static extern short cnc_rdomhisinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOMIF a); + + /* read operator message history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdomhistry")] + public static extern short cnc_rdomhistry(ushort FlibHndl, + ushort a, ref ushort b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOMHIS c); + + /* read operater message history data F30i */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdomhistry2")] + public static extern short cnc_rdomhistry2(ushort FlibHndl, + ushort a, ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBOMHIS2 d); + + /* write external key operation history for F30i*/ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrkeyhistry")] + public static extern short cnc_wrkeyhistry(ushort FlibHndl, byte a); + + /* clear operator message history */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clearomhis")] + public static extern short cnc_clearomhis(ushort FlibHndl); + + /* read b-axis tool offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdbtofsr")] + public static extern short cnc_rdbtofsr(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBBTO e); + + /* write b-axis tool offset value(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrbtofsr")] + public static extern short cnc_wrbtofsr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBBTO b); + + /* read b-axis tool offset information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdbtofsinfo")] + public static extern short cnc_rdbtofsinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBBTLINF a); + + /* read b-axis command */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdbaxis")] + public static extern short cnc_rdbaxis(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBBAXIS a); + + /* read CNC system soft series and version */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsyssoft")] + public static extern short cnc_rdsyssoft(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSS a); + + /* read CNC system soft series and version (2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsyssoft2")] + public static extern short cnc_rdsyssoft2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSS2 a); + + /* read CNC module configuration information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmdlconfig")] + public static extern short cnc_rdmdlconfig(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMDLC a); + + /* read CNC module configuration information 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmdlconfig2")] + public static extern short cnc_rdmdlconfig2(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read processing condition file (processing data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpscdproc")] + public static extern short cnc_rdpscdproc(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPSCD c); + + /* write processing condition file (processing data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpscdproc")] + public static extern short cnc_wrpscdproc(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPSCD c); + + /* read processing condition file (piercing data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpscdpirc")] + public static extern short cnc_rdpscdpirc(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPIRC c); + + /* write processing condition file (piercing data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpscdpirc")] + public static extern short cnc_wrpscdpirc(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPIRC c); + + /* read processing condition file (edging data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpscdedge")] + public static extern short cnc_rdpscdedge(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBEDGE c); + + /* write processing condition file (edging data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpscdedge")] + public static extern short cnc_wrpscdedge(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBEDGE c); + + /* read processing condition file (slope data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpscdslop")] + public static extern short cnc_rdpscdslop(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLOP c); + + /* write processing condition file (slope data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpscdslop")] + public static extern short cnc_wrpscdslop(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLOP c); + + /* read power controll duty data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlpwrdty")] + public static extern short cnc_rdlpwrdty(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBLPWDT a); + + /* write power controll duty data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlpwrdty")] + public static extern short cnc_wrlpwrdty(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBLPWDT a); + + /* read laser power data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlpwrdat")] + public static extern short cnc_rdlpwrdat(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLOPDT a); + + /* read power complement */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlpwrcpst")] + public static extern short cnc_rdlpwrcpst(ushort FlibHndl, out short a); + + /* write power complement */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlpwrcpst")] + public static extern short cnc_wrlpwrcpst(ushort FlibHndl, short a); + + /* read laser assist gas selection */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlagslt")] + public static extern short cnc_rdlagslt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBLAGSL a); + + /* write laser assist gas selection */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlagslt")] + public static extern short cnc_wrlagslt(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBLAGSL a); + + /* read laser assist gas flow */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlagst")] + public static extern short cnc_rdlagst(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBLAGST a); + + /* write laser assist gas flow */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlagst")] + public static extern short cnc_wrlagst(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBLAGST a); + + /* read laser power for edge processing */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdledgprc")] + public static extern short cnc_rdledgprc(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBLEGPR a); + + /* write laser power for edge processing */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrledgprc")] + public static extern short cnc_wrledgprc(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBLEGPR a); + + /* read laser power for piercing */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlprcprc")] + public static extern short cnc_rdlprcprc(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBLPCPR a); + + /* write laser power for piercing */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlprcprc")] + public static extern short cnc_wrlprcprc(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBLPCPR a); + + /* read laser command data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlcmddat")] + public static extern short cnc_rdlcmddat(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLCMDT a); + + /* read displacement */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdldsplc")] + public static extern short cnc_rdldsplc(ushort FlibHndl, out short a); + + /* write displacement */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrldsplc")] + public static extern short cnc_wrldsplc(ushort FlibHndl, short a); + + /* read error for axis z */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlerrz")] + public static extern short cnc_rdlerrz(ushort FlibHndl, out short a); + + /* read active number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlactnum")] + public static extern short cnc_rdlactnum(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLACTN a); + + /* read laser comment */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlcmmt")] + public static extern short cnc_rdlcmmt(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLCMMT a); + + /* read laser power select */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlpwrslt")] + public static extern short cnc_rdlpwrslt(ushort FlibHndl, out short a); + + /* write laser power select */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlpwrslt")] + public static extern short cnc_wrlpwrslt(ushort FlibHndl, short a); + + /* read laser power controll */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlpwrctrl")] + public static extern short cnc_rdlpwrctrl(ushort FlibHndl, out short a); + + /* write laser power controll */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrlpwrctrl")] + public static extern short cnc_wrlpwrctrl(ushort FlibHndl, short a); + + /* read power correction factor history data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpwofsthis")] + public static extern short cnc_rdpwofsthis(ushort FlibHndl, + int a, ref int b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPWOFST c); + + /* read management time */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmngtime")] + public static extern short cnc_rdmngtime(ushort FlibHndl, + int a, ref int b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBMNGTIME c); + + /* write management time */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmngtime")] + public static extern short cnc_wrmngtime(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBMNGTIME b); + + /* read data related to electrical discharge at power correction ends */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddischarge")] + public static extern short cnc_rddischarge(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDISCHRG a); + + /* read alarm history data related to electrical discharg */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddischrgalm")] + public static extern short cnc_rddischrgalm(ushort FlibHndl, + int a, ref int b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBDISCHRGALM c); + + /* get date and time from cnc */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_gettimer")] + public static extern short cnc_gettimer(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTIMER a); + + /* set date and time for cnc */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_settimer")] + public static extern short cnc_settimer(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTIMER a); + + /* read timer data from cnc */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtimer")] + public static extern short cnc_rdtimer(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTIME b); + + /* write timer data for cnc */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtimer")] + public static extern short cnc_wrtimer(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTIME b); + + /* read tool controll data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtlctldata")] + public static extern short cnc_rdtlctldata(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLCTL a); + + /* write tool controll data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtlctldata")] + public static extern short cnc_wrtlctldata(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLCTL a); + + /* read tool data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtooldata")] + public static extern short cnc_rdtooldata(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLDT c); + + /* read tool data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtooldata")] + public static extern short cnc_wrtooldata(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLDT c); + + /* read multi tool data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmultitldt")] + public static extern short cnc_rdmultitldt(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBMLTTL c); + + /* write multi tool data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmultitldt")] + public static extern short cnc_wrmultitldt(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBMLTTL c); + + /* read multi tap data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmtapdata")] + public static extern short cnc_rdmtapdata(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBMTAP c); + + /* write multi tap data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmtapdata")] + public static extern short cnc_wrmtapdata(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBMTAP c); + + /* read multi-piece machining number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmultipieceno")] + public static extern short cnc_rdmultipieceno(ushort FlibHndl, out int a); + + /* read tool information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtoolinfo")] + public static extern short cnc_rdtoolinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPTLINF a); + + /* read safetyzone data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsafetyzone")] + public static extern short cnc_rdsafetyzone(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSAFE c); + + /* write safetyzone data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrsafetyzone")] + public static extern short cnc_wrsafetyzone(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSAFE c); + + /* read toolzone data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdtoolzone")] + public static extern short cnc_rdtoolzone(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBTLZN c); + + /* write toolzone data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrtoolzone")] + public static extern short cnc_wrtoolzone(ushort FlibHndl, + short a, ref short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBTLZN c); + + /* read active toolzone data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdacttlzone")] + public static extern short cnc_rdacttlzone(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBACTTLZN a); + + /* read setzone number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsetzone")] + public static extern short cnc_rdsetzone(ushort FlibHndl, out short a); + + /* write setzone number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrsetzone")] + public static extern short cnc_wrsetzone(ushort FlibHndl, short a); + + /* read block restart information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdbrstrinfo")] + public static extern short cnc_rdbrstrinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBBRS a); + + /* read menu switch signal */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmenuswitch")] + public static extern short cnc_rdmenuswitch(ushort FlibHndl, out short a); + + /* write menu switch signal */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrmenuswitch")] + public static extern short cnc_wrmenuswitch(ushort FlibHndl, short a, short b); + + /* read tool radius offset for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdradofs")] + public static extern short cnc_rdradofs(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBROFS a); + + /* read tool length offset for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdlenofs")] + public static extern short cnc_rdlenofs(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBLOFS a); + + /* read fixed cycle for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdfixcycle")] + public static extern short cnc_rdfixcycle(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBFIX a); + + /* read coordinate rotate for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcdrotate")] + public static extern short cnc_rdcdrotate(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBROT a); + + /* read 3D coordinate convert for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dcdcnv")] + public static extern short cnc_rd3dcdcnv(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB3DCD a); + + /* read programable mirror image for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmirimage")] + public static extern short cnc_rdmirimage(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBMIR a); + + /* read scaling for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdscaling")] + public static extern short cnc_rdscaling(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSCL a); + + /* read 3D tool offset for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dtofs")] + public static extern short cnc_rd3dtofs(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB3DTO a); + + /* read tool position offset for position data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdposofs")] + public static extern short cnc_rdposofs(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPOFS a); + + /* read hpcc setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhpccset")] + public static extern short cnc_rdhpccset(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBHPST a); + + /* write hpcc setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhpccset")] + public static extern short cnc_wrhpccset(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBHPST a); + + /* hpcc data auto setting data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_hpccatset")] + public static extern short cnc_hpccatset(ushort FlibHndl); + + /* read hpcc tuning data ( parameter input ) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhpcctupr")] + public static extern short cnc_rdhpcctupr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBHPPR a); + + /* write hpcc tuning data ( parameter input ) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhpcctupr")] + public static extern short cnc_wrhpcctupr(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBHPPR a); + + /* read hpcc tuning data ( acc input ) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdhpcctuac")] + public static extern short cnc_rdhpcctuac(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBHPAC a); + + /* write hpcc tuning data ( acc input ) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrhpcctuac")] + public static extern short cnc_wrhpcctuac(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBHPAC a); + + /* hpcc data auto tuning */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_hpccattune")] + public static extern short cnc_hpccattune(ushort FlibHndl, short a, out short b); + + /* read hpcc fine level */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_hpccactfine")] + public static extern short cnc_hpccactfine(ushort FlibHndl, out short a); + + /* select hpcc fine level */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_hpccselfine")] + public static extern short cnc_hpccselfine(ushort FlibHndl, short a); + + /* read active fixture offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdactfixofs")] + public static extern short cnc_rdactfixofs(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBZOFS b); + + /* read fixture offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdfixofs")] + public static extern short cnc_rdfixofs(ushort FlibHndl, + short a, short b, short c, short d, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBZOR e); + + /* write fixture offset */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrfixofs")] + public static extern short cnc_wrfixofs(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBZOR b); + + /* read tip of tool for 3D handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dtooltip")] + public static extern short cnc_rd3dtooltip(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB3DHDL a); + + /* read pulse for 3D handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dpulse")] + public static extern short cnc_rd3dpulse(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB3DPLS a); + + /* read move overrlap of tool for 3D handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dmovrlap")] + public static extern short cnc_rd3dmovrlap(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODB3DHDL a); + + /* read change offset for 3D handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rd3dofschg")] + public static extern short cnc_rd3dofschg(ushort FlibHndl, ref int a); + + /* clear pulse and change offset for 3D handle */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clr3dplsmov")] + public static extern short cnc_clr3dplsmov(ushort FlibHndl, short a); + + /* cycle start */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_start")] + public static extern short cnc_start(ushort FlibHndl); + + /* reset CNC */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_reset")] + public static extern short cnc_reset(ushort FlibHndl); + + /* reset CNC 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_reset2")] + public static extern short cnc_reset2(ushort FlibHndl); + + /* read axis name */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdaxisname")] + public static extern short cnc_rdaxisname(ushort FlibHndl, + ref short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXISNAME b); + + /* read spindle name */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdspdlname")] + public static extern short cnc_rdspdlname(ushort FlibHndl, + ref short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSPDLNAME b); + + /* read extended axis name */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_exaxisname")] + public static extern short cnc_exaxisname(ushort FlibHndl, + short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBEXAXISNAME c); + + /* read SRAM variable area for C language executor */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcexesram")] + public static extern short cnc_rdcexesram(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* write SRAM variable area for C language executor */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrcexesram")] + public static extern short cnc_wrcexesram(ushort FlibHndl, int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, ref int c); + + /* read maximum size and linear address of SRAM variable area for C language executor */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cexesraminfo")] + public static extern short cnc_cexesraminfo(ushort FlibHndl, out short a, out int b, out int c); + + /* read maximum size of SRAM variable area for C language executor */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cexesramsize")] + public static extern short cnc_cexesramsize(ushort FlibHndl, out int a); + + /* read additional workpiece coordinate systems number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcoordnum")] + public static extern short cnc_rdcoordnum(ushort FlibHndl, out short a); + + /* converts from FANUC code to Shift JIS code */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_ftosjis")] + public static extern short cnc_ftosjis(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* Set the unsolicited message parameters */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrunsolicprm")] + public static extern short cnc_wrunsolicprm(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBUNSOLIC b); + + /* Get the unsolicited message parameters */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdunsolicprm")] + public static extern short cnc_rdunsolicprm(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBUNSOLIC b); + + /* Start of unsolicited message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_unsolicstart")] + public static extern short cnc_unsolicstart(ushort FlibHndl, short a, int hWnd, uint c, short d, out short e); + + /* End of unsolicited message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_unsolicstop")] + public static extern short cnc_unsolicstop(ushort FlibHndl, short a); + + /* Reads the unsolicited message data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdunsolicmsg")] + public static extern short cnc_rdunsolicmsg(short a, [In, Out] IDBUNSOLICMSG b); + + /* read machine specific maintenance item */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpm_mcnitem")] + public static extern short cnc_rdpm_mcnitem(ushort FlibHndl, short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBITEM c); + + /* write machine specific maintenance item */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpm_mcnitem")] + public static extern short cnc_wrpm_mcnitem(ushort FlibHndl, short a, short b, [In, MarshalAs(UnmanagedType.LPStruct)] IODBITEM c); + + /* read cnc maintenance item */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpm_cncitem")] + public static extern short cnc_rdpm_cncitem(ushort FlibHndl, short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBITEM c); + + /* read maintenance item status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdpm_item")] + public static extern short cnc_rdpm_item(ushort FlibHndl, short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMAINTE c); + + /* write maintenance item status */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrpm_item")] + public static extern short cnc_wrpm_item(ushort FlibHndl, short a, short b, short c, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPMAINTE d); + + /* Display of optional message */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_dispoptmsg")] + public static extern short cnc_dispoptmsg(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* Reading of answer for optional message display */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_optmsgans")] + public static extern short cnc_optmsgans(ushort FlibHndl, out short a); + + /* Get CNC Model */ + /// + /// 获取CNC模型 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getcncmodel")] + public static extern short cnc_getcncmodel(ushort FlibHndl, out short a); + + /* read number of repeats */ + /// + /// 读取重复次数 + /// + /// + /// + /// + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrepeatval")] + public static extern short cnc_rdrepeatval(ushort FlibHndl, out int a); + + /* read CNC system hard info */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsyshard")] + public static extern short cnc_rdsyshard(ushort FlibHndl, short a, ref short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSH c); + + /* read CNC system soft series and version (3) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdsyssoft3")] + public static extern short cnc_rdsyssoft3(ushort FlibHndl, short a, ref short b, out short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSS3 d); + + /* read digit of program number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_progdigit")] + public static extern short cnc_progdigit(ushort FlibHndl, out short a); + + /* read CNC system path information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sysinfo_ex")] + public static extern short cnc_sysinfo_ex(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSYSEX a); + + /*------------------*/ + /* CNC : SERCOS I/F */ + /*------------------*/ + + /* Get reservation of service channel for SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrsvchnl")] + public static extern short cnc_srcsrsvchnl(ushort FlibHndl); + + /* Read ID information of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrdidinfo")] + public static extern short cnc_srcsrdidinfo(ushort FlibHndl, + int a, short b, short c, [Out, MarshalAs(UnmanagedType.AsAny)] IODBIDINF d); + + /* Write ID information of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcswridinfo")] + public static extern short cnc_srcswridinfo(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBIDINF a); + + /* Start of reading operation data from drive of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsstartrd")] + public static extern short cnc_srcsstartrd(ushort FlibHndl, int a, short b); + + /* Start of writing operation data to drive of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsstartwrt")] + public static extern short cnc_srcsstartwrt(ushort FlibHndl, int a, short b); + + /* Stop of reading/writing operation data from/to drive of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsstopexec")] + public static extern short cnc_srcsstopexec(ushort FlibHndl); + + /* Get execution status of reading/writing operation data of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrdexstat")] + public static extern short cnc_srcsrdexstat(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSRCSST a); + + /* Read operation data from data buffer for SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrdopdata")] + public static extern short cnc_srcsrdopdata(ushort FlibHndl, int a, ref int b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* Write operation data to data buffer for SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcswropdata")] + public static extern short cnc_srcswropdata(ushort FlibHndl, int a, int b, [In, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* Free reservation of service channel for SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsfreechnl")] + public static extern short cnc_srcsfreechnl(ushort FlibHndl); + + /* Read drive assign of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrdlayout")] + public static extern short cnc_srcsrdlayout(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSRCSLYT a); + + /* Read communication phase of drive of SERCOS I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_srcsrddrvcp")] + public static extern short cnc_srcsrddrvcp(ushort FlibHndl, out short a); + + + /*----------------------------*/ + /* CNC : Graphic command data */ + /*----------------------------*/ + + /* Start drawing position */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startdrawpos")] + public static extern short cnc_startdrawpos(ushort FlibHndl); + + /* Stop drawing position */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopdrawpos")] + public static extern short cnc_stopdrawpos(ushort FlibHndl); + + /* Start dynamic graphic */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startdyngrph")] + public static extern short cnc_startdyngrph(ushort FlibHndl); + + /* Stop dynamic graphic */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopdyngrph")] + public static extern short cnc_stopdyngrph(ushort FlibHndl); + + /* Read graphic command data */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrphcmd")] + public static extern short cnc_rdgrphcmd(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* Update graphic command read pointer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrgrphcmdptr")] + public static extern short cnc_wrgrphcmdptr(ushort FlibHndl, short a); + + /* Read cancel flag */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdgrphcanflg")] + public static extern short cnc_rdgrphcanflg(ushort FlibHndl, out short a); + + /* Clear graphic command */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clrgrphcmd")] + public static extern short cnc_clrgrphcmd(ushort FlibHndl); + + + /*---------------------------*/ + /* CNC : Servo learning data */ + /*---------------------------*/ + + /* Servo learning data read start */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtstartrd")] + public static extern short cnc_svdtstartrd(ushort FlibHndl, short a); + + /* Servo learning data write start */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtstartwr")] + public static extern short cnc_svdtstartwr(ushort FlibHndl, short a); + + /* Servo learning data read end */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtendrd")] + public static extern short cnc_svdtendrd(ushort FlibHndl); + + /* Servo learning data write end */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtendwr")] + public static extern short cnc_svdtendwr(ushort FlibHndl); + + /* Servo learning data read/write stop */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtstopexec")] + public static extern short cnc_svdtstopexec(ushort FlibHndl); + + /* Servo learning data read from I/F buffer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtrddata")] + public static extern short cnc_svdtrddata(ushort FlibHndl, + out short a, ref int b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* Servo learning data write to I/F buffer */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_svdtwrdata")] + public static extern short cnc_svdtwrdata(ushort FlibHndl, + out short a, ref int b, [In, MarshalAs(UnmanagedType.AsAny)] Object c); + + + /*----------------------------*/ + /* CNC : Servo Guide */ + /*----------------------------*/ + /* Servo Guide (Channel data set) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdsetchnl")] + public static extern short cnc_sdsetchnl(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IDBCHAN b); + + /* Servo Guide (Channel data clear) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdclrchnl")] + public static extern short cnc_sdclrchnl(ushort FlibHndl); + + /* Servo Guide (Sampling start) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdstartsmpl")] + public static extern short cnc_sdstartsmpl(ushort FlibHndl, short a, int b, [Out, MarshalAs(UnmanagedType.AsAny)] Object c); + + /* Servo Guide (Sampling cancel) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdcancelsmpl")] + public static extern short cnc_sdcancelsmpl(ushort FlibHndl); + + /* Servo Guide (read Sampling data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdreadsmpl")] + public static extern short cnc_sdreadsmpl(ushort FlibHndl, + out short a, int b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSD c); + + /* Servo Guide (Sampling end) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdendsmpl")] + public static extern short cnc_sdendsmpl(ushort FlibHndl); + + /* Servo Guide (read 1 shot data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sdread1shot")] + public static extern short cnc_sdread1shot(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* Servo feedback data (Channel data set) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbsetchnl")] + public static extern short cnc_sfbsetchnl(ushort FlibHndl, + short a, int b, [In, MarshalAs(UnmanagedType.LPStruct)] IDBSFBCHAN c); + + /* Servo feedback data (Channel data clear) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbclrchnl")] + public static extern short cnc_sfbclrchnl(ushort FlibHndl); + + /* Servo feedback data (Sampling start) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbstartsmpl")] + public static extern short cnc_sfbstartsmpl(ushort FlibHndl, short a, int b); + + /* Servo feedback data (Sampling cancel) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbcancelsmpl")] + public static extern short cnc_sfbcancelsmpl(ushort FlibHndl); + + /* Servo feedback data (read Sampling data) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbreadsmpl")] + public static extern short cnc_sfbreadsmpl(ushort FlibHndl, + out short a, int b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSD c); + + /* Servo feedback data (Sampling end) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_sfbendsmpl")] + public static extern short cnc_sfbendsmpl(ushort FlibHndl); + + + /*----------------------------*/ + /* CNC : NC display function */ + /*------数控:数控显示功能-----*/ + + /* Start NC display */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startnccmd")] + public static extern short cnc_startnccmd(ushort FlibHndl); + + /* Start NC display (2) */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startnccmd2")] + public static extern short cnc_startnccmd2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* Stop NC display */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopnccmd")] + public static extern short cnc_stopnccmd(ushort FlibHndl); + + /* Get NC display mode */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getdspmode")] + public static extern short cnc_getdspmode(ushort FlibHndl, out short a); + + + /*------------------------------------*/ + /* CNC : Remote diagnostics function */ + /*-------- CNC:远程诊断功能---------*/ + + /* Start remote diagnostics function */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startrmtdgn")] + public static extern short cnc_startrmtdgn(ushort FlibHndl); + + /* Stop remote diagnostics function */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stoprmtdgn")] + public static extern short cnc_stoprmtdgn(ushort FlibHndl); + + /* Read data from remote diagnostics I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdrmtdgn")] + public static extern short cnc_rdrmtdgn(ushort FlibHndl, out int a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* Write data to remote diagnostics I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrrmtdgn")] + public static extern short cnc_wrrmtdgn(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* Set CommStatus of remote diagnostics I/F area */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrcommstatus")] + public static extern short cnc_wrcommstatus(ushort FlibHndl, short a); + + /* Check remote diagnostics I/F */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_chkrmtdgn")] + public static extern short cnc_chkrmtdgn(ushort FlibHndl); + + + /*-------------------------*/ + /* CNC : FS18-LN function */ + /*-------------------------*/ + + /* read allowance */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allowance")] + public static extern short cnc_allowance(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + /* read allowanced state */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allowcnd")] + public static extern short cnc_allowcnd(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBCAXIS c); + + /* set work zero */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_workzero")] + public static extern short cnc_workzero(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBZOFS b); + + /* set slide position */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_slide")] + public static extern short cnc_slide(ushort FlibHndl, + short a, short b, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBAXIS c); + + + /*----------------------------------*/ + /* CNC: Teaching data I/F function */ + /*----------------------------------*/ + + /* Teaching data get start */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_startgetdgdat")] + public static extern short cnc_startgetdgdat(ushort FlibHndl); + + /* Teaching data get stop */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_stopgetdgdat")] + public static extern short cnc_stopgetdgdat(ushort FlibHndl); + + /* Teaching data read */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rddgdat")] + public static extern short cnc_rddgdat(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* Teaching data read pointer write */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrdgdatptr")] + public static extern short cnc_wrdgdatptr(ushort FlibHndl, short a); + + /* Teaching data clear */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_clrdgdat")] + public static extern short cnc_clrdgdat(ushort FlibHndl); + + + /*---------------------------------*/ + /* CNC : C-EXE SRAM file function */ + /*---------------------------------*/ + + /* open C-EXE SRAM file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_opencexefile")] + public static extern short cnc_opencexefile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, short b, short c); + + /* close C-EXE SRAM file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_closecexefile")] + public static extern short cnc_closecexefile(ushort FlibHndl); + + /* read C-EXE SRAM file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdcexefile")] + public static extern short cnc_rdcexefile(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a, ref uint b); + + /* write C-EXE SRAM file */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_wrcexefile")] + public static extern short cnc_wrcexefile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, ref uint b); + + /* read C-EXE SRAM disk directory */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_cexedirectory")] + public static extern short cnc_cexedirectory(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, ref ushort b, ushort c, [Out, MarshalAs(UnmanagedType.LPStruct)] CFILEINFO d); + + + /*-----*/ + /* PMC */ + /*-----*/ + + /* read message from PMC to MMC */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdmsg")] + public static extern short pmc_rdmsg(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write message from MMC to PMC */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrmsg")] + public static extern short pmc_wrmsg(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read message from PMC to MMC(conditional) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_crdmsg")] + public static extern short pmc_crdmsg(ushort FlibHndl, ref short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write message from MMC to PMC(conditional) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_cwrmsg")] + public static extern short pmc_cwrmsg(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read PMC data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcrng")] + public static extern short pmc_rdpmcrng(ushort FlibHndl, + short a, short b, ushort c, ushort d, ushort e, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMC0 f); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcrng")] + public static extern short pmc_rdpmcrng(ushort FlibHndl, + short a, short b, ushort c, ushort d, ushort e, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMC1 f); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcrng")] + public static extern short pmc_rdpmcrng(ushort FlibHndl, + short a, short b, ushort c, ushort d, ushort e, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMC2 f); + + /* write PMC data(area specified) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcrng")] + public static extern short pmc_wrpmcrng(ushort FlibHndl, ushort a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPMC0 b); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcrng")] + public static extern short pmc_wrpmcrng(ushort FlibHndl, ushort a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPMC1 b); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcrng")] + public static extern short pmc_wrpmcrng(ushort FlibHndl, ushort a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPMC2 b); + + /* read data from extended backup memory */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdkpm")] + public static extern short pmc_rdkpm(ushort FlibHndl, uint a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, ushort c); + + /* write data to extended backup memory */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrkpm")] + public static extern short pmc_wrkpm(ushort FlibHndl, uint a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, ushort c); + + /* read data from extended backup memory 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdkpm2")] + public static extern short pmc_rdkpm2(ushort FlibHndl, uint a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b, uint c); + + /* write data to extended backup memory 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrkpm2")] + public static extern short pmc_wrkpm2(ushort FlibHndl, uint a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, uint c); + + /* read maximum size of extended backup memory */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_kpmsiz")] + public static extern short pmc_kpmsiz(ushort FlibHndl, out uint a); + + /* read informations of PMC data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcinfo")] + public static extern short pmc_rdpmcinfo(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMCINF b); + + /* read PMC parameter data table contorol data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdcntldata")] + public static extern short pmc_rdcntldata(ushort FlibHndl, + short a, short b, short c, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMCCNTL d); + + /* write PMC parameter data table contorol data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrcntldata")] + public static extern short pmc_wrcntldata(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPMCCNTL b); + + /* read PMC parameter data table contorol data group number */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdcntlgrp")] + public static extern short pmc_rdcntlgrp(ushort FlibHndl, out short a); + + /* write PMC parameter data table contorol data group number */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrcntlgrp")] + public static extern short pmc_wrcntlgrp(ushort FlibHndl, short a); + + /* read PMC alarm message */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdalmmsg")] + public static extern short pmc_rdalmmsg(ushort FlibHndl, + short a, ref short b, out short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMCALM d); + + /* get detail error for pmc */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_getdtailerr")] + public static extern short pmc_getdtailerr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMCERR a); + + /* read PMC memory data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcmem")] + public static extern short pmc_rdpmcmem(ushort FlibHndl, + short a, int b, int c, [Out, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* write PMC memory data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcmem")] + public static extern short pmc_wrpmcmem(ushort FlibHndl, + short a, int b, int c, [In, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* read PMC-SE memory data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcsemem")] + public static extern short pmc_rdpmcsemem(ushort FlibHndl, + short a, int b, int c, [Out, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* write PMC-SE memory data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcsemem")] + public static extern short pmc_wrpmcsemem(ushort FlibHndl, + short a, int b, int c, [In, MarshalAs(UnmanagedType.AsAny)] Object d); + + /* read pmc title data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmctitle")] + public static extern short pmc_rdpmctitle(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMCTITLE a); + + /* read PMC parameter start */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdprmstart")] + public static extern short pmc_rdprmstart(ushort FlibHndl); + + /* read PMC parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcparam")] + public static extern short pmc_rdpmcparam(ushort FlibHndl, ref int a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read PMC parameter end */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdprmend")] + public static extern short pmc_rdprmend(ushort FlibHndl); + + /* write PMC parameter start */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrprmstart")] + public static extern short pmc_wrprmstart(ushort FlibHndl); + + /* write PMC parameter */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrpmcparam")] + public static extern short pmc_wrpmcparam(ushort FlibHndl, ref int a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write PMC parameter end */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wrprmend")] + public static extern short pmc_wrprmend(ushort FlibHndl); + + /* read PMC data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcrng_ext")] + public static extern short pmc_rdpmcrng_ext(ushort FlibHndl, + short a, [In, Out, MarshalAs(UnmanagedType.LPStruct)] IODBPMCEXT b); + + /* write PMC I/O link assigned data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_wriolinkdat")] + public static extern short pmc_wriolinkdat(ushort FlibHndl, uint a, [In, MarshalAs(UnmanagedType.AsAny)] Object b, uint c); + + /* read PMC address information */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_rdpmcaddr")] + public static extern short pmc_rdpmcaddr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPMCADR a); + + /* select PMC unit */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_select_pmc_unit")] + public static extern short pmc_select_pmc_unit(ushort FlibHndl, int a); + + /* get current PMC unit */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_get_current_pmc_unit")] + public static extern short pmc_get_current_pmc_unit(ushort FlibHndl, ref int a); + + /* get number of PMC */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_get_number_of_pmc")] + public static extern short pmc_get_number_of_pmc(ushort FlibHndl, ref int a); + + /* get PMC unit types */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_get_pmc_unit_types")] + public static extern short pmc_get_pmc_unit_types(ushort FlibHndl, int[] a, ref int b); + + /* set PMC Timer type */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_set_timer_type")] + public static extern short pmc_set_timer_type(ushort FlibHndl, ushort a, ushort b, ref short c); + + /* get PMC Timer type */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_get_timer_type")] + public static extern short pmc_get_timer_type(ushort FlibHndl, ushort a, ushort b, ref short c); + + /*----------------------------*/ + /* PMC : PROFIBUS function */ + /*----------------------------*/ + + /* read PROFIBUS configration data */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdconfig")] + public static extern short pmc_prfrdconfig(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBPRFCNF a); + + /* read bus parameter for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdbusprm")] + public static extern short pmc_prfrdbusprm(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBBUSPRM a); + + /* write bus parameter for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrbusprm")] + public static extern short pmc_prfwrbusprm(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBBUSPRM a); + + /* read slave parameter for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvprm")] + public static extern short pmc_prfrdslvprm(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM b); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvprm")] + public static extern short pmc_prfrdslvprm(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM2 b); + + /* write slave parameter for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrslvprm")] + public static extern short pmc_prfwrslvprm(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM b); + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrslvprm")] + public static extern short pmc_prfwrslvprm(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM2 b); + + /* read allocation address for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdallcadr")] + public static extern short pmc_prfrdallcadr(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBPRFADR b); + + /* set allocation address for master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrallcadr")] + public static extern short pmc_prfwrallcadr(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBPRFADR b); + + /* read allocation address for slave function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvaddr")] + public static extern short pmc_prfrdslvaddr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLVADR a); + + /* set allocation address for slave function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrslvaddr")] + public static extern short pmc_prfwrslvaddr(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLVADR a); + + /* read status for slave function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvstat")] + public static extern short pmc_prfrdslvstat(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBSLVST a); + + /* Reads slave index data of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvid")] + public static extern short pmc_prfrdslvid(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLVID b); + + /* Writes slave index data of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrslvid")] + public static extern short pmc_prfwrslvid(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLVID b); + + /* Reads slave parameter of master function(2) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdslvprm2")] + public static extern short pmc_prfrdslvprm2(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM3 b); + + /* Writes slave parameter of master function(2) */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrslvprm2")] + public static extern short pmc_prfwrslvprm2(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBSLVPRM3 b); + + /* Reads DI/DO parameter of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrddido")] + public static extern short pmc_prfrddido(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBDIDO b); + + /* Writes DI/DO parameter of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrdido")] + public static extern short pmc_prfwrdido(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.LPStruct)] IODBDIDO b); + + /* Reads indication address of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdindiadr")] + public static extern short pmc_prfrdindiadr(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBINDEADR a); + + /* Writes indication address of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwrindiadr")] + public static extern short pmc_prfwrindiadr(ushort FlibHndl, [In, MarshalAs(UnmanagedType.LPStruct)] IODBINDEADR a); + + /* Reads operation mode of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfrdopmode")] + public static extern short pmc_prfrdopmode(ushort FlibHndl, ref short a); + + /* Writes operation mode of master function */ + [DllImport("FWLIB32.dll", EntryPoint = "pmc_prfwropmode")] + public static extern short pmc_prfwropmode(ushort FlibHndl, short a, ref short b); + + /*-----------------------------------------------*/ + /* DS : Data server & Ethernet board function */ + /*-------------数据服务器和以太网板功能------------*/ + + /* read the parameter of the Ethernet board */ + [DllImport("FWLIB32.dll", EntryPoint = "etb_rdparam")] + public static extern short etb_rdparam(ushort FlibHndl, + short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBETP_TCP b); + [DllImport("FWLIB32.dll", EntryPoint = "etb_rdparam")] + public static extern short etb_rdparam(ushort FlibHndl, + short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBETP_HOST b); + [DllImport("FWLIB32.dll", EntryPoint = "etb_rdparam")] + public static extern short etb_rdparam(ushort FlibHndl, + short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBETP_FTP b); + [DllImport("FWLIB32.dll", EntryPoint = "etb_rdparam")] + public static extern short etb_rdparam(ushort FlibHndl, + short a, [Out, MarshalAs(UnmanagedType.LPStruct)] IODBETP_ETB b); + + /* write the parameter of the Ethernet board */ + [DllImport("FWLIB32.dll", EntryPoint = "etb_wrparam")] + public static extern short etb_wrparam(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.LPStruct)] IODBETP_TCP a); + [DllImport("FWLIB32.dll", EntryPoint = "etb_wrparam")] + public static extern short etb_wrparam(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.LPStruct)] IODBETP_HOST a); + [DllImport("FWLIB32.dll", EntryPoint = "etb_wrparam")] + public static extern short etb_wrparam(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.LPStruct)] IODBETP_FTP a); + + /* read the error message of the Ethernet board */ + [DllImport("FWLIB32.dll", EntryPoint = "etb_rderrmsg")] + public static extern short etb_rderrmsg(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBETMSG b); + + /* read the mode of the Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdmode")] + public static extern short ds_rdmode(ushort FlibHndl, ref short a); + + /* write the mode of the Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrmode")] + public static extern short ds_wrmode(ushort FlibHndl, short a); + + /* read information of the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhddinfo")] + public static extern short ds_rdhddinfo(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHDDINF a); + + /* read the file list of the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhdddir")] + public static extern short ds_rdhdddir(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, int b, out short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHDDDIR d); + + /* delete the file of the Data Serve's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_delhddfile")] + public static extern short ds_delhddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* copy the file of the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_copyhddfile")] + public static extern short ds_copyhddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* change the file name of the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_renhddfile")] + public static extern short ds_renhddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* execute the PUT command of the FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_puthddfile")] + public static extern short ds_puthddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* execute the MPUT command of the FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_mputhddfile")] + public static extern short ds_mputhddfile(ushort hLib, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read information of the host */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhostinfo")] + public static extern short ds_rdhostinfo(ushort FlibHndl, out int a, int b); + + /* read the file list of the host */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhostdir")] + public static extern short ds_rdhostdir(ushort FlibHndl, short a, int b, out short c, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHOSTDIR d, int e); + + /* read the file list of the host 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhostdir2")] + public static extern short ds_rdhostdir2(ushort FlibHndl, short a, int b, out short c, out int d, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBHOSTDIR e, int f); + + /* delete the file of the host */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_delhostfile")] + public static extern short ds_delhostfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, int b); + + /* execute the GET command of the FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_gethostfile")] + public static extern short ds_gethostfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* execute the MGET command of the FTP */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_mgethostfile")] + public static extern short ds_mgethostfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the execution result */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdresult")] + public static extern short ds_rdresult(ushort FlibHndl); + + /* stop the execution of the command */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_cancel")] + public static extern short ds_cancel(ushort FlibHndl); + + /* read the file from the Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdncfile")] + public static extern short ds_rdncfile(ushort FlibHndl, short a, [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* read the file from the Data Server 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdncfile2")] + public static extern short ds_rdncfile2(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* write the file to the Data Server */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrncfile")] + public static extern short ds_wrncfile(ushort FlibHndl, short a, int b); + + /* read the file name for the DNC operation in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rddnchddfile")] + public static extern short ds_rddnchddfile(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* write the file name for the DNC operation in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrdnchddfile")] + public static extern short ds_wrdnchddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the file name for the DNC operation in the host */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rddnchostfile")] + public static extern short ds_rddnchostfile(ushort FlibHndl, out short a, [Out, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write the file name for the DNC operation in the host */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrdnchostfile")] + public static extern short ds_wrdnchostfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the connecting host number */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdhostno")] + public static extern short ds_rdhostno(ushort FlibHndl, out short a); + + /* read maintenance information */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdmntinfo")] + public static extern short ds_rdmntinfo(ushort FlibHndl, short a, [Out, MarshalAs(UnmanagedType.LPStruct)] DSMNTINFO b); + + /* check the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_checkhdd")] + public static extern short ds_checkhdd(ushort FlibHndl); + + /* format the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_formathdd")] + public static extern short ds_formathdd(ushort FlibHndl); + + /* create the directory in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_makehdddir")] + public static extern short ds_makehdddir(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* delete directory in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_delhdddir")] + public static extern short ds_delhdddir(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* change the current directory */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_chghdddir")] + public static extern short ds_chghdddir(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* execute the PUT command according to the list file */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_lputhddfile")] + public static extern short ds_lputhddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* delete files according to the list file */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_ldelhddfile")] + public static extern short ds_ldelhddfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* execute the GET command according to the list file */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_lgethostfile")] + public static extern short ds_lgethostfile(ushort FlibHndl, [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the directory for M198 operation */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdm198hdddir")] + public static extern short ds_rdm198hdddir(ushort FlibHndl, [Out, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* write the directory for M198 operation */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrm198hdddir")] + public static extern short ds_wrm198hdddir(ushort FlibHndl); + + /* read the connecting host number for the M198 operation */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdm198host")] + public static extern short ds_rdm198host(ushort FlibHndl, out short a); + + /* write the connecting host number for the M198 operation */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrm198host")] + public static extern short ds_wrm198host(ushort FlibHndl); + + /* write the connecting host number */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrhostno")] + public static extern short ds_wrhostno(ushort FlibHndl, short a); + + /* search string in data server program */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_searchword")] + public static extern short ds_searchword(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a); + + /* read the searching result */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_searchresult")] + public static extern short ds_searchresult(ushort FlibHndl); + + /* read file in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_rdfile")] + public static extern short ds_rdfile(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, + [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /* write file in the Data Server's HDD */ + [DllImport("FWLIB32.dll", EntryPoint = "ds_wrfile")] + public static extern short ds_wrfile(ushort FlibHndl, + [In, MarshalAs(UnmanagedType.AsAny)] Object a, + [In, MarshalAs(UnmanagedType.AsAny)] Object b); + + /*--------------------------*/ + /* HSSB multiple connection */ + /*--------------------------*/ + + /* read number of node */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdnodenum")] + public static extern short cnc_rdnodenum(out int a); + + /* read node informations */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdnodeinfo")] + public static extern short cnc_rdnodeinfo(int a, [Out, MarshalAs(UnmanagedType.LPStruct)] ODBNODE b); + + /* set default node number */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_setdefnode")] + public static extern short cnc_setdefnode(int a); + + /* allocate library handle 2 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allclibhndl2")] + public static extern short cnc_allclibhndl2(int node, out ushort FlibHndl); + + + /*---------------------*/ + /* Ethernet connection */ + /*---------------------*/ + + /* allocate library handle 3 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allclibhndl3")] + public static extern short cnc_allclibhndl3([In, MarshalAs(UnmanagedType.AsAny)] Object ip, + ushort port, int timeout, out ushort FlibHndl); + + /* allocate library handle 4 */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_allclibhndl4")] + public static extern short cnc_allclibhndl4([In, MarshalAs(UnmanagedType.AsAny)] Object ip, + ushort port, int timeout, uint id, out ushort FlibHndl); + + /* set timeout for socket */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_settimeout")] + public static extern short cnc_settimeout(ushort FlibHndl, int a); + + /* reset all socket connection */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_resetconnect")] + public static extern short cnc_resetconnect(ushort FlibHndl); + + /* get option state for FOCAS1/Ethernet */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_getfocas1opt")] + public static extern short cnc_getfocas1opt(ushort FlibHndl, short a, out int b); + + /* read Ethernet board information */ + [DllImport("FWLIB32.dll", EntryPoint = "cnc_rdetherinfo")] + public static extern short cnc_rdetherinfo(ushort FlibHndl, out short a, out short b); + + public static bool[] ToBoolArray(byte[] byt) + { + int len = byt.Length; + bool[] newBit = new bool[len * 8]; + int MidByt; + for (int i = 0; i < len; i++) + { + MidByt = byt[i]; + for (int j = 0; j < 8; j++) + { + newBit[i * 8 + j] = System.Convert.ToBoolean(MidByt % 2); + MidByt = MidByt / 2; + } + } + + return newBit; + } + + static byte[] ToByteArray(bool[] input) + { + if (input.Length % 8 != 0) + { + throw new ArgumentException("input"); + } + byte[] ret = new byte[input.Length / 8]; + for (int i = 0; i < input.Length; i += 8) + { + int value = 0; + for (int j = 0; j < 8; j++) + { + if (input[i + j]) + { + value += 1 << (j); + } + } + ret[i / 8] = (byte)value; + } + return ret; + } + + +} // End for Focas1 class + + +public class Fanuc_CNC +{ + /// + /// + /// + public ushort Flibhndl = 0; + /// + /// + /// + public short ret = -16; + /// + /// + /// + public string ip = ""; + /// + /// + /// + public int port = 0; + /// + /// + /// + public int timeOut = 0; + + + public Fanuc_CNC(string ip, int port, int timeOut) + { + this.ip = ip; + this.port = port; + this.timeOut = timeOut; + } + /// + /// + /// + /// + /// + /// + public void ReConnCNC() + { + /* + private void __OffLineReConnect() + { + switch (ret) + { + case -9: + case -8: + case -16: + bool success = ReConnect(); + break; + default: + break; + } + } + */ + ret = Focas1.cnc_freelibhndl(Flibhndl); + ret = Focas1.cnc_allclibhndl3(ip, (ushort)port, timeOut, out Flibhndl); + + } + + + /// + /// 连接机床 + /// + /// + /// + /// + public bool cnc_allclibhndl3(string ip, int port,int timeOut) + { + if (Flibhndl != 0) + { + cnc_freelibhndl(); + } + ret = Focas1.cnc_allclibhndl3(ip, (ushort)port, timeOut, out Flibhndl); + return ret == (short)Focas1.focas_ret.EW_OK; + } + /// + /// 关闭连接 + /// + /// + public bool cnc_freelibhndl() + { + ret = Focas1.cnc_freelibhndl(Flibhndl); + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 设定读取路径,读取到的数据都是当前路径的 默认第一条 + /// + /// + public bool cnc_setpath(short path_no) + { + ret = Focas1.cnc_setpath(Flibhndl, path_no); + return ret == (short)Focas1.focas_ret.EW_OK; + } + + public bool cnc_rdposition(out double[] absolute_j, out double[] machine_j, out double[] relative_j, out double[] distance_j) + { + Focas1.ODBPOS odbpos = new Focas1.ODBPOS(); + short type = -1; + short data_num = 5; + ret = Focas1.cnc_rdposition(Flibhndl, type, ref data_num, odbpos); + + double abs_1 = odbpos.p1.abs.data * System.Math.Pow(10, -odbpos.p1.abs.dec); + double mach_1 = odbpos.p1.mach.data * System.Math.Pow(10, -odbpos.p1.mach.dec); + double rel_1 = odbpos.p1.rel.data * System.Math.Pow(10, -odbpos.p1.rel.dec); + double dist_1 = odbpos.p1.dist.data * System.Math.Pow(10, -odbpos.p1.dist.dec); + + double abs_2 = odbpos.p2.abs.data * System.Math.Pow(10, -odbpos.p2.abs.dec); + double mach_2 = odbpos.p2.mach.data * System.Math.Pow(10, -odbpos.p2.mach.dec); + double rel_2 = odbpos.p2.rel.data * System.Math.Pow(10, -odbpos.p2.rel.dec); + double dist_2 = odbpos.p2.dist.data * System.Math.Pow(10, -odbpos.p2.dist.dec); + + double abs_3 = odbpos.p3.abs.data * System.Math.Pow(10, -odbpos.p3.abs.dec); + double mach_3 = odbpos.p3.mach.data * System.Math.Pow(10, -odbpos.p3.mach.dec); + double rel_3 = odbpos.p3.rel.data * System.Math.Pow(10, -odbpos.p3.rel.dec); + double dist_3 = odbpos.p3.dist.data * System.Math.Pow(10, -odbpos.p3.dist.dec); + + double abs_4 = odbpos.p4.abs.data * System.Math.Pow(10, -odbpos.p4.abs.dec); + double mach_4 = odbpos.p4.mach.data * System.Math.Pow(10, -odbpos.p4.mach.dec); + double rel_4 = odbpos.p4.rel.data * System.Math.Pow(10, -odbpos.p4.rel.dec); + double dist_4 = odbpos.p4.dist.data * System.Math.Pow(10, -odbpos.p4.dist.dec); + + double abs_5 = odbpos.p5.abs.data * System.Math.Pow(10, -odbpos.p5.abs.dec); + double mach_5 = odbpos.p5.mach.data * System.Math.Pow(10, -odbpos.p5.mach.dec); + double rel_5 = odbpos.p5.rel.data * System.Math.Pow(10, -odbpos.p5.rel.dec); + double dist_5 = odbpos.p5.dist.data * System.Math.Pow(10, -odbpos.p5.dist.dec); + + double abs_6 = odbpos.p6.abs.data * System.Math.Pow(10, -odbpos.p6.abs.dec); + double mach_6 = odbpos.p6.mach.data * System.Math.Pow(10, -odbpos.p6.mach.dec); + double rel_6 = odbpos.p6.rel.data * System.Math.Pow(10, -odbpos.p6.rel.dec); + double dist_6 = odbpos.p6.dist.data * System.Math.Pow(10, -odbpos.p6.dist.dec); + + double abs_7 = odbpos.p7.abs.data * System.Math.Pow(10, -odbpos.p7.abs.dec); + double mach_7 = odbpos.p7.mach.data * System.Math.Pow(10, -odbpos.p7.mach.dec); + double rel_7 = odbpos.p7.rel.data * System.Math.Pow(10, -odbpos.p7.rel.dec); + double dist_7 = odbpos.p7.dist.data * System.Math.Pow(10, -odbpos.p7.dist.dec); + + double abs_8 = odbpos.p8.abs.data * System.Math.Pow(10, -odbpos.p8.abs.dec); + double mach_8 = odbpos.p8.mach.data * System.Math.Pow(10, -odbpos.p8.mach.dec); + double rel_8 = odbpos.p8.rel.data * System.Math.Pow(10, -odbpos.p8.rel.dec); + double dist_8 = odbpos.p8.dist.data * System.Math.Pow(10, -odbpos.p8.dist.dec); + + absolute_j = new double[] { abs_1, abs_2, abs_3, abs_4, abs_5, abs_6, abs_7, abs_8 }; + machine_j = new double[] { mach_1, mach_2, mach_3, mach_4, mach_5, mach_6, mach_7, mach_8 }; + relative_j = new double[] { rel_1, rel_2, rel_3, rel_4, rel_5, rel_6, rel_7, rel_8 }; + distance_j = new double[] { dist_1, dist_2, dist_3, dist_4, dist_5, dist_6, dist_7, dist_8 }; + + return ret == (short)Focas1.focas_ret.EW_OK; + } + public void cnc_rddynamic2(int FocasAxes) + { + Focas1.ODBDY2_1 dynadata = new Focas1.ODBDY2_1(); + short length = (short)(24 + 4 * 4 * FocasAxes); + double[] absolute = new double[3]; + double[] machine = new double[3]; + double[] relative = new double[3]; + double[] distance = new double[3]; + for (short i = 0; i < Convert.ToInt32(FocasAxes); i++) + { + Focas1.cnc_rddynamic2(Flibhndl, (short)(i + 1), length, dynadata); + absolute[i] = dynadata.pos.absolute[i]; + machine[i] = dynadata.pos.machine[i]; + relative[i] = dynadata.pos.relative[i]; + distance[i] = dynadata.pos.distance[i]; + } + } + + + + + public bool cnc_statinfo(out Focas1.ODBST buf) + { + buf = new Focas1.ODBST(); + ret = Focas1.cnc_statinfo(Flibhndl, buf); + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 获取循环时间:这个API采FOCAS说明文档中没有找到, + /// 但是在XML所提供的API Help中有介绍, + /// 这里我参考api help的介绍和对机床的一些基本了解写了一下采集循环时间的函数,可供参考 + /// 这里需要注意的是Fanuc.cnc_rdparam这个函数中的第二个参数要明白其含义,它代表的是机床PARAMETER参数表的序号, + /// 编号6757和6758表示的是循环时间,其中6757存储的值单位是ms,6758存储的值单位是min。 + /// https://blog.csdn.net/qq_27076167/article/details/104973922 + /// + /// + public bool Get_circleTime(out int circleTime) + { + circleTime = 0; + Focas1.IODBPSD_1 param6757 = new Focas1.IODBPSD_1(); + Focas1.IODBPSD_1 param6758 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6757, 0, 8, param6757); + if (ret == 0) + { + int circlingTimeSec = param6757.ldata / 1000; + ret = Focas1.cnc_rdparam(Flibhndl, 6758, 0, 8, param6758); + + if (ret == 0) + { + int circlingTimeMin = param6758.ldata; + circleTime = circlingTimeMin * 60 + circlingTimeSec; + } + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 获取切削时间 + /// 同样是在XML所提供的API Help中有介绍,6753和6754存储的是切削时间的数值,同样6753存储的时间单位是ms,6754存储的时间单位是min, + /// 最后全部换算成秒将其累加便是总时间,获取切削时间的函数参考代码如下 + /// + /// + public bool Get_cuttingTime(out int workingTime) + { + workingTime = 99999; + Focas1.IODBPSD_1 param6753 = new Focas1.IODBPSD_1(); + Focas1.IODBPSD_1 param6754 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6753, 0, 8 + 32, param6753); + + if (ret == 0) + { + int cuttingTimeSec = param6753.ldata / 1000; + ret = Focas1.cnc_rdparam(Flibhndl, 6754, 0, 8 + 32, param6754); + if (ret == 0) + { + int cuttingTimeMin = param6754.ldata; + workingTime = cuttingTimeMin * 60 + cuttingTimeSec; + } + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 获取运行时间: + /// 同样是在XML所提供的API Help中有介绍,6751和6752存储的是运行时间的数值,同样6751存储的时间单位是ms,6752存储的时间单位是min, + /// 最后全部换算成秒将其累加便是总时间,获取切削时间的函数参考代码如下: + /// + /// + public bool get_workingTime(out int workingTime) + { + workingTime = 0; + Focas1.IODBPSD_1 param6751 = new Focas1.IODBPSD_1(); + Focas1.IODBPSD_1 param6752 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6751, 0, 8, param6751); + if (ret == 0) + { + int workingTimeSec = param6751.ldata / 1000; + ret = Focas1.cnc_rdparam(Flibhndl, 6752, 0, 8, param6752); + if (ret == 0) + { + int workingTimeMin = param6752.ldata; + workingTime = workingTimeMin * 60 + workingTimeSec; + } + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 获取开机时间: + /// 同样是在XML所提供的API Help中有介绍,6750存储的是开机时间的数值,同样6750存储的时间单位是min, + /// 每隔一分钟更新一次,这个数值表示的是总共的累加值。 + /// 获取开机时间的函数参考代码如下 + /// + public bool get_powerOnTime(out int powerOnTime) + { + powerOnTime = 0; + Focas1.IODBPSD_1 param6750 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6750, 0, 8 + 32, param6750); + if (ret == 0) + { + powerOnTime = param6750.ldata * 60; + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + + /// + /// 得到工件总数: + /// 同样是在XML所提供的API Help中有介绍,6712存储的加工工件总数的数值。 + /// 获取工件总数的函数参考代码如下 + /// + public bool get_totalparts( out int totalparts) + { + totalparts = 0; + Focas1.IODBPSD_1 param6712 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6712, 0, 8, param6712); + if (ret == 0) + { + totalparts = param6712.ldata; + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 得到已加工数: + /// 同样是在XML所提供的API Help中有介绍,6711存储的已加工数的数值。 + /// 获取已加工数的函数参考代码如下 + /// + public bool get_countparts(out int countparts) + { + countparts = 0; + Focas1.IODBPSD_1 param6711 = new Focas1.IODBPSD_1(); + ret = Focas1.cnc_rdparam(Flibhndl, 6711, 0, 8, param6711); + + if (ret == 0) + { + countparts = param6711.ldata; + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 伺服轴负载 + /// + public bool cnc_rdspmeter(int axisCount, out double[] spmeterData) + { + spmeterData = new double[axisCount]; + short data_num = (short)axisCount; + Focas1.ODBSVLOAD odbsvload = new Focas1.ODBSVLOAD(); + ret = Focas1.cnc_rdsvmeter(Flibhndl, ref data_num, odbsvload); + + if (ret == 0) + { + spmeterData[0] = odbsvload.svload1.data; + spmeterData[1] = odbsvload.svload2.data; + spmeterData[2] = odbsvload.svload3.data; + spmeterData[3] = odbsvload.svload4.data; + spmeterData[4] = odbsvload.svload5.data; + spmeterData[5] = odbsvload.svload6.data; + spmeterData[6] = odbsvload.svload7.data; + spmeterData[7] = odbsvload.svload8.data; + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + + /// + /// 读取刀具寿命 开始组号到结束组号 + /// + /// + /// + public bool cnc_rdtoolrng(short s_number, short e_number,out double[] toolRng) + { + // 0 刀具号 1 刀具寿命 2 已用寿命 依次类推 + toolRng = new double[(int)e_number * 3]; + Focas1.IODBTR iodbtr = new Focas1.IODBTR(); + short length = 1024; + ret = Focas1.cnc_rdtoolrng(Flibhndl, s_number, e_number, length, iodbtr); + if (ret == 0) + { + for (int i = 0; i < e_number; i++) + { + Focas1.IODBTR_data a = (Focas1.IODBTR_data)iodbtr.data.GetType().GetField("data" + (i + 1).ToString()).GetValue(iodbtr.data); + toolRng[i * 3] = i + 1; + toolRng[i * 3 + 1] = a.life; + toolRng[i * 3 + 2] = a.count; + } + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 读取正在执行的程序号 + /// + /// + public bool cnc_rdprgnum(out string programNo) + { + //正在执行的程序号 + programNo = ""; + Focas1.ODBPRO pnum = new Focas1.ODBPRO(); + ret = Focas1.cnc_rdprgnum(Flibhndl, pnum); + programNo = String.Format("O{0:0000}", pnum.data); + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + + /// + /// 读取正在执行的程序名 + /// + /// + public bool cnc_exeprgname(out string PGM) + { + Focas1.ODBEXEPRG odb = new Focas1.ODBEXEPRG(); + //正在执行的程序名 + ret = Focas1.cnc_exeprgname(Flibhndl, odb); + + PGM = ""; + foreach (char item in odb.name) + { + PGM += item.ToString(); + } + PGM = PGM.Replace("\0", ""); + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 读取操作模式 + /// + /// + public bool cnc_rdopmode(int AxisNumber, out short[] mode) + { + mode = new short[AxisNumber]; + ret = Focas1.cnc_rdopmode(Flibhndl, out mode[0]); + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 读取机床主轴上刀号 + /// + /// + public bool cnc_toolnum(out int datano) + { + datano = 0; + short groupNum = 0;//设定组号,若为0表示读当前组信息;[in] + short useorderNum = 1;//设定刀具使用顺序号;[in] + + Focas1.ODBTLIFE4 odb = new Focas1.ODBTLIFE4(); + ret = Focas1.cnc_toolnum(Flibhndl, groupNum, useorderNum, odb);//刀号 + datano = odb.datano; + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 获取F值 + /// + /// + public bool cnc_actf(out int F) + { + F = 0; + Focas1.ODBACT odb = new Focas1.ODBACT(); + ret = Focas1.cnc_actf(Flibhndl, odb); + F = odb.data; + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 获取机床所有主轴实际转速 + /// + public bool cnc_acts(int AxisNumber,out int[] S) + { + Focas1.ODBACT odbact = new Focas1.ODBACT(); + ret = Focas1.cnc_acts(Flibhndl, odbact); + + S = new int[AxisNumber]; + for (short i = 0; i < Convert.ToInt32(AxisNumber); i++) + { + S[i] = odbact.data; + } + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + /// + /// 获取机床机械坐标 + /// + public bool MacAxis(int AxisNumber,out double[] REFdata) + { + Focas1.ODBAXIS odb = new Focas1.ODBAXIS(); + REFdata = new double[AxisNumber]; + for (short i = 0; i < Convert.ToInt32(AxisNumber); i++) + { + ret = Focas1.cnc_machine(Flibhndl, (short)(i + 1), 8, odb); + REFdata[i] = odb.data[0] * Math.Pow(10, -3); + } + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 获取机床绝对坐标 + /// + public bool AbsAxis(int AxisNumber, out double[] REFdata) + { + Focas1.ODBAXIS odb = new Focas1.ODBAXIS(); + REFdata = new double[AxisNumber]; + + for (short i = 0; i < Convert.ToInt32(AxisNumber); i++) + { + ret = Focas1.cnc_absolute(Flibhndl, (short)(i + 1), 8, odb); + REFdata[i] = odb.data[0] * Math.Pow(10, -3); + } + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 获取机床相对坐标 + /// + public bool RelAxis(int AxisNumber, out double[] REFdata) + { + Focas1.ODBAXIS odb = new Focas1.ODBAXIS(); + REFdata = new double[AxisNumber]; + + for (short i = 0; i < Convert.ToInt32(AxisNumber); i++) + { + ret = Focas1.cnc_relative(Flibhndl, (short)(i + 1), 8, odb); + REFdata[i] = odb.data[0] * Math.Pow(10, -3); + } + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 获取机床相对坐标 + /// + public bool DisAxis(int AxisNumber, out double[] REFdata) + { + Focas1.ODBAXIS odb = new Focas1.ODBAXIS(); + REFdata = new double[AxisNumber]; + + for (short i = 0; i < Convert.ToInt32(AxisNumber); i++) + { + ret = Focas1.cnc_distance(Flibhndl, (short)(i + 1), 8, odb); + REFdata[i] = odb.data[0] * Math.Pow(10, -3); + } + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + /// + /// 读取宏变量的值 + /// + /// + /// + public bool cnc_rdmacro(short number, short length, out double data) + { + Focas1.ODBM macro = new Focas1.ODBM(); + ret = Focas1.cnc_rdmacro(Flibhndl, number, length, macro); + data = macro.mcr_val * Math.Pow(10, -macro.dec_val); + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + public bool pmc_rdpmcinfo(string _snumber, string _enumber, string _type, string _dataType, string _length + , out Focas1.IODBPMC0 pmcdata1) + { + pmcdata1 = new Focas1.IODBPMC0(); // for 1 Byte + ushort snumber = ushort.Parse(_snumber); + ushort enumber = ushort.Parse(_enumber); + short type = short.Parse(_type); + short dataType = short.Parse(_dataType); + ushort length = ushort.Parse(_length); + ret = Focas1.pmc_rdpmcrng(Flibhndl, type, dataType, snumber, enumber, length, pmcdata1); // R data of 1 Byte + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + public bool ReadCNC(DataType_PMC dataType_PMC,string 变量地址, string 变量其它, int TagLong, EnumTagTypeID TagTypeID, out object value) + { + value = "-1"; + + short type = (short)dataType_PMC; + ushort snumber = ushort.Parse(变量地址); + ushort enumber = ushort.Parse(变量地址); + int.TryParse(变量其它,out int _变量其它); + ushort length = 9; + int N = TagLong; + + switch (TagTypeID) + { + case EnumTagTypeID.INT16: + length = (ushort)(8 + N * 2); + break; + case EnumTagTypeID.INT32: + length = (ushort)(8 + N * 4); + break; + case EnumTagTypeID.FLOAT: + break; + case EnumTagTypeID.UINT64: + break; + case EnumTagTypeID.STRING: + break; + case EnumTagTypeID.BOOL: + /* + data_type is 0(byte type) : length = 8 + N + data_type is 1(word type) : length = 8 + N × 2 + data_type is 2(long type) : length = 8 + N × 4 + */ + length = (ushort)(8 + N); + short dataType = 0; + var pmcdata1 = new Focas1.IODBPMC0(); + ret = Focas1.pmc_rdpmcrng(Flibhndl, type, dataType, snumber, enumber, length, pmcdata1); + var array = Focas1.ToBoolArray(new byte[] { pmcdata1.cdata[0] }); + value = array[_变量其它]; + break; + case EnumTagTypeID.BYTE: + break; + case EnumTagTypeID.UINT16: + length = (ushort)(8 + N * 2); + break; + case EnumTagTypeID.DOUBLE: + length = 100; + var macro = new Focas1.ODBM(); + ret = Focas1.cnc_rdmacro(Flibhndl, (short)snumber, (short)length, macro); + value = macro.mcr_val * Math.Pow(10, -macro.dec_val); + break; + case EnumTagTypeID.BYTES: + break; + default: + break; + } + + return ret == (short)Focas1.focas_ret.EW_OK; + } + + + public void cnc_rdexecprog(string prgname,out string progContent) + { + //short type = 0; + //short length = 12; + //Focas1.ODBNC_1 prginfo = new Focas1.ODBNC_1(); + //ret = Focas1.cnc_rdproginfo(Flibhndl, type, length, prginfo); + + progContent = ""; + byte[] buf = new byte[1280]; // String of CNC program + int len; + ret = Focas1.cnc_upstart4(Flibhndl, 0, prgname);// "//CNC_MEM/USER/PATH1/prgname" + if (ret != Focas1.EW_OK) return; + do + { + len = 1280; + do + { + ret = Focas1.cnc_upload4(Flibhndl, ref len, buf); + } while (ret == 10); + + if (ret == Focas1.EW_OK) + { + for (int idx = 0; idx < len; idx++) progContent += Convert.ToString(Convert.ToChar(buf[idx])); + } + if (buf[len - 1] == '%') + { + break; + } + } while (ret == Focas1.EW_OK); + ret = Focas1.cnc_upend4(Flibhndl); + } + + +} + + +/* + 在发那科PMC中,有X点,Y点,F点,G.点,R点,E点,A点,C点和K点,以及T点,D点,L点,P点,下面介绍各自的含义。 + +X点为机床给PMC的输入信号(MT->PMC),其中PMC-SA1类型的范围为X0-X127。PMC-SB7类型的范围为X0-X127,X200-X327(注1),X1000-X1127(注1)。 + +Y点为PMC输出给机床的信号(PMC->MT),其中PMC-SA1类型的范围为Y0-Y127。PMC-SB7类型的范围为Y0-Y127,Y200-Y327(注1),Y1000-Y1127(注1)。 + +F点为NC给PMC的输入信号(NC->PMC),其中PMC-SA1类型的范围为F0-F255。PMC-SB7类型的范围为F0-F767(注2),F1000-F1767(注3),F2000-F2767(注3),Y3000-Y3767(注3)。 + +G.点为PMC输出给NC的信号(PMC->NC),其中PMC-SA1类型的范围为G0-G255。PMC-SB7类型的范围为G0-G767(注2),G1000-G1767(注3),G2000-G2767(注3),G3000-G3767(注3)。 + +R点为内部继电器,其中PMC-SA1类型的范围为R0-R999,R9000-R9099。PMC-SB7类型的范围为R0-R7999,R9000-R9499(注4)。 + +E点为外部继电器,其中PMC-SB7类型的范围为E0-E7999(注5)。 + +A点为信息显示请求/状态信号。A0-A24/-- A0-A249/A9000-A9249(注6)。 + +C点为计数器,其中PMC-SA1类型的范围为C0-C79。PMC-SB7类型的范围为C0-C399,C5000-C5199(注7)。 + +K点为保持继电器,其中PMC-SA1类型的范围为K0-K19,PMC-SB7类型的范围为K0-K99,K900-K919(注8)。 + +T点为可变定时器,其中PMC-SA1类型的范围为T0-T19,PMC-SB7类型的范围为T0-T499,T9000-T9499(注9)。 + +D点为数据表,其中PMC-SA1类型的范围为D0-D1859。PMC-SB7类型的范围为D0-D9999。 + +L点为标志号,在PMC-SB7类型中,范围为L1-L9999。 + +P点为子程序数,PMC-SA1中未使用,PMC-SB7中范围为P0-P2000。 + + */ +public enum DataType_PMC +{ + G = 0, + F = 1, + /// + /// bool + /// + Y = 2, + /// + /// bool + /// + X = 3, + A = 4, + R = 5, + T = 6, + /// + /// bool + /// + K = 7, + C = 8, + D = 9, + M = 10, + N = 11, + E = 12, + Z = 13, + /// + /// 宏变量 + /// + MACRO = 837 +} \ No newline at end of file diff --git a/DT_SCADA/F_RobotMonitor.Designer.cs b/DT_SCADA/F_RobotMonitor.Designer.cs new file mode 100644 index 0000000..722069a --- /dev/null +++ b/DT_SCADA/F_RobotMonitor.Designer.cs @@ -0,0 +1,1271 @@ +namespace DT_YQJF_DC_SLN +{ + partial class F_RobotMonitor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lb_Robot = new System.Windows.Forms.ListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.txt_J1 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txt_J2 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txt_J3 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.txt_J4 = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txt_J5 = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txt_J6 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txt_J7 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.txt_J8 = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.txt_J9 = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.txt_J10 = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.txt_J11 = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.txt_J12 = new System.Windows.Forms.TextBox(); + this.btn_Submit = new System.Windows.Forms.Button(); + this.txt_Set_J1 = new System.Windows.Forms.TextBox(); + this.txt_Set_J7 = new System.Windows.Forms.TextBox(); + this.txt_Set_J2 = new System.Windows.Forms.TextBox(); + this.txt_Set_J8 = new System.Windows.Forms.TextBox(); + this.txt_Set_J3 = new System.Windows.Forms.TextBox(); + this.txt_Set_J9 = new System.Windows.Forms.TextBox(); + this.txt_Set_J4 = new System.Windows.Forms.TextBox(); + this.txt_Set_J10 = new System.Windows.Forms.TextBox(); + this.txt_Set_J5 = new System.Windows.Forms.TextBox(); + this.txt_Set_J11 = new System.Windows.Forms.TextBox(); + this.txt_Set_J6 = new System.Windows.Forms.TextBox(); + this.txt_Set_J12 = new System.Windows.Forms.TextBox(); + this.panel_Debug_Txt = new System.Windows.Forms.Panel(); + this.panel_Debug_Btn = new System.Windows.Forms.Panel(); + this.btn_Fill_Joint = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.comboBox1_Axis_J1 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J12 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J11 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J10 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J9 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J8 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J7 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J6 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J5 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J4 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J3 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Axis_J2 = new System.Windows.Forms.ComboBox(); + this.panel2 = new System.Windows.Forms.Panel(); + this.comboBox1_Flip_J1 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J2 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J12 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J3 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J4 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J11 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J5 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J6 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J10 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J7 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J8 = new System.Windows.Forms.ComboBox(); + this.comboBox1_Flip_J9 = new System.Windows.Forms.ComboBox(); + this.panel3 = new System.Windows.Forms.Panel(); + this.numericUpDown_j12 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j11 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j10 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j9 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j8 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j7 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j6 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j5 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j4 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j3 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j2 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown_j1 = new System.Windows.Forms.NumericUpDown(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label19_currentId = new System.Windows.Forms.Label(); + this.button2save = new System.Windows.Forms.Button(); + this.label19_apply = new System.Windows.Forms.Label(); + this.txt_Detail = new System.Windows.Forms.TextBox(); + this.panel_Debug_Txt.SuspendLayout(); + this.panel_Debug_Btn.SuspendLayout(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j12)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j11)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j10)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j9)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j7)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j1)).BeginInit(); + this.SuspendLayout(); + // + // lb_Robot + // + this.lb_Robot.FormattingEnabled = true; + this.lb_Robot.ItemHeight = 12; + this.lb_Robot.Location = new System.Drawing.Point(12, 24); + this.lb_Robot.Name = "lb_Robot"; + this.lb_Robot.Size = new System.Drawing.Size(235, 700); + this.lb_Robot.TabIndex = 0; + this.lb_Robot.SelectedIndexChanged += new System.EventHandler(this.lb_Robot_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(275, 30); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 12); + this.label1.TabIndex = 1; + this.label1.Text = "关节1"; + // + // txt_J1 + // + this.txt_J1.Location = new System.Drawing.Point(326, 26); + this.txt_J1.Name = "txt_J1"; + this.txt_J1.ReadOnly = true; + this.txt_J1.Size = new System.Drawing.Size(81, 21); + this.txt_J1.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(275, 57); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 12); + this.label2.TabIndex = 1; + this.label2.Text = "关节2"; + // + // txt_J2 + // + this.txt_J2.Location = new System.Drawing.Point(326, 53); + this.txt_J2.Name = "txt_J2"; + this.txt_J2.ReadOnly = true; + this.txt_J2.Size = new System.Drawing.Size(81, 21); + this.txt_J2.TabIndex = 2; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(275, 84); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(35, 12); + this.label3.TabIndex = 1; + this.label3.Text = "关节3"; + // + // txt_J3 + // + this.txt_J3.Location = new System.Drawing.Point(326, 80); + this.txt_J3.Name = "txt_J3"; + this.txt_J3.ReadOnly = true; + this.txt_J3.Size = new System.Drawing.Size(81, 21); + this.txt_J3.TabIndex = 2; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(275, 111); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(35, 12); + this.label4.TabIndex = 1; + this.label4.Text = "关节4"; + // + // txt_J4 + // + this.txt_J4.Location = new System.Drawing.Point(326, 107); + this.txt_J4.Name = "txt_J4"; + this.txt_J4.ReadOnly = true; + this.txt_J4.Size = new System.Drawing.Size(81, 21); + this.txt_J4.TabIndex = 2; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(275, 139); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(35, 12); + this.label5.TabIndex = 1; + this.label5.Text = "关节5"; + // + // txt_J5 + // + this.txt_J5.Location = new System.Drawing.Point(326, 135); + this.txt_J5.Name = "txt_J5"; + this.txt_J5.ReadOnly = true; + this.txt_J5.Size = new System.Drawing.Size(81, 21); + this.txt_J5.TabIndex = 2; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(275, 166); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(35, 12); + this.label6.TabIndex = 1; + this.label6.Text = "关节6"; + // + // txt_J6 + // + this.txt_J6.Location = new System.Drawing.Point(326, 162); + this.txt_J6.Name = "txt_J6"; + this.txt_J6.ReadOnly = true; + this.txt_J6.Size = new System.Drawing.Size(81, 21); + this.txt_J6.TabIndex = 2; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(275, 212); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(35, 12); + this.label7.TabIndex = 1; + this.label7.Text = "关节7"; + // + // txt_J7 + // + this.txt_J7.Location = new System.Drawing.Point(326, 208); + this.txt_J7.Name = "txt_J7"; + this.txt_J7.ReadOnly = true; + this.txt_J7.Size = new System.Drawing.Size(81, 21); + this.txt_J7.TabIndex = 2; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(275, 239); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(35, 12); + this.label8.TabIndex = 1; + this.label8.Text = "关节8"; + // + // txt_J8 + // + this.txt_J8.Location = new System.Drawing.Point(326, 235); + this.txt_J8.Name = "txt_J8"; + this.txt_J8.ReadOnly = true; + this.txt_J8.Size = new System.Drawing.Size(81, 21); + this.txt_J8.TabIndex = 2; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(275, 266); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(35, 12); + this.label9.TabIndex = 1; + this.label9.Text = "关节9"; + // + // txt_J9 + // + this.txt_J9.Location = new System.Drawing.Point(326, 262); + this.txt_J9.Name = "txt_J9"; + this.txt_J9.ReadOnly = true; + this.txt_J9.Size = new System.Drawing.Size(81, 21); + this.txt_J9.TabIndex = 2; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(275, 293); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(41, 12); + this.label10.TabIndex = 1; + this.label10.Text = "关节10"; + // + // txt_J10 + // + this.txt_J10.Location = new System.Drawing.Point(326, 289); + this.txt_J10.Name = "txt_J10"; + this.txt_J10.ReadOnly = true; + this.txt_J10.Size = new System.Drawing.Size(81, 21); + this.txt_J10.TabIndex = 2; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(275, 321); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(41, 12); + this.label11.TabIndex = 1; + this.label11.Text = "关节11"; + // + // txt_J11 + // + this.txt_J11.Location = new System.Drawing.Point(326, 317); + this.txt_J11.Name = "txt_J11"; + this.txt_J11.ReadOnly = true; + this.txt_J11.Size = new System.Drawing.Size(81, 21); + this.txt_J11.TabIndex = 2; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(275, 348); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(41, 12); + this.label12.TabIndex = 1; + this.label12.Text = "关节12"; + // + // txt_J12 + // + this.txt_J12.Location = new System.Drawing.Point(326, 344); + this.txt_J12.Name = "txt_J12"; + this.txt_J12.ReadOnly = true; + this.txt_J12.Size = new System.Drawing.Size(81, 21); + this.txt_J12.TabIndex = 2; + // + // btn_Submit + // + this.btn_Submit.Location = new System.Drawing.Point(128, 3); + this.btn_Submit.Name = "btn_Submit"; + this.btn_Submit.Size = new System.Drawing.Size(116, 37); + this.btn_Submit.TabIndex = 3; + this.btn_Submit.Text = "测试值提交"; + this.btn_Submit.UseVisualStyleBackColor = true; + this.btn_Submit.Click += new System.EventHandler(this.btn_Submit_Click); + // + // txt_Set_J1 + // + this.txt_Set_J1.Location = new System.Drawing.Point(13, 6); + this.txt_Set_J1.Name = "txt_Set_J1"; + this.txt_Set_J1.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J1.TabIndex = 2; + // + // txt_Set_J7 + // + this.txt_Set_J7.Location = new System.Drawing.Point(13, 188); + this.txt_Set_J7.Name = "txt_Set_J7"; + this.txt_Set_J7.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J7.TabIndex = 2; + // + // txt_Set_J2 + // + this.txt_Set_J2.Location = new System.Drawing.Point(13, 33); + this.txt_Set_J2.Name = "txt_Set_J2"; + this.txt_Set_J2.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J2.TabIndex = 2; + // + // txt_Set_J8 + // + this.txt_Set_J8.Location = new System.Drawing.Point(13, 215); + this.txt_Set_J8.Name = "txt_Set_J8"; + this.txt_Set_J8.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J8.TabIndex = 2; + // + // txt_Set_J3 + // + this.txt_Set_J3.Location = new System.Drawing.Point(13, 60); + this.txt_Set_J3.Name = "txt_Set_J3"; + this.txt_Set_J3.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J3.TabIndex = 2; + // + // txt_Set_J9 + // + this.txt_Set_J9.Location = new System.Drawing.Point(13, 242); + this.txt_Set_J9.Name = "txt_Set_J9"; + this.txt_Set_J9.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J9.TabIndex = 2; + // + // txt_Set_J4 + // + this.txt_Set_J4.Location = new System.Drawing.Point(13, 87); + this.txt_Set_J4.Name = "txt_Set_J4"; + this.txt_Set_J4.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J4.TabIndex = 2; + // + // txt_Set_J10 + // + this.txt_Set_J10.Location = new System.Drawing.Point(13, 269); + this.txt_Set_J10.Name = "txt_Set_J10"; + this.txt_Set_J10.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J10.TabIndex = 2; + // + // txt_Set_J5 + // + this.txt_Set_J5.Location = new System.Drawing.Point(13, 115); + this.txt_Set_J5.Name = "txt_Set_J5"; + this.txt_Set_J5.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J5.TabIndex = 2; + // + // txt_Set_J11 + // + this.txt_Set_J11.Location = new System.Drawing.Point(13, 297); + this.txt_Set_J11.Name = "txt_Set_J11"; + this.txt_Set_J11.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J11.TabIndex = 2; + // + // txt_Set_J6 + // + this.txt_Set_J6.Location = new System.Drawing.Point(13, 142); + this.txt_Set_J6.Name = "txt_Set_J6"; + this.txt_Set_J6.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J6.TabIndex = 2; + // + // txt_Set_J12 + // + this.txt_Set_J12.Location = new System.Drawing.Point(13, 324); + this.txt_Set_J12.Name = "txt_Set_J12"; + this.txt_Set_J12.Size = new System.Drawing.Size(87, 21); + this.txt_Set_J12.TabIndex = 2; + // + // panel_Debug_Txt + // + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J1); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J7); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J12); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J2); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J8); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J3); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J6); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J9); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J4); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J11); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J10); + this.panel_Debug_Txt.Controls.Add(this.txt_Set_J5); + this.panel_Debug_Txt.Location = new System.Drawing.Point(411, 21); + this.panel_Debug_Txt.Name = "panel_Debug_Txt"; + this.panel_Debug_Txt.Size = new System.Drawing.Size(105, 351); + this.panel_Debug_Txt.TabIndex = 4; + // + // panel_Debug_Btn + // + this.panel_Debug_Btn.Controls.Add(this.btn_Fill_Joint); + this.panel_Debug_Btn.Controls.Add(this.btn_Submit); + this.panel_Debug_Btn.Location = new System.Drawing.Point(270, 371); + this.panel_Debug_Btn.Name = "panel_Debug_Btn"; + this.panel_Debug_Btn.Size = new System.Drawing.Size(249, 44); + this.panel_Debug_Btn.TabIndex = 5; + // + // btn_Fill_Joint + // + this.btn_Fill_Joint.Location = new System.Drawing.Point(7, 3); + this.btn_Fill_Joint.Name = "btn_Fill_Joint"; + this.btn_Fill_Joint.Size = new System.Drawing.Size(116, 37); + this.btn_Fill_Joint.TabIndex = 3; + this.btn_Fill_Joint.Text = "填充值"; + this.btn_Fill_Joint.UseVisualStyleBackColor = true; + this.btn_Fill_Joint.Click += new System.EventHandler(this.btn_Fill_Joint_Click); + // + // panel1 + // + this.panel1.Controls.Add(this.comboBox1_Axis_J1); + this.panel1.Controls.Add(this.comboBox1_Axis_J12); + this.panel1.Controls.Add(this.comboBox1_Axis_J11); + this.panel1.Controls.Add(this.comboBox1_Axis_J10); + this.panel1.Controls.Add(this.comboBox1_Axis_J9); + this.panel1.Controls.Add(this.comboBox1_Axis_J8); + this.panel1.Controls.Add(this.comboBox1_Axis_J7); + this.panel1.Controls.Add(this.comboBox1_Axis_J6); + this.panel1.Controls.Add(this.comboBox1_Axis_J5); + this.panel1.Controls.Add(this.comboBox1_Axis_J4); + this.panel1.Controls.Add(this.comboBox1_Axis_J3); + this.panel1.Controls.Add(this.comboBox1_Axis_J2); + this.panel1.Location = new System.Drawing.Point(564, 21); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(87, 351); + this.panel1.TabIndex = 5; + // + // comboBox1_Axis_J1 + // + this.comboBox1_Axis_J1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J1.FormattingEnabled = true; + this.comboBox1_Axis_J1.Location = new System.Drawing.Point(2, 6); + this.comboBox1_Axis_J1.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J1.Name = "comboBox1_Axis_J1"; + this.comboBox1_Axis_J1.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J1.TabIndex = 7; + // + // comboBox1_Axis_J12 + // + this.comboBox1_Axis_J12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J12.FormattingEnabled = true; + this.comboBox1_Axis_J12.Location = new System.Drawing.Point(2, 325); + this.comboBox1_Axis_J12.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J12.Name = "comboBox1_Axis_J12"; + this.comboBox1_Axis_J12.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J12.TabIndex = 7; + // + // comboBox1_Axis_J11 + // + this.comboBox1_Axis_J11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J11.FormattingEnabled = true; + this.comboBox1_Axis_J11.Location = new System.Drawing.Point(2, 296); + this.comboBox1_Axis_J11.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J11.Name = "comboBox1_Axis_J11"; + this.comboBox1_Axis_J11.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J11.TabIndex = 7; + // + // comboBox1_Axis_J10 + // + this.comboBox1_Axis_J10.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J10.FormattingEnabled = true; + this.comboBox1_Axis_J10.Location = new System.Drawing.Point(2, 269); + this.comboBox1_Axis_J10.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J10.Name = "comboBox1_Axis_J10"; + this.comboBox1_Axis_J10.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J10.TabIndex = 7; + // + // comboBox1_Axis_J9 + // + this.comboBox1_Axis_J9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J9.FormattingEnabled = true; + this.comboBox1_Axis_J9.Location = new System.Drawing.Point(2, 245); + this.comboBox1_Axis_J9.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J9.Name = "comboBox1_Axis_J9"; + this.comboBox1_Axis_J9.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J9.TabIndex = 7; + // + // comboBox1_Axis_J8 + // + this.comboBox1_Axis_J8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J8.FormattingEnabled = true; + this.comboBox1_Axis_J8.Location = new System.Drawing.Point(2, 216); + this.comboBox1_Axis_J8.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J8.Name = "comboBox1_Axis_J8"; + this.comboBox1_Axis_J8.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J8.TabIndex = 7; + // + // comboBox1_Axis_J7 + // + this.comboBox1_Axis_J7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J7.FormattingEnabled = true; + this.comboBox1_Axis_J7.Location = new System.Drawing.Point(2, 187); + this.comboBox1_Axis_J7.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J7.Name = "comboBox1_Axis_J7"; + this.comboBox1_Axis_J7.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J7.TabIndex = 7; + // + // comboBox1_Axis_J6 + // + this.comboBox1_Axis_J6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J6.FormattingEnabled = true; + this.comboBox1_Axis_J6.Location = new System.Drawing.Point(2, 143); + this.comboBox1_Axis_J6.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J6.Name = "comboBox1_Axis_J6"; + this.comboBox1_Axis_J6.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J6.TabIndex = 7; + // + // comboBox1_Axis_J5 + // + this.comboBox1_Axis_J5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J5.FormattingEnabled = true; + this.comboBox1_Axis_J5.Location = new System.Drawing.Point(2, 113); + this.comboBox1_Axis_J5.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J5.Name = "comboBox1_Axis_J5"; + this.comboBox1_Axis_J5.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J5.TabIndex = 7; + // + // comboBox1_Axis_J4 + // + this.comboBox1_Axis_J4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J4.FormattingEnabled = true; + this.comboBox1_Axis_J4.Location = new System.Drawing.Point(2, 85); + this.comboBox1_Axis_J4.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J4.Name = "comboBox1_Axis_J4"; + this.comboBox1_Axis_J4.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J4.TabIndex = 7; + // + // comboBox1_Axis_J3 + // + this.comboBox1_Axis_J3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J3.FormattingEnabled = true; + this.comboBox1_Axis_J3.Location = new System.Drawing.Point(2, 59); + this.comboBox1_Axis_J3.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J3.Name = "comboBox1_Axis_J3"; + this.comboBox1_Axis_J3.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J3.TabIndex = 7; + // + // comboBox1_Axis_J2 + // + this.comboBox1_Axis_J2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Axis_J2.FormattingEnabled = true; + this.comboBox1_Axis_J2.Location = new System.Drawing.Point(2, 31); + this.comboBox1_Axis_J2.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Axis_J2.Name = "comboBox1_Axis_J2"; + this.comboBox1_Axis_J2.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Axis_J2.TabIndex = 7; + // + // panel2 + // + this.panel2.Controls.Add(this.comboBox1_Flip_J1); + this.panel2.Controls.Add(this.comboBox1_Flip_J2); + this.panel2.Controls.Add(this.comboBox1_Flip_J12); + this.panel2.Controls.Add(this.comboBox1_Flip_J3); + this.panel2.Controls.Add(this.comboBox1_Flip_J4); + this.panel2.Controls.Add(this.comboBox1_Flip_J11); + this.panel2.Controls.Add(this.comboBox1_Flip_J5); + this.panel2.Controls.Add(this.comboBox1_Flip_J6); + this.panel2.Controls.Add(this.comboBox1_Flip_J10); + this.panel2.Controls.Add(this.comboBox1_Flip_J7); + this.panel2.Controls.Add(this.comboBox1_Flip_J8); + this.panel2.Controls.Add(this.comboBox1_Flip_J9); + this.panel2.Location = new System.Drawing.Point(657, 21); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(88, 351); + this.panel2.TabIndex = 5; + // + // comboBox1_Flip_J1 + // + this.comboBox1_Flip_J1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J1.FormattingEnabled = true; + this.comboBox1_Flip_J1.Location = new System.Drawing.Point(5, 5); + this.comboBox1_Flip_J1.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J1.Name = "comboBox1_Flip_J1"; + this.comboBox1_Flip_J1.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J1.TabIndex = 8; + // + // comboBox1_Flip_J2 + // + this.comboBox1_Flip_J2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J2.FormattingEnabled = true; + this.comboBox1_Flip_J2.Location = new System.Drawing.Point(5, 29); + this.comboBox1_Flip_J2.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J2.Name = "comboBox1_Flip_J2"; + this.comboBox1_Flip_J2.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J2.TabIndex = 19; + // + // comboBox1_Flip_J12 + // + this.comboBox1_Flip_J12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J12.FormattingEnabled = true; + this.comboBox1_Flip_J12.Location = new System.Drawing.Point(5, 323); + this.comboBox1_Flip_J12.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J12.Name = "comboBox1_Flip_J12"; + this.comboBox1_Flip_J12.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J12.TabIndex = 9; + // + // comboBox1_Flip_J3 + // + this.comboBox1_Flip_J3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J3.FormattingEnabled = true; + this.comboBox1_Flip_J3.Location = new System.Drawing.Point(5, 57); + this.comboBox1_Flip_J3.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J3.Name = "comboBox1_Flip_J3"; + this.comboBox1_Flip_J3.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J3.TabIndex = 18; + // + // comboBox1_Flip_J4 + // + this.comboBox1_Flip_J4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J4.FormattingEnabled = true; + this.comboBox1_Flip_J4.Location = new System.Drawing.Point(5, 84); + this.comboBox1_Flip_J4.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J4.Name = "comboBox1_Flip_J4"; + this.comboBox1_Flip_J4.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J4.TabIndex = 17; + // + // comboBox1_Flip_J11 + // + this.comboBox1_Flip_J11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J11.FormattingEnabled = true; + this.comboBox1_Flip_J11.Location = new System.Drawing.Point(5, 295); + this.comboBox1_Flip_J11.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J11.Name = "comboBox1_Flip_J11"; + this.comboBox1_Flip_J11.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J11.TabIndex = 10; + // + // comboBox1_Flip_J5 + // + this.comboBox1_Flip_J5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J5.FormattingEnabled = true; + this.comboBox1_Flip_J5.Location = new System.Drawing.Point(5, 112); + this.comboBox1_Flip_J5.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J5.Name = "comboBox1_Flip_J5"; + this.comboBox1_Flip_J5.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J5.TabIndex = 16; + // + // comboBox1_Flip_J6 + // + this.comboBox1_Flip_J6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J6.FormattingEnabled = true; + this.comboBox1_Flip_J6.Location = new System.Drawing.Point(5, 142); + this.comboBox1_Flip_J6.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J6.Name = "comboBox1_Flip_J6"; + this.comboBox1_Flip_J6.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J6.TabIndex = 15; + // + // comboBox1_Flip_J10 + // + this.comboBox1_Flip_J10.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J10.FormattingEnabled = true; + this.comboBox1_Flip_J10.Location = new System.Drawing.Point(5, 268); + this.comboBox1_Flip_J10.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J10.Name = "comboBox1_Flip_J10"; + this.comboBox1_Flip_J10.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J10.TabIndex = 11; + // + // comboBox1_Flip_J7 + // + this.comboBox1_Flip_J7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J7.FormattingEnabled = true; + this.comboBox1_Flip_J7.Location = new System.Drawing.Point(5, 185); + this.comboBox1_Flip_J7.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J7.Name = "comboBox1_Flip_J7"; + this.comboBox1_Flip_J7.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J7.TabIndex = 14; + // + // comboBox1_Flip_J8 + // + this.comboBox1_Flip_J8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J8.FormattingEnabled = true; + this.comboBox1_Flip_J8.Location = new System.Drawing.Point(5, 215); + this.comboBox1_Flip_J8.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J8.Name = "comboBox1_Flip_J8"; + this.comboBox1_Flip_J8.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J8.TabIndex = 13; + // + // comboBox1_Flip_J9 + // + this.comboBox1_Flip_J9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1_Flip_J9.FormattingEnabled = true; + this.comboBox1_Flip_J9.Location = new System.Drawing.Point(5, 243); + this.comboBox1_Flip_J9.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1_Flip_J9.Name = "comboBox1_Flip_J9"; + this.comboBox1_Flip_J9.Size = new System.Drawing.Size(82, 20); + this.comboBox1_Flip_J9.TabIndex = 12; + // + // panel3 + // + this.panel3.Controls.Add(this.numericUpDown_j12); + this.panel3.Controls.Add(this.numericUpDown_j11); + this.panel3.Controls.Add(this.numericUpDown_j10); + this.panel3.Controls.Add(this.numericUpDown_j9); + this.panel3.Controls.Add(this.numericUpDown_j8); + this.panel3.Controls.Add(this.numericUpDown_j7); + this.panel3.Controls.Add(this.numericUpDown_j6); + this.panel3.Controls.Add(this.numericUpDown_j5); + this.panel3.Controls.Add(this.numericUpDown_j4); + this.panel3.Controls.Add(this.numericUpDown_j3); + this.panel3.Controls.Add(this.numericUpDown_j2); + this.panel3.Controls.Add(this.numericUpDown_j1); + this.panel3.Location = new System.Drawing.Point(757, 21); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(99, 351); + this.panel3.TabIndex = 6; + // + // numericUpDown_j12 + // + this.numericUpDown_j12.Location = new System.Drawing.Point(2, 323); + this.numericUpDown_j12.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j12.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j12.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j12.Name = "numericUpDown_j12"; + this.numericUpDown_j12.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j12.TabIndex = 7; + // + // numericUpDown_j11 + // + this.numericUpDown_j11.Location = new System.Drawing.Point(2, 293); + this.numericUpDown_j11.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j11.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j11.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j11.Name = "numericUpDown_j11"; + this.numericUpDown_j11.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j11.TabIndex = 7; + // + // numericUpDown_j10 + // + this.numericUpDown_j10.Location = new System.Drawing.Point(2, 267); + this.numericUpDown_j10.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j10.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j10.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j10.Name = "numericUpDown_j10"; + this.numericUpDown_j10.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j10.TabIndex = 7; + // + // numericUpDown_j9 + // + this.numericUpDown_j9.Location = new System.Drawing.Point(2, 243); + this.numericUpDown_j9.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j9.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j9.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j9.Name = "numericUpDown_j9"; + this.numericUpDown_j9.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j9.TabIndex = 7; + // + // numericUpDown_j8 + // + this.numericUpDown_j8.Location = new System.Drawing.Point(2, 213); + this.numericUpDown_j8.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j8.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j8.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j8.Name = "numericUpDown_j8"; + this.numericUpDown_j8.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j8.TabIndex = 7; + // + // numericUpDown_j7 + // + this.numericUpDown_j7.Location = new System.Drawing.Point(2, 184); + this.numericUpDown_j7.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j7.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j7.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j7.Name = "numericUpDown_j7"; + this.numericUpDown_j7.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j7.TabIndex = 7; + // + // numericUpDown_j6 + // + this.numericUpDown_j6.Location = new System.Drawing.Point(2, 141); + this.numericUpDown_j6.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j6.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j6.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j6.Name = "numericUpDown_j6"; + this.numericUpDown_j6.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j6.TabIndex = 7; + // + // numericUpDown_j5 + // + this.numericUpDown_j5.Location = new System.Drawing.Point(2, 111); + this.numericUpDown_j5.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j5.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j5.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j5.Name = "numericUpDown_j5"; + this.numericUpDown_j5.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j5.TabIndex = 7; + // + // numericUpDown_j4 + // + this.numericUpDown_j4.Location = new System.Drawing.Point(2, 84); + this.numericUpDown_j4.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j4.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j4.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j4.Name = "numericUpDown_j4"; + this.numericUpDown_j4.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j4.TabIndex = 7; + // + // numericUpDown_j3 + // + this.numericUpDown_j3.Location = new System.Drawing.Point(2, 56); + this.numericUpDown_j3.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j3.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j3.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j3.Name = "numericUpDown_j3"; + this.numericUpDown_j3.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j3.TabIndex = 7; + // + // numericUpDown_j2 + // + this.numericUpDown_j2.Location = new System.Drawing.Point(2, 28); + this.numericUpDown_j2.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j2.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j2.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j2.Name = "numericUpDown_j2"; + this.numericUpDown_j2.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j2.TabIndex = 7; + // + // numericUpDown_j1 + // + this.numericUpDown_j1.Location = new System.Drawing.Point(2, 5); + this.numericUpDown_j1.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown_j1.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown_j1.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + -2147483648}); + this.numericUpDown_j1.Name = "numericUpDown_j1"; + this.numericUpDown_j1.Size = new System.Drawing.Size(80, 21); + this.numericUpDown_j1.TabIndex = 7; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(464, 6); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(41, 12); + this.label13.TabIndex = 1; + this.label13.Text = "测试值"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(590, 6); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(41, 12); + this.label14.TabIndex = 1; + this.label14.Text = "轴方向"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(687, 6); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(29, 12); + this.label15.TabIndex = 1; + this.label15.Text = "方向"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(782, 6); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(29, 12); + this.label16.TabIndex = 1; + this.label16.Text = "差值"; + // + // button1 + // + this.button1.Enabled = false; + this.button1.Location = new System.Drawing.Point(657, 377); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(88, 37); + this.button1.TabIndex = 3; + this.button1.Text = "应用"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(352, 6); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(41, 12); + this.label17.TabIndex = 1; + this.label17.Text = "采集值"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(12, 7); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(77, 12); + this.label18.TabIndex = 1; + this.label18.Text = "当前机器人Id"; + // + // label19_currentId + // + this.label19_currentId.AutoSize = true; + this.label19_currentId.Location = new System.Drawing.Point(94, 7); + this.label19_currentId.Name = "label19_currentId"; + this.label19_currentId.Size = new System.Drawing.Size(11, 12); + this.label19_currentId.TabIndex = 1; + this.label19_currentId.Text = "."; + // + // button2save + // + this.button2save.Enabled = false; + this.button2save.Location = new System.Drawing.Point(759, 378); + this.button2save.Name = "button2save"; + this.button2save.Size = new System.Drawing.Size(88, 37); + this.button2save.TabIndex = 3; + this.button2save.Text = "保存"; + this.button2save.UseVisualStyleBackColor = true; + this.button2save.Click += new System.EventHandler(this.button2save_Click); + // + // label19_apply + // + this.label19_apply.AutoSize = true; + this.label19_apply.Location = new System.Drawing.Point(550, 386); + this.label19_apply.Name = "label19_apply"; + this.label19_apply.Size = new System.Drawing.Size(0, 12); + this.label19_apply.TabIndex = 1; + // + // txt_Detail + // + this.txt_Detail.Location = new System.Drawing.Point(873, 12); + this.txt_Detail.Multiline = true; + this.txt_Detail.Name = "txt_Detail"; + this.txt_Detail.ReadOnly = true; + this.txt_Detail.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.txt_Detail.Size = new System.Drawing.Size(410, 711); + this.txt_Detail.TabIndex = 7; + // + // F_RobotMonitor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1300, 735); + this.Controls.Add(this.txt_Detail); + this.Controls.Add(this.panel3); + this.Controls.Add(this.button2save); + this.Controls.Add(this.button1); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel_Debug_Btn); + this.Controls.Add(this.panel_Debug_Txt); + this.Controls.Add(this.txt_J12); + this.Controls.Add(this.label12); + this.Controls.Add(this.txt_J6); + this.Controls.Add(this.txt_J11); + this.Controls.Add(this.label6); + this.Controls.Add(this.label11); + this.Controls.Add(this.txt_J5); + this.Controls.Add(this.txt_J10); + this.Controls.Add(this.label5); + this.Controls.Add(this.label10); + this.Controls.Add(this.txt_J4); + this.Controls.Add(this.txt_J9); + this.Controls.Add(this.label4); + this.Controls.Add(this.label9); + this.Controls.Add(this.txt_J3); + this.Controls.Add(this.txt_J8); + this.Controls.Add(this.label3); + this.Controls.Add(this.label8); + this.Controls.Add(this.txt_J2); + this.Controls.Add(this.txt_J7); + this.Controls.Add(this.label2); + this.Controls.Add(this.label7); + this.Controls.Add(this.txt_J1); + this.Controls.Add(this.label16); + this.Controls.Add(this.label15); + this.Controls.Add(this.label14); + this.Controls.Add(this.label19_apply); + this.Controls.Add(this.label19_currentId); + this.Controls.Add(this.label18); + this.Controls.Add(this.label17); + this.Controls.Add(this.label13); + this.Controls.Add(this.label1); + this.Controls.Add(this.lb_Robot); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "F_RobotMonitor"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "机器人监控"; + this.panel_Debug_Txt.ResumeLayout(false); + this.panel_Debug_Txt.PerformLayout(); + this.panel_Debug_Btn.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.panel3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j12)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j11)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j10)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j9)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j7)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_j1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ListBox lb_Robot; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txt_J1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txt_J2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txt_J3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txt_J4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txt_J5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txt_J6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txt_J7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox txt_J8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox txt_J9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox txt_J10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox txt_J11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox txt_J12; + private System.Windows.Forms.Button btn_Submit; + private System.Windows.Forms.TextBox txt_Set_J1; + private System.Windows.Forms.TextBox txt_Set_J7; + private System.Windows.Forms.TextBox txt_Set_J2; + private System.Windows.Forms.TextBox txt_Set_J8; + private System.Windows.Forms.TextBox txt_Set_J3; + private System.Windows.Forms.TextBox txt_Set_J9; + private System.Windows.Forms.TextBox txt_Set_J4; + private System.Windows.Forms.TextBox txt_Set_J10; + private System.Windows.Forms.TextBox txt_Set_J5; + private System.Windows.Forms.TextBox txt_Set_J11; + private System.Windows.Forms.TextBox txt_Set_J6; + private System.Windows.Forms.TextBox txt_Set_J12; + private System.Windows.Forms.Panel panel_Debug_Txt; + private System.Windows.Forms.Panel panel_Debug_Btn; + private System.Windows.Forms.Button btn_Fill_Joint; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.ComboBox comboBox1_Axis_J1; + private System.Windows.Forms.ComboBox comboBox1_Axis_J2; + private System.Windows.Forms.ComboBox comboBox1_Axis_J12; + private System.Windows.Forms.ComboBox comboBox1_Axis_J11; + private System.Windows.Forms.ComboBox comboBox1_Axis_J10; + private System.Windows.Forms.ComboBox comboBox1_Axis_J9; + private System.Windows.Forms.ComboBox comboBox1_Axis_J8; + private System.Windows.Forms.ComboBox comboBox1_Axis_J7; + private System.Windows.Forms.ComboBox comboBox1_Axis_J6; + private System.Windows.Forms.ComboBox comboBox1_Axis_J5; + private System.Windows.Forms.ComboBox comboBox1_Axis_J4; + private System.Windows.Forms.ComboBox comboBox1_Axis_J3; + private System.Windows.Forms.ComboBox comboBox1_Flip_J1; + private System.Windows.Forms.ComboBox comboBox1_Flip_J2; + private System.Windows.Forms.ComboBox comboBox1_Flip_J12; + private System.Windows.Forms.ComboBox comboBox1_Flip_J3; + private System.Windows.Forms.ComboBox comboBox1_Flip_J4; + private System.Windows.Forms.ComboBox comboBox1_Flip_J11; + private System.Windows.Forms.ComboBox comboBox1_Flip_J5; + private System.Windows.Forms.ComboBox comboBox1_Flip_J6; + private System.Windows.Forms.ComboBox comboBox1_Flip_J10; + private System.Windows.Forms.ComboBox comboBox1_Flip_J7; + private System.Windows.Forms.ComboBox comboBox1_Flip_J8; + private System.Windows.Forms.ComboBox comboBox1_Flip_J9; + private System.Windows.Forms.NumericUpDown numericUpDown_j12; + private System.Windows.Forms.NumericUpDown numericUpDown_j11; + private System.Windows.Forms.NumericUpDown numericUpDown_j10; + private System.Windows.Forms.NumericUpDown numericUpDown_j9; + private System.Windows.Forms.NumericUpDown numericUpDown_j8; + private System.Windows.Forms.NumericUpDown numericUpDown_j7; + private System.Windows.Forms.NumericUpDown numericUpDown_j6; + private System.Windows.Forms.NumericUpDown numericUpDown_j5; + private System.Windows.Forms.NumericUpDown numericUpDown_j4; + private System.Windows.Forms.NumericUpDown numericUpDown_j3; + private System.Windows.Forms.NumericUpDown numericUpDown_j2; + private System.Windows.Forms.NumericUpDown numericUpDown_j1; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19_currentId; + private System.Windows.Forms.Button button2save; + private System.Windows.Forms.Label label19_apply; + private System.Windows.Forms.TextBox txt_Detail; + } +} \ No newline at end of file diff --git a/DT_SCADA/F_RobotMonitor.cs b/DT_SCADA/F_RobotMonitor.cs new file mode 100644 index 0000000..ec3fad4 --- /dev/null +++ b/DT_SCADA/F_RobotMonitor.cs @@ -0,0 +1,346 @@ +using MesWork; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DT_YQJF_DC_SLN +{ + public partial class F_RobotMonitor : Form + { + /// + /// + /// + public string Curr_RobotKey = ""; + public string Curr_RobotId = ""; + string[] AxisString = new string[] { "x", "y", "z" }; + string[] FilpString = new string[] { "1", "-1" }; + /// + /// + /// + List jointsCurrent = new List(); + List diyJoint = new List(); + + public F_RobotMonitor() + { + InitializeComponent(); + InitComBoxVale(); + foreach (var item in MesWorkForm.dc_Robot.Keys) + { + lb_Robot.Items.Add(item); + } + + if (MesWorkForm.IsDemoMesServer == 1) + { + panel_Debug_Btn.Visible = true; + panel_Debug_Txt.Visible = true; + } + else + { + panel_Debug_Btn.Visible = false; + panel_Debug_Txt.Visible = false; + } + } + /// + /// + /// + /// + /// + private void lb_Robot_SelectedIndexChanged(object sender, EventArgs e) + { + + label19_currentId.Text = ""; + Curr_RobotId = ""; + var selectedItem = lb_Robot.SelectedItem; + if (selectedItem == null) + { + return; + } + + + + jointsCurrent = new List(); + Curr_RobotKey = selectedItem.ToString(); + GetRobot(Curr_RobotKey, out string type, out string robotCode, out object robotObj); + double[] j = null; + + switch (type.ToUpper()) + { + case "ROBOTFANUC": + var fanuc = (B_Robot_Fanuc)robotObj; + j = fanuc.j; + label19_currentId.Text = fanuc.Id; + Curr_RobotId = fanuc.Id; + break; + case "ROBOTKUKA": + var kuka = (B_Robot_Kuka)robotObj; + jointsCurrent = kuka.Joints; + label19_currentId.Text = kuka.Id; + Curr_RobotId = kuka.Id; + j = kuka.j; + break; + case "ROBOTABB": + var abb = (B_Robot_Abb)robotObj; + jointsCurrent = abb.Joints; + label19_currentId.Text = abb.Id; + Curr_RobotId = abb.Id; + j = abb.j; + break; + case "ROBOTEPSON": + var espon = (B_Robot_Espon)robotObj; + jointsCurrent = espon.Joints; + label19_currentId.Text = espon.Id; + Curr_RobotId = espon.Id; + j = espon.j; + break; + case "CNCEDM": + var edm = (B_Cnc_Edm)robotObj; + jointsCurrent = edm.Joints; + label19_currentId.Text = edm.Id; + Curr_RobotId = edm.Id; + j = edm.machine_j; + break; + default: + break; + } + button1.Enabled = true; + button2save.Enabled = true; + + ShowJoint(j); + ShowJointDT(jointsCurrent); + + txt_Detail.Text = JObject.Parse(JsonConvert.SerializeObject(robotObj)).ToString(); + + } + + private void GetRobot(string robotKey,out string type, out string robotCode,out object robotObj) + { + type = ""; + robotCode = ""; + robotObj = null; + + try + { + type = robotKey.Split('|')[0]; + robotCode = robotKey.Split('|')[1]; + robotObj = MesWorkForm.dc_Robot[robotKey]; + } + catch (Exception err) + { + } + + } + private void InitComBoxVale() { + + foreach (string item in AxisString) + { + comboBox1_Axis_J1.Items.Add(item); + comboBox1_Axis_J2.Items.Add(item); + comboBox1_Axis_J3.Items.Add(item); + comboBox1_Axis_J4.Items.Add(item); + comboBox1_Axis_J5.Items.Add(item); + comboBox1_Axis_J6.Items.Add(item); + } + foreach (string item in FilpString) + { + comboBox1_Flip_J1.Items.Add(item); + comboBox1_Flip_J2.Items.Add(item); + comboBox1_Flip_J3.Items.Add(item); + comboBox1_Flip_J4.Items.Add(item); + comboBox1_Flip_J5.Items.Add(item); + comboBox1_Flip_J6.Items.Add(item); + } + } + + + + private void ShowJoint(double[] j) + { + txt_J1.Text = j[0].ToString(); + txt_J2.Text = j[1].ToString(); + txt_J3.Text = j[2].ToString(); + txt_J4.Text = j[3].ToString(); + txt_J5.Text = j[4].ToString(); + txt_J6.Text = j[5].ToString(); + txt_J7.Text = j[6].ToString(); + txt_J8.Text = j[7].ToString(); + txt_J9.Text = j[8].ToString(); + txt_J10.Text = j[9].ToString(); + txt_J11.Text = j[10].ToString(); + txt_J12.Text = j[11].ToString(); + } + private void ShowJointDT(List joints) + { + if (joints == null) + { + return; + } + + for (int i = 0; i < joints.Count; i++) + { + diyJoint.Add(new DiyJoint() + { + Axis = joints[i].Axis, + Delta = joints[i].Delta, + Flip = joints[i].Flip, + ModelCode = joints[i].ModelCode, + }); + } + comboBox1_Axis_J1.Text = joints[0].Axis.ToString(); + comboBox1_Axis_J2.Text = joints[1].Axis.ToString(); + comboBox1_Axis_J3.Text = joints[2].Axis.ToString(); + comboBox1_Axis_J4.Text = joints[3].Axis.ToString(); + comboBox1_Axis_J5.Text = joints[4].Axis.ToString(); + comboBox1_Axis_J6.Text = joints[5].Axis.ToString(); + + comboBox1_Flip_J1.Text = joints[0].Flip.ToString(); + comboBox1_Flip_J2.Text = joints[1].Flip.ToString(); + comboBox1_Flip_J3.Text = joints[2].Flip.ToString(); + comboBox1_Flip_J4.Text = joints[3].Flip.ToString(); + comboBox1_Flip_J5.Text = joints[4].Flip.ToString(); + comboBox1_Flip_J6.Text = joints[5].Flip.ToString(); + + numericUpDown_j1.Text = joints[0].Delta.ToString(); + numericUpDown_j2.Text = joints[1].Delta.ToString(); + numericUpDown_j3.Text = joints[2].Delta.ToString(); + numericUpDown_j4.Text = joints[3].Delta.ToString(); + numericUpDown_j5.Text = joints[4].Delta.ToString(); + numericUpDown_j6.Text = joints[5].Delta.ToString(); + + } + + private void btn_Fill_Joint_Click(object sender, EventArgs e) + { + txt_Set_J1.Text = txt_J1.Text; + txt_Set_J2.Text = txt_J2.Text; + txt_Set_J3.Text = txt_J3.Text; + txt_Set_J4.Text = txt_J4.Text; + txt_Set_J5.Text = txt_J5.Text; + txt_Set_J6.Text = txt_J6.Text; + txt_Set_J7.Text = txt_J7.Text; + txt_Set_J8.Text = txt_J8.Text; + txt_Set_J9.Text = txt_J9.Text; + txt_Set_J10.Text = txt_J10.Text; + txt_Set_J11.Text = txt_J11.Text; + txt_Set_J12.Text = txt_J12.Text; + } + private void btn_Submit_Click(object sender, EventArgs e) + { + var jSet = new double[12]; + jSet[0] = Convert.ToDouble(txt_Set_J1.Text); + jSet[1] = Convert.ToDouble(txt_Set_J2.Text); + jSet[2] = Convert.ToDouble(txt_Set_J3.Text); + jSet[3] = Convert.ToDouble(txt_Set_J4.Text); + jSet[4] = Convert.ToDouble(txt_Set_J5.Text); + jSet[5] = Convert.ToDouble(txt_Set_J6.Text); + jSet[6] = Convert.ToDouble(txt_Set_J7.Text); + jSet[7] = Convert.ToDouble(txt_Set_J8.Text); + jSet[8] = Convert.ToDouble(txt_Set_J9.Text); + jSet[9] = Convert.ToDouble(txt_Set_J10.Text); + jSet[10] = Convert.ToDouble(txt_Set_J11.Text); + jSet[11] = Convert.ToDouble(txt_Set_J12.Text); + + GetRobot(Curr_RobotKey, out string type, out string robotCode, out object robotObj); + switch (type) + { + case "ROBOTFANUC": + var fanuc = (B_Robot_Fanuc)robotObj; + fanuc.jDemo = jSet; + break; + case "ROBOTKUKA": + var kuka = (B_Robot_Kuka)robotObj; + kuka.jDemo = jSet; + break; + case "ROBOTABB": + var abb = (B_Robot_Abb)robotObj; + abb.jDemo = jSet; + break; + case "ROBOTEPSON": + var espon = (B_Robot_Espon)robotObj; + espon.jDemo = jSet; + break; + default: + break; + } + + + } + + private void button1_Click(object sender, EventArgs e) + { + if(Curr_RobotId == "") + { + MessageBox.Show("请选择机器人"); + } + label19_apply.Text = ""; + try + { + jointsCurrent[0].Delta = numericUpDown_j1.Text; + jointsCurrent[1].Delta = numericUpDown_j2.Text; + jointsCurrent[2].Delta = numericUpDown_j3.Text; + jointsCurrent[3].Delta = numericUpDown_j4.Text; + jointsCurrent[4].Delta = numericUpDown_j5.Text; + jointsCurrent[5].Delta = numericUpDown_j6.Text; + + jointsCurrent[0].Axis = comboBox1_Axis_J1.Text; + jointsCurrent[1].Axis = comboBox1_Axis_J2.Text; + jointsCurrent[2].Axis = comboBox1_Axis_J3.Text; + jointsCurrent[3].Axis = comboBox1_Axis_J4.Text; + jointsCurrent[4].Axis = comboBox1_Axis_J5.Text; + jointsCurrent[5].Axis = comboBox1_Axis_J6.Text; + + jointsCurrent[0].Flip = comboBox1_Flip_J1.Text; + jointsCurrent[1].Flip = comboBox1_Flip_J2.Text; + jointsCurrent[2].Flip = comboBox1_Flip_J3.Text; + jointsCurrent[3].Flip = comboBox1_Flip_J4.Text; + jointsCurrent[4].Flip = comboBox1_Flip_J5.Text; + jointsCurrent[5].Flip = comboBox1_Flip_J6.Text; + label19_apply.Text = "应用成功!\r\n等待数据发送更新"; + } + catch (Exception err ) + { + label19_apply.Text = err.Message; + } + } + + private void button2save_Click(object sender, EventArgs e) + { + if (Curr_RobotId == "") + { + MessageBox.Show("请选择机器人"); + } + ScadaConfig scadaConfig = new ScadaConfig(); + scadaConfig.MachineTool = new List(); + for (int i = 0; i < MesWorkForm.scadaConfig.MachineTool.Count; i++) + { + MachineToolConfig machineToolConfig = MesWorkForm.scadaConfig.MachineTool[i]; + string Id = machineToolConfig.Id; + if (Id == Curr_RobotId) + { + machineToolConfig.Joints = jointsCurrent; + } + scadaConfig.MachineTool.Add(machineToolConfig); + } + + string scadaConfigStr = JsonConvert.SerializeObject(scadaConfig); + System.IO.File.WriteAllText(@"config.json", scadaConfigStr); + MessageBox.Show("保存成功"); + } + } + + + public class DiyJoint + { + public string ModelCode { get; set; } + public string Axis { get; set; } + public string Flip { get; set; } + public string Delta { get; set; } + } +} diff --git a/DT_SCADA/F_RobotMonitor.resx b/DT_SCADA/F_RobotMonitor.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DT_SCADA/F_RobotMonitor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DT_SCADA/JG.Designer.cs b/DT_SCADA/JG.Designer.cs new file mode 100644 index 0000000..4a3e942 --- /dev/null +++ b/DT_SCADA/JG.Designer.cs @@ -0,0 +1,257 @@ +using System.Windows.Forms; +using global::Init; +namespace MesWork +{ + partial class MesWorkForm : PlcLinkForm + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + + } + + #region Windows 窗体设计器生成的代码 + + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MesWorkForm)); + this.panel_Btn = new System.Windows.Forms.Panel(); + this.timer_Status = new System.Windows.Forms.Timer(this.components); + this.label2 = new System.Windows.Forms.Label(); + this.label41 = new System.Windows.Forms.Label(); + this.label_Count = new System.Windows.Forms.Label(); + this.timer_ShowCount = new System.Windows.Forms.Timer(this.components); + this.pb_OnLine_SQL = new System.Windows.Forms.PictureBox(); + this.label11 = new System.Windows.Forms.Label(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.panel_Menu = new System.Windows.Forms.Panel(); + this.label_ExitSys = new System.Windows.Forms.Label(); + this.label_Monitor_PLC = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.pb_OnLine_MQTT = new System.Windows.Forms.PictureBox(); + this.label4 = new System.Windows.Forms.Label(); + this.pb_OnLine_PLC_1 = new System.Windows.Forms.PictureBox(); + this.richTextBox1_log = new System.Windows.Forms.RichTextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.dateTimePicker1_start = new System.Windows.Forms.DateTimePicker(); + this.dateTimePicker1_end = new System.Windows.Forms.DateTimePicker(); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_SQL)).BeginInit(); + this.panel_Menu.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_MQTT)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_PLC_1)).BeginInit(); + this.SuspendLayout(); + // + // panel_Btn + // + resources.ApplyResources(this.panel_Btn, "panel_Btn"); + this.panel_Btn.Name = "panel_Btn"; + this.panel_Btn.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_Btn_MouseDoubleClick); + // + // timer_Status + // + this.timer_Status.Enabled = true; + this.timer_Status.Interval = 500; + this.timer_Status.Tick += new System.EventHandler(this.timer_Status_Tick); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // label41 + // + resources.ApplyResources(this.label41, "label41"); + this.label41.Name = "label41"; + // + // label_Count + // + resources.ApplyResources(this.label_Count, "label_Count"); + this.label_Count.Name = "label_Count"; + // + // timer_ShowCount + // + this.timer_ShowCount.Enabled = true; + this.timer_ShowCount.Interval = 500; + this.timer_ShowCount.Tick += new System.EventHandler(this.timer_ShowCount_Tick); + // + // pb_OnLine_SQL + // + this.pb_OnLine_SQL.Image = global::SCADA_JG.Properties.Resources.断开状态; + resources.ApplyResources(this.pb_OnLine_SQL, "pb_OnLine_SQL"); + this.pb_OnLine_SQL.Name = "pb_OnLine_SQL"; + this.pb_OnLine_SQL.TabStop = false; + // + // label11 + // + resources.ApplyResources(this.label11, "label11"); + this.label11.Name = "label11"; + // + // panel_Menu + // + this.panel_Menu.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.panel_Menu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel_Menu.Controls.Add(this.label_ExitSys); + this.panel_Menu.Controls.Add(this.label_Monitor_PLC); + resources.ApplyResources(this.panel_Menu, "panel_Menu"); + this.panel_Menu.Name = "panel_Menu"; + this.panel_Menu.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_Menu_Paint); + // + // label_ExitSys + // + resources.ApplyResources(this.label_ExitSys, "label_ExitSys"); + this.label_ExitSys.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.label_ExitSys.Name = "label_ExitSys"; + this.label_ExitSys.Click += new System.EventHandler(this.label_ExitSys_Click); + // + // label_Monitor_PLC + // + resources.ApplyResources(this.label_Monitor_PLC, "label_Monitor_PLC"); + this.label_Monitor_PLC.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.label_Monitor_PLC.Name = "label_Monitor_PLC"; + this.label_Monitor_PLC.Click += new System.EventHandler(this.label_Monitor_PLC_Click); + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // pb_OnLine_MQTT + // + this.pb_OnLine_MQTT.Image = global::SCADA_JG.Properties.Resources.断开状态; + resources.ApplyResources(this.pb_OnLine_MQTT, "pb_OnLine_MQTT"); + this.pb_OnLine_MQTT.Name = "pb_OnLine_MQTT"; + this.pb_OnLine_MQTT.TabStop = false; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // pb_OnLine_PLC_1 + // + this.pb_OnLine_PLC_1.Image = global::SCADA_JG.Properties.Resources.断开状态; + resources.ApplyResources(this.pb_OnLine_PLC_1, "pb_OnLine_PLC_1"); + this.pb_OnLine_PLC_1.Name = "pb_OnLine_PLC_1"; + this.pb_OnLine_PLC_1.TabStop = false; + // + // richTextBox1_log + // + resources.ApplyResources(this.richTextBox1_log, "richTextBox1_log"); + this.richTextBox1_log.Name = "richTextBox1_log"; + // + // button1 + // + resources.ApplyResources(this.button1, "button1"); + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + resources.ApplyResources(this.button2, "button2"); + this.button2.Name = "button2"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + resources.ApplyResources(this.button3, "button3"); + this.button3.Name = "button3"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // dateTimePicker1_start + // + resources.ApplyResources(this.dateTimePicker1_start, "dateTimePicker1_start"); + this.dateTimePicker1_start.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePicker1_start.Name = "dateTimePicker1_start"; + // + // dateTimePicker1_end + // + resources.ApplyResources(this.dateTimePicker1_end, "dateTimePicker1_end"); + this.dateTimePicker1_end.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePicker1_end.Name = "dateTimePicker1_end"; + // + // MesWorkForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.dateTimePicker1_end); + this.Controls.Add(this.dateTimePicker1_start); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.richTextBox1_log); + this.Controls.Add(this.pb_OnLine_SQL); + this.Controls.Add(this.label11); + this.Controls.Add(this.label41); + this.Controls.Add(this.label_Count); + this.Controls.Add(this.pb_OnLine_MQTT); + this.Controls.Add(this.pb_OnLine_PLC_1); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.panel_Btn); + this.Controls.Add(this.panel_Menu); + this.Controls.Add(this.label2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "MesWorkForm"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MesWorkForm_FormClosing); + this.Load += new System.EventHandler(this.MesWorkForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_SQL)).EndInit(); + this.panel_Menu.ResumeLayout(false); + this.panel_Menu.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_MQTT)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_OnLine_PLC_1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private Panel panel_Btn; + private Timer timer_Status; + private Label label2; + private Label label41; + private Label label_Count; + private Timer timer_ShowCount; + private PictureBox pb_OnLine_SQL; + private Label label11; + private FolderBrowserDialog folderBrowserDialog1; + private Panel panel_Menu; + private Label label_ExitSys; + private Label label_Monitor_PLC; + private Label label3; + private PictureBox pb_OnLine_MQTT; + private Label label4; + private PictureBox pb_OnLine_PLC_1; + private RichTextBox richTextBox1_log; + private Button button1; + private Button button2; + private Button button3; + private DateTimePicker dateTimePicker1_start; + private DateTimePicker dateTimePicker1_end; + } +} + diff --git a/DT_SCADA/JG.cs b/DT_SCADA/JG.cs new file mode 100644 index 0000000..821ba0a --- /dev/null +++ b/DT_SCADA/JG.cs @@ -0,0 +1,427 @@ +namespace MesWork +{ + using DT_YQJF_DC_SLN; + using System; + using System.Data; + using System.Drawing; + using System.Net; + using System.IO; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using System.Windows.Forms; + using Newtonsoft.Json; + using System.Security.Cryptography; + using ABB.Robotics.Controllers.Configuration; + using Newtonsoft.Json.Linq; + using System.Net.Http.Headers; + using System.Web; + using System.Collections.Generic; + using NPOI.SS.Formula.Functions; + using System.Security.Policy; + using System.Data.SqlClient; + using MW_Log; + + public partial class MesWorkForm + { + InitServer initServer = null; + + public static int msgCount = 0; + /// + /// + /// + public MesWorkForm() + { + InitializeComponent(); + CheckForIllegalCrossThreadCalls = false; + this.WindowState = FormWindowState.Minimized; + LoggerHelper.ShowMsg += MyLogHelper_LogCommit; + + // panel_Menu.Visible = true; + + } + private void MesWorkForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) + { + e.Cancel = true; + } + private void label_Monitor_Robot_Click(object sender, EventArgs e) + { + new F_RobotMonitor().Show(this); + } + private void label_Monitor_PLC_Click(object sender, EventArgs e) + { + new OpcForm(IsDemoMesServer).Show(this); + } + private async void label_ExitSys_Click(object sender, EventArgs e) + { + if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) + { + CloseDeviceConn(); + DisConnect(); + await DisConnectService(); + System.Diagnostics.Process.GetCurrentProcess().Kill(); + } + } + private void panel_Btn_MouseDoubleClick(object sender, MouseEventArgs e) + { + panel_Menu.Visible = !!!panel_Menu.Visible; + } + + private void timer_Status_Tick(object sender, EventArgs e) + { + timer_Status.Enabled = false; + Show_OnLineState(); + timer_Status.Enabled = true; + } + + private void Show_OnLineState() + { + + OnLineState_C(pb_OnLine_PLC_1, MesWorkForm.OnLine_PLC_1); + OnLineState_C(pb_OnLine_SQL, MesWorkForm.OnLine_SQL); + OnLineState_C(pb_OnLine_MQTT, MesWorkForm.OnLine_Mqtt); + + } + + private void OnLineState_C(PictureBox pb, bool onLine) + { + pb.Image = onLine ? global::SCADA_JG.Properties.Resources.连接状态 + : global::SCADA_JG.Properties.Resources.断开状态; + } + + private void timer_ShowCount_Tick(object sender, EventArgs e) + { + timer_ShowCount.Enabled = false; + label_Count.Text = MesWorkForm.taskSql.Count.ToString(); + timer_ShowCount.Enabled = true; + } + public static void getCharDataToken() + { + //while (true) + //{ + + DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + long timestamp1 = (long)(DateTime.UtcNow - startTime).TotalMilliseconds; + //if (charDataTokenTime < timestamp1) + //{ + try + { + string time = DateTime.Now.ToString("yyyyMMddHHmmss"); + string newGuid = Guid.NewGuid().ToString("N").Substring(0, 5); + long timestamp = (long)(DateTime.UtcNow - startTime).TotalMilliseconds; + string reqId = "req_AMES001 _" + time + "_" + newGuid; + string authKeyStr = GetMd5Hash(SK + salt + timestamp); + + object reqParams = new { authKey = authKeyStr }; + //准备请求的数据 反序列化 + string bodydata = JsonConvert.SerializeObject(reqParams); + + string retString; + string url = Url_WebApi_Char + "/openApi/auth/getAuthToken/"; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + + request.Headers.Add("reqId", reqId); + request.Headers.Add("timestamp", timestamp.ToString()); + request.Headers.Add("appKey", AK); + //request.Headers.Add("lmt-auth-token", GetMd5Hash(originalString)); + + request.Method = "POST"; + byte[] bytes = Encoding.UTF8.GetBytes(bodydata); + request.Accept = "*/*"; + request.ContentType = "application/json"; + request.ContentLength = bytes.Length; + request.Timeout = 10000; + // 准备请求体 + Stream myResponseStream = request.GetRequestStream(); + myResponseStream.Write(bytes, 0, bytes.Length); + //发送webapi请求 等待相应 + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); + retString = myStreamReader.ReadToEnd(); + MW_Log.LoggerHelper.Info("获取_Token", retString); + // 序列化响应内容 + CharData_Token mrh = JsonConvert.DeserializeObject(retString); + int statusCode = (int)response.StatusCode; + + // 对响应内容进行处理 更新数据库标志 + if (statusCode == 200) + { + myStreamReader.Close(); + myResponseStream.Close(); + if (response != null) + { + // 成功 + if (mrh.code == "0") + { + charDataToken = mrh.data.token; + charDataTokenTime = mrh.data.expireTime; + MW_Log.LoggerHelper.Info("获取_Token", charDataToken); + } + else + { + MW_Log.LoggerHelper.Info("error_Token", mrh.errorDetail); + } + response.Close(); + } + if (request != null) + { + request.Abort(); + } + } + } + catch (Exception err) + { + MW_Log.LoggerHelper.Info("error_Token", "", err); + } + //} + // Thread.Sleep(TokenSyncTime); + //} + } + public void getCharData() + { + while (true) + { + //if (charDataToken == "") + //{ + // MyLogHelper_LogCommit("error_charData", "未获取到Token"); + // MW_Log.LoggerHelper.Info("error_charData", "未获取到Token"); + // continue; + //} + + string beginDateStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + string endDateStr = DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH:mm:ss"); + CharDataSearchPrams charDataSearchPrams = new CharDataSearchPrams(); + charDataSearchPrams.beginDate = beginDateStr; + charDataSearchPrams.endDate = endDateStr; + List testResultList = GetCharData_Details(charDataSearchPrams, out string code, out string errorDetail); + string syncTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + try + { + for (int i = 0; i < testResultList.Count; i++) + { + string vin = testResultList[i].vin; // deviceId + string testCode = testResultList[i].testCode; + string testStatus = testResultList[i].testStatus; + string testBeginTime = testResultList[i].testBeginTime; + string testEndTime = testResultList[i].testEndTime; + string faultInfo = testResultList[i].faultInfo; + B_DB_Opera.BaseData_tagTable_CharData_Insert(vin, testCode, testStatus, testBeginTime, testEndTime, faultInfo, syncTime, out string errMsg); + } + } + catch (Exception err) + { + MyLogHelper_LogCommit("error_charData10", err.Message); + MW_Log.LoggerHelper.Info("error_charData11", "", err); + } + Thread.Sleep(SyncTime); + } + } + static string GetMd5Hash(string input) + { + using (MD5 md5 = MD5.Create()) + { + byte[] inputBytes = Encoding.ASCII.GetBytes(input); + byte[] hashBytes = md5.ComputeHash(inputBytes); + + // Convert the byte array to hexadecimal string + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < hashBytes.Length; i++) + { + sb.Append(hashBytes[i].ToString("X2")); + } + return sb.ToString().ToLower(); + } + } + + private void MyLogHelper_LogCommit(string type, string msg) + { + var log = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + " " + type + " " + msg + "\r\n"; + + msgCount++; + + + if (this.InvokeRequired) + { + this.Invoke(new Action(() => + { + if (msgCount > 100) + { + this.richTextBox1_log.Text = ""; + } + this.richTextBox1_log.AppendText(log); + + })); + } + else + { + if (msgCount > 100) + { + this.richTextBox1_log.Text = ""; + } + this.richTextBox1_log.AppendText(log); + + } + + } + + public static List GetCharData_Details(CharDataSearchPrams charDataSearchPrams, out string code, out string errorDetail) + { + List testResultList = new List(); + code = "0"; + errorDetail = ""; + try + { + + + //准备请求的数据 反序列化 + string bodydata = JsonConvert.SerializeObject(charDataSearchPrams); + + string retString; + string url = Url_WebApi_Char + "/openApi/thirdData/selectBatteryTestResult"; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + string time = DateTime.Now.ToString("yyyyMMddHHmmss"); + string newGuid = Guid.NewGuid().ToString("N").Substring(0, 5); + + long timestamp = (long)(DateTime.UtcNow - startTime).TotalMilliseconds; + string reqId = "req_AMES001 _" + time + "_" + newGuid; + string lmt_auth_token = GetMd5Hash(charDataToken + SK + timestamp); + + request.Headers.Add("reqId", reqId); + request.Headers.Add("timestamp", timestamp.ToString()); + request.Headers.Add("appKey", AK); + request.Headers.Add("lmt-auth-token", lmt_auth_token); + MW_Log.LoggerHelper.Info("selectBatteryTestResultHeaders", $"【reqId】{reqId}【timestamp】{timestamp.ToString()}【appKey】{AK}【lmt-auth-token】{lmt_auth_token}"); + request.Timeout = 10000; + request.Method = "Post"; + byte[] bytes = Encoding.UTF8.GetBytes(bodydata); + request.ContentType = "application/json;charset=utf-8"; + request.ContentLength = bytes.Length; + //MW_Log.LoggerHelper.Info("请求参数_charData_reqId", reqId); + //MW_Log.LoggerHelper.Info("请求参数_charData_timestamp", timestamp.ToString()); + //MW_Log.LoggerHelper.Info("请求参数_charData_appKey", AK); + //MW_Log.LoggerHelper.Info("请求参数_charData_lmt-auth-token", lmt_auth_token); + // 准备请求体 + Stream myResponseStream = request.GetRequestStream(); + myResponseStream.Write(bytes, 0, bytes.Length); + //发送webapi请求 等待相应 + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); + retString = myStreamReader.ReadToEnd(); + MW_Log.LoggerHelper.Info("返回参数_charData", retString); + // 序列化响应内容 + CharData mrh = JsonConvert.DeserializeObject(retString); + int statusCode = (int)response.StatusCode; + + // 对响应内容进行处理 更新数据库标志 + if (statusCode == 200) + { + myStreamReader.Close(); + myResponseStream.Close(); + if (response != null) + { + code = mrh.code; + errorDetail = mrh.msg + mrh.errorDetail; + // 成功 + if (mrh.code == "0") + { + try + { + string syncTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + testResultList = mrh.data; + } + catch (Exception err) + { + MW_Log.LoggerHelper.Info("error_charData2", "", err); + } + } + else + { + if(mrh.code == "603") + { + getCharDataToken(); + } + + MW_Log.LoggerHelper.Info("error_charData3", errorDetail); + } + + response.Close(); + } + if (request != null) + { + request.Abort(); + } + } + } + catch (Exception err) + { + code = "500"; + errorDetail = err.Message; + MW_Log.LoggerHelper.Info("error_charData4", "", err); + } + return testResultList; + } + + private void button2_Click(object sender, EventArgs e) + { + new TaskFactory().StartNew(delegate () + { + + string beginDateStr = dateTimePicker1_start.Text.ToString(); + string endDateStr = dateTimePicker1_end.Text.ToString(); + CharDataSearchPrams charDataSearchPrams = new CharDataSearchPrams(); + charDataSearchPrams.beginDate = beginDateStr; + charDataSearchPrams.endDate = endDateStr; + List testResultList = GetCharData_Details(charDataSearchPrams, out string code, out string errorDetail); + string syncTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + try + { + if (testResultList != null) + { + for (int i = 0; i < testResultList.Count; i++) + { + string vin = testResultList[i].vin; //deviceId + string testCode = testResultList[i].testCode; + string testStatus = testResultList[i].testStatus; + string testBeginTime = testResultList[i].testBeginTime; + string testEndTime = testResultList[i].testEndTime; + string faultInfo = testResultList[i].faultInfo; + B_DB_Opera.BaseData_tagTable_CharData_Insert(vin, testCode, testStatus, testBeginTime, testEndTime, faultInfo, syncTime, out string errMsg); + } + } + else + { + MyLogHelper_LogCommit("error_charData6", "不存在数据!"); + } + } + catch (Exception err) + { + + MyLogHelper_LogCommit("error_charData7", err.Message); + MW_Log.LoggerHelper.Info("error_charData8", "", err); + } + }); + } + + private void button1_Click(object sender, EventArgs e) + { + this.richTextBox1_log.Text = ""; + } + + private void button3_Click(object sender, EventArgs e) + { + getCharDataToken(); + } + + private void panel_Menu_Paint(object sender, PaintEventArgs e) + { + + } + + private void MesWorkForm_Load(object sender, EventArgs e) + { + + } + } +} + diff --git a/DT_SCADA/JG.resx b/DT_SCADA/JG.resx new file mode 100644 index 0000000..945b97b --- /dev/null +++ b/DT_SCADA/JG.resx @@ -0,0 +1,850 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 0, 57 + + + + 4, 4, 4, 4 + + + 112, 68 + + + + 11 + + + panel_Btn + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 14 + + + 17, 17 + + + True + + + Microsoft Sans Serif, 30pt + + + NoControl + + + 120, 56 + + + 4, 0, 4, 0 + + + 664, 69 + + + 9 + + + 数据监控/采集/同步程序 + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 16 + + + True + + + 宋体, 12pt, style=Bold + + + NoControl + + + 9, 536 + + + 4, 0, 4, 0 + + + 135, 24 + + + 17 + + + 瞬时并发: + + + label41 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + True + + + 宋体, 12pt, style=Bold + + + NoControl + + + 142, 536 + + + 4, 0, 4, 0 + + + 36, 24 + + + 18 + + + 12 + + + label_Count + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 134, 14 + + + NoControl + + + 843, 217 + + + 4, 4, 4, 4 + + + 57, 52 + + + Zoom + + + 20 + + + pb_OnLine_SQL + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + True + + + NoControl + + + 842, 275 + + + 4, 0, 4, 0 + + + 62, 18 + + + 19 + + + 服务器 + + + label11 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 351, 14 + + + label_ExitSys + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel_Menu + + + 0 + + + label_Monitor_PLC + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel_Menu + + + 1 + + + Top + + + 0, 0 + + + 4, 4, 4, 4 + + + 955, 52 + + + 10 + + + False + + + panel_Menu + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 15 + + + True + + + 宋体, 12pt, style=Bold + + + NoControl + + + 113, 14 + + + 4, 0, 4, 0 + + + 112, 26 + + + 0 + + + 退出系统 + + + label_ExitSys + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel_Menu + + + 0 + + + True + + + 宋体, 12pt, style=Bold + + + NoControl + + + 4, 14 + + + 4, 0, 4, 0 + + + 101, 26 + + + 0 + + + PLC监控 + + + label_Monitor_PLC + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel_Menu + + + 1 + + + True + + + NoControl + + + 847, 186 + + + 4, 0, 4, 0 + + + 53, 18 + + + 13 + + + MQTTL + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 + + + NoControl + + + 843, 128 + + + 4, 4, 4, 4 + + + 57, 52 + + + Zoom + + + 16 + + + pb_OnLine_MQTT + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + True + + + NoControl + + + 851, 372 + + + 4, 0, 4, 0 + + + 35, 18 + + + 13 + + + PLC + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 12 + + + NoControl + + + 843, 314 + + + 4, 4, 4, 4 + + + 57, 52 + + + Zoom + + + 16 + + + pb_OnLine_PLC_1 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 6, 128 + + + 828, 392 + + + 21 + + + + + + richTextBox1_log + + + System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 838, 476 + + + 117, 44 + + + 22 + + + 清空 + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 480, 536 + + + 164, 40 + + + 23 + + + 获取数据 + + + button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + NoControl + + + 779, 536 + + + 164, 40 + + + 23 + + + 获取token + + + button3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + yyyy-MM-dd HH:mm:ss + + + 212, 532 + + + 233, 28 + + + 24 + + + dateTimePicker1_start + + + System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + yyyy-MM-dd HH:mm:ss + + + 212, 566 + + + 233, 28 + + + 24 + + + dateTimePicker1_end + + + System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 49 + + + 9, 18 + + + True + + + 955, 605 + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAGJSUABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNT + UABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGRUUAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY1NQAGNTUABjU1ANY1NQOWNTUDxjU1A8Y1NQPGNT + UDxjU1A8Y1NQPGNTUDxjU1A8Y1NQPGNTUDxjU1A8Y1NQPGNTUDxjU1A9Y1NQNWNTUAdjU1AAYlJQAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGBQUABiUlAAY1NQAGNTUHJjU1DyY1NQ82NT + UPNjU1DzY1NQ82NTUPNjU1DzY1NQ82NTUPNjU1DzY1NQ82NTUPNjU1DzY1NQ82NTUPRjU1DrY1NQU2NT + UABkVFAAYlJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY1NQAGNTUABjU1AkY1NQ2WNT + UP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NT + UP9jU1DBY1NQEmNTUABjU1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGJSUABiUlAAX09QAGNT + UIljU1D/Y1NQ/GNTUKBjU1BwY1NQcmNTUHJjU1ByY1NQcmNTUHJjU1ByY1NQcmNTUHJjU1ByY1NQcmNT + UHFjU1CyY1NQ/2NTUPxjU1BpY1NQAGBQUABjU1AAAAAAAAAAAAAAAAAAAAAAAAAAAABiUlAAY1NQAGNT + UABjU1AyY1NQ5GNTUP9jU1DLY1NQF2NTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNT + UABjU1AAY1NQAGNTUCxjU1DhY1NQ/2NTUNBjU1AdY1NQAGNTUAAAAAAAAAAAAAAAAAAAAAAAAAAAAGJS + UABjU1AAY1NQBGNTUJ1jU1D/Y1NQ+WNTUF5jU1AAXk5QAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNT + UABjU1AAY1NQAGNTUABjU1AAZFRQAGNTUIBjU1D/Y1NQ/2NTUHxkVFAAY1NQAGNTUAAAAAAAAAAAAAAA + AABiUlAAY1NQAGNTUABjU1BEY1NQ72NTUP9jU1C4Y1NQDmNTUABiVU4AWLUAAFiyAABYsgAAWLEAAFix + AABYsgAAAAAAAAAAAAAAAAAAAAAAAGNTUABjU1AAY1NQH2NTUNRjU1D/Y1NQ32NTUCtjU1AAY1NQAAAA + AAAAAAAAAAAAAGJSUABjU1AAY1NQCmNTUK9jU1D/Y1NQ8mNTUEpjU1AAXYYlAFmyAABZsgAAW7IAAGaw + AABZsgAAWbIAAFmyAABYswAAAAAAAAAAAAAAAAAAY1NQAGJSUABjU1AAY1NQbGNTUP1jU1D/Y1NQkGNT + UAJjU1AAYlJQAAAAAABiUlAAY1NQAGNTUABjU1BWY1NQ92NTUP9jU1CiY1NQBmNNVQBZsgAAWbIAB1my + AE1ZsgCRWbIAmVmyAF9ZsgAQWbIAAFmyAABYsgAAAAAAAAAAAAAAAAAAY1NQAGNTUABjU1AUY1NQw2NT + UP9jU1DqY1NQOWNTUABjU1AAAAAAAGNTUABjU1AAY1NQFGNTUMJjU1D/Y1NQ6GNTUDdjU1AAWLYAAFmy + AAdZsgCGWbIA91myAP9ZsgD+WbIA/lmyAKlZsgAWWbIAAFmyAAAAAAAAAAAAAAAAAABiUlAAZFRQAGNT + UABjU1BYY1NQ+GNTUP9jU1CmY1NQB2NTUABjU1AAY1NQAGNTUABjU1BoY1NQ/GNTUP9jU1CNYVFQAWJS + UABZsgAAWbIATVmyAPdZsgDNWbIAV1myAE9ZsgC+WbIA/1myAHpZsgAAWbIAAAAAAAAAAAAAAAAAAAAA + AABiUlAAY1NQAGNTUAtjU1CyY1NQ/2NTUPNjU1BKY1NQAGNTUABjU1AAY1NQHmNTUNJjU1D/Y1NQ22NT + UCZjU1AAVscAAFuxAABZsgCTWbIA+lmyAEtZsgAAWbIAAFmyADhZsgDxWbIAwFmyAApZsgAAAAAAAAAA + AAAAAAAAAAAAAGFRUABjU1AAY1NQAGNTUEVjU1DwY1NQ/2NTULhjU1AOY1NQAGRUUABjU1B9Y1NQ/2NT + UP5jU1B2ZFRQAGJSUABYsgAA/wAAAFmyAJtZsgD2WbIAOVmyAABZsgAAWbIAHVmyAOFZsgDPWbIAEVmy + AABZsgAAWbIAAFmyAABYsgAAAAAAAGJSUABjU1AAY1NQBWNTUJ9jU1D/Y1NQ+WNTUF5jU1AAY1NQMGNT + UN5jU1D/Y1NQy2NTUBljU1AAYlJQAFixAABZsgAAWbIAZlmyAP9ZsgCmWbIAKVmyAAhZsgAcWbIA4Fmy + AM9ZsgARWLIAClmyAA1asgAAWbIAAFmyAABZsgAAAAAAAGNTUABjU1AAY1NQNGNTUOZjU1D/Y1NQyGNT + UBpjU1CoY1NQ/2NTUPljU1BeY1NQAF5OUABhUVAAWLEAAFmyAABZsgAUWbIAs1myAP9ZsgDrWbIAnlmy + AClZsgDfWbIAzlmyAClZsgCtWbIAxlmyAH1ZsgAYWbIAAFmyAABYswAAYlJQAGJSUABgUFABY1NQimNT + UP9jU1D8Y1NQhGNTUNZjU1D/Y1NQ7mNTUDdjU1AAY1NQAAAAAABYsQAAWbIAAFmyAABZsgAbWbIAhlmy + AM1ZsgCfWbIAKVmyAN9ZsgDNWbIALFmyALlZsgDzWbIA/1myAK1ZsgASWbIAAFizAABiUlAAY1NQAGNT + UABjU1BhY1NQ/GNTUP9jU1CyY1NQZWNTUPZjU1D/Y1NQmGNTUARjU1AAY1NQAAAAAABZsQAAWbIAAFmy + AAD/mgAAWbIAEFmyAAlZsgAcWbIA4FmyAM9ZsgARWbIAD1myADtZsgDDWbIA/1myAGFZsgAAWLMAAGJS + UABjU1AAY1NQEmNTUMBjU1D/Y1NQ6mNTUERjU1ANY1NQsWNTUP9jU1DuY1NQQGNTUABjU1AAY1NQAAAA + AABXtAAAWbIAAFmyAABZsgAAWbIAAFmyAB1ZsgDgWbIAz1myABFZsgAAWbIAAFmyAFlZsgD/WbIAmv8y + AABYsgAAYVFQAGNTUABjU1BpY1NQ/GNTUP9jU1CTYlJQA2NTUABjU1BFY1NQ8GNTUP9jU1CvY1NQCmNT + UABiUlAAAAAAAAAAAAAAAAAAAAAAAAAAAABZsgAAWbIAFVmyANRZsgDlWbIAJ1myAABZsgAAWbIAaFmy + AP9ZsgCVXLIAAFe9AABjU1AAY1NQHmNTUNFjU1D/Y1NQ4WNTUCtjU1AAY1NQAGNTUAVjU1CfY1NQ/2NT + UPZjU1BVY1NQAGRUUABiUlAAAAAAAAAAAAAAAAAAAAAAAFmyAABYsgACWbIAkFmyAP9ZsgCvWbIASVmy + AGBZsgDbWbIA+VmyAFFZsgAAY1RPAGRUUABjU1B9Y1NQ/2NTUP9jU1B/ZlZQAGJSUABjU1AAY1NQAGNT + UDVjU1DnY1NQ/2NTUMJjU1ATY1NQAGNTUAAAAAAAAAAAAAAAAAAAAAAAWbIAAFmyAABZsgAgWbIAuVmy + AP9ZsgD9WbIA/1myAPlZsgCMWbIACVi1AABjU1AAY1NQKmNTUN9jU1D/Y1NQ02NTUB9jU1AAYlJQAGFR + UABjU1AAYVFQAWNTUItjU1D/Y1NQ/WNTUGtjU1AAYlJQAGNTUAAAAAAAAAAAAAAAAABYsAAAWbIAAFmy + AABZsgAXWbIAZ1myAJtZsgCUWbIAUVmyAAlZsgAAZEhZAGNTUAJjU1CRY1NQ/2NTUP1jU1BrY1NQAGJS + UABlVVAAAAAAAGNTUABjU1AAY1NQJmNTUNtjU1D/Y1NQ1GNTUCBjU1AAY1NQAAAAAAAAAAAAAAAAAAAA + AABYsgAAWbIAAFmyAABZsgAAAO8AAFyxAABZsgAAWbIAAF2JIgBjU1AAY1NQOmNTUOtjU1D/Y1NQw2NT + UBRjU1AAY1NQAAAAAAAAAAAAX09QAGJSUABkVFAAY1NQd2NTUP9jU1D/Y1NQgWVVUABjU1AAZFRQAAAA + AAAAAAAAAAAAAAAAAABYsgAAWLIAAFiyAABYsgAAWLIAAFivAABhZkAAY1NQAGNTUAdjU1CmY1NQ/2NT + UPdjU1BYY1NQAGRUUABgUFAAAAAAAAAAAAAAAAAAYlJQAGNTUABjU1AZY1NQzGNTUP9jU1DjY1NQLmNT + UABjU1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZFRQAGNTUABjU1AAY1NQS2NT + UPNjU1D/Y1NQsWNTUAtjU1AAYlJQAAAAAAAAAAAAAAAAAAAAAABjU1AAXk5QAGNTUABjU1BiY1NQ+mNT + UP9jU1CZYlJQA2NTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNTUABjU1AAY1NQAGNT + UA5jU1C5Y1NQ/2NTUO9jU1BFY1NQAGNTUABhUVAAAAAAAAAAAAAAAAAAAAAAAAAAAABiUlAAY1NQAGNT + UBBjU1C8Y1NQ/2NTUO1jU1BNY1NQGGNTUBpjU1AaY1NQGmNTUBpjU1AaY1NQGmNTUBpjU1AaY1NQGmNT + UBpjU1AXY1NQaGNTUPljU1D/Y1NQn2JSUAVjU1AAYlJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGFR + UABjU1AAY1NQAGNTUE5jU1D0Y1NQ/2NTUOpjU1DZY1NQ2mNTUNpjU1DaY1NQ2mNTUNpjU1DaY1NQ2mNT + UNpjU1DaY1NQ2mNTUNljU1DvY1NQ/2NTUOZjU1AzY1NQAGNTUABfT1AAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAGNTUABjU1AAY1NQCGNTUKljU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NT + UP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQ/2NTUP9jU1D/Y1NQimBQUAFiUlAAYVFQAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAYFBQAGNTUABjU1AAY1NQNGNTUJ5jU1CiY1NQoWNTUKFjU1ChY1NQoWNT + UKFjU1ChY1NQoWNTUKFjU1ChY1NQoWNTUKFjU1ChY1NQomNTUJVjU1AhY1NQAGNTUAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYlJQAGFRUABjU1AAY1NQAWNTUAJjU1ACY1NQAmNT + UAJjU1ACY1NQAmNTUAJjU1ACY1NQAmNTUAJjU1ACY1NQAmNTUAJjU1ACY1NQAWNTUABkVFAAYFBQAAAA + AAAAAAAAAAAAAAAAAAAAAAAA+AAAH/gAAB/wAAAP8AAAD+AAAAfAAAAHwAAAA4AAeAOAADgBAAAcAQAA + HAAAAB4AAAAeAAAAAQAAAACAAAAAAAIAAAABAAAAAIAAAAD4AAAAeAAAAHgAAAA4AACAPAABgB4AAcAf + 8APAAAAD4AAAB+AAAAfwAAAP8AAAH/gAAB8= + + + + 802, 497 + + + CenterScreen + + + 采集系统( 2025.01.06.1516 ) + + + timer_Status + + + System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + timer_ShowCount + + + System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + folderBrowserDialog1 + + + System.Windows.Forms.FolderBrowserDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + MesWorkForm + + + MesWork.PlcLinkForm, MesWork.DeviceDriver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/DT_SCADA/LOGO.ico b/DT_SCADA/LOGO.ico new file mode 100644 index 0000000..7082088 Binary files /dev/null and b/DT_SCADA/LOGO.ico differ diff --git a/DT_SCADA/LogRecord.Designer.cs b/DT_SCADA/LogRecord.Designer.cs new file mode 100644 index 0000000..700f3c5 --- /dev/null +++ b/DT_SCADA/LogRecord.Designer.cs @@ -0,0 +1,222 @@ + +namespace LogRecord +{ + partial class LogRecord + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + this.dgv_Log = new System.Windows.Forms.DataGridView(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.btn_Refresh = new System.Windows.Forms.Button(); + this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.工位号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.类型 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.时间 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.内容 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).BeginInit(); + this.SuspendLayout(); + // + // dgv_Log + // + this.dgv_Log.AllowUserToAddRows = false; + this.dgv_Log.AllowUserToDeleteRows = false; + this.dgv_Log.AllowUserToResizeRows = false; + this.dgv_Log.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dgv_Log.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgv_Log.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.dgv_Log.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgv_Log.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.序号, + this.工位号, + this.类型, + this.时间, + this.内容}); + this.dgv_Log.Location = new System.Drawing.Point(12, 51); + this.dgv_Log.MultiSelect = false; + this.dgv_Log.Name = "dgv_Log"; + this.dgv_Log.ReadOnly = true; + this.dgv_Log.RowHeadersVisible = false; + this.dgv_Log.RowTemplate.Height = 26; + this.dgv_Log.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgv_Log.Size = new System.Drawing.Size(1277, 745); + this.dgv_Log.TabIndex = 72; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(358, 12); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 73; + this.button1.Text = "报警"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Visible = false; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(439, 12); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 73; + this.button2.Text = "登录"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Visible = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(520, 12); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 73; + this.button3.Text = "提示"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Visible = false; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // btn_Refresh + // + this.btn_Refresh.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btn_Refresh.Location = new System.Drawing.Point(12, 10); + this.btn_Refresh.Name = "btn_Refresh"; + this.btn_Refresh.Size = new System.Drawing.Size(320, 35); + this.btn_Refresh.TabIndex = 74; + this.btn_Refresh.Text = "刷新"; + this.btn_Refresh.UseVisualStyleBackColor = true; + this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click); + // + // 序号 + // + this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.序号.DataPropertyName = "序号"; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + this.序号.DefaultCellStyle = dataGridViewCellStyle2; + this.序号.HeaderText = "序号"; + this.序号.Name = "序号"; + this.序号.ReadOnly = true; + this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.序号.Width = 60; + // + // 工位号 + // + this.工位号.DataPropertyName = "工位号"; + dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + this.工位号.DefaultCellStyle = dataGridViewCellStyle3; + this.工位号.HeaderText = "工位号"; + this.工位号.Name = "工位号"; + this.工位号.ReadOnly = true; + this.工位号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.工位号.Visible = false; + this.工位号.Width = 250; + // + // 类型 + // + this.类型.DataPropertyName = "类型"; + dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + this.类型.DefaultCellStyle = dataGridViewCellStyle4; + this.类型.HeaderText = "类型"; + this.类型.Name = "类型"; + this.类型.ReadOnly = true; + this.类型.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.类型.Width = 90; + // + // 时间 + // + this.时间.DataPropertyName = "时间"; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle5.Format = "G"; + this.时间.DefaultCellStyle = dataGridViewCellStyle5; + this.时间.HeaderText = "时间"; + this.时间.Name = "时间"; + this.时间.ReadOnly = true; + this.时间.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.时间.Width = 190; + // + // 内容 + // + this.内容.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.内容.DataPropertyName = "内容"; + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + this.内容.DefaultCellStyle = dataGridViewCellStyle6; + this.内容.HeaderText = "内容"; + this.内容.Name = "内容"; + this.内容.ReadOnly = true; + this.内容.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + // + // LogRecord + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1298, 808); + this.Controls.Add(this.btn_Refresh); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.dgv_Log); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "LogRecord"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "日志"; + this.Load += new System.EventHandler(this.LogRecord_Load); + ((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dgv_Log; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button btn_Refresh; + private System.Windows.Forms.DataGridViewTextBoxColumn 序号; + private System.Windows.Forms.DataGridViewTextBoxColumn 工位号; + private System.Windows.Forms.DataGridViewTextBoxColumn 类型; + private System.Windows.Forms.DataGridViewTextBoxColumn 时间; + private System.Windows.Forms.DataGridViewTextBoxColumn 内容; + } +} + diff --git a/DT_SCADA/LogRecord.cs b/DT_SCADA/LogRecord.cs new file mode 100644 index 0000000..17b2a28 --- /dev/null +++ b/DT_SCADA/LogRecord.cs @@ -0,0 +1,143 @@ +using MesWork; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using static System.Configuration.ConfigurationManager; + +namespace LogRecord +{ + public partial class LogRecord : Form + { + public LogRecord() + { + InitializeComponent(); + this.WindowState = FormWindowState.Maximized; + } + public LogRecord(int _Width,int _Height) + { + InitializeComponent(); + this.Width = _Width; + this.Height = _Height; + } + + private void LogRecord_Load(object sender, EventArgs e) + { + Refresh_Log(); + } + + private void Refresh_Log() + { + var dt = Select_Log(); + dgv_Log.DataSource = dt; + + for (int i = 0; i < dt.Rows.Count; i++) + { + var 类型 = (Type_Log)Enum.Parse(typeof(Type_Log),dt.Rows[i]["类型"].ToString()); + switch (类型) + { + case Type_Log.Alarm: + RowsColor(i, Color.Red, dgv_Log); + break; + case Type_Log.Login: + RowsColor(i, Color.Green, dgv_Log); + break; + case Type_Log.Tip: + RowsColor(i, Color.Yellow, dgv_Log); + break; + default: + RowsColor(i, Color.Gray, dgv_Log); + break; + } + } + dgv_Log.ClearSelection(); + //dgv_Log.CurrentCell = null; + //dgv_Log.Rows[0].Selected = false; + } + private void RowsColor(int row, Color color, DataGridView dgv) + { + var dt = (System.Data.DataTable)dgv.DataSource; + for (int i = 0; i < dt.Columns.Count; i++) + { + dgv.Rows[row].Cells[i].Style.BackColor = color; + } + } + + public static bool Insert_Log(Type_Log LogType, string Log_Content) + { + /* +SELECT [IDG],[Log_Station],[Log_Type],[Log_Time],[Log_Content] FROM [记录_日志_运行日志] + */ + bool success = false; + var sql = +$" INSERT INTO [记录_日志_运行日志]([Log_Station],[Log_Type],[Log_Time],[Log_Content])" + +$" VALUES('{MesWorkForm.StationName}','{LogType.ToString()}',getdate(),'{Log_Content}')"; + success = DataLinkMesWork.SQLCommon.ExecuteSql(sql, MesWorkForm.ConnectionString, out string err2); + + return success; + + } + public static DataTable Select_Log() + { + /* +SELECT [IDG],[Log_Station],[Log_Type],[Log_Time],[Log_Content] FROM [记录_日志_运行日志] + */ + var sql = +$" (SELECT " + +$" row_number() over(order by [Log_Time]) AS 序号" + +$" ,[Log_Station] AS 工位号" + +$" ,[Log_Type] AS 类型" + +$" ,[Log_Time] AS 时间" + +$" ,[Log_Content] AS 内容" + + +$" FROM [记录_日志_运行日志]" + +$" WHERE [Log_Station] = '{MesWorkForm.StationName}')" + +$" ORDER BY 序号 DESC"; + DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, MesWorkForm.ConnectionString,out DataTable dt, out string err2); + return dt; + + } + + private void button1_Click(object sender, EventArgs e) + { + Insert_Log(Type_Log.Alarm, "dfghjkjfdfghjk法国红酒看官方一股好久哦i反对牛v军方肯定没得查看你的孙女i的女哦i的妇女哦看v哦对妇女的发"); + } + + private void button2_Click(object sender, EventArgs e) + { + Insert_Log(Type_Log.Login, "废物"); + } + + private void button3_Click(object sender, EventArgs e) + { + Insert_Log(Type_Log.Tip, "滚"); + } + + public enum Type_Log + { + /// + /// 报警 + /// + Alarm = 1, + /// + /// 登录 + /// + Login = 2, + /// + /// 提示 + /// + Tip = 3 + } + + private void btn_Refresh_Click(object sender, EventArgs e) + { + Refresh_Log(); + } + } +} diff --git a/DT_SCADA/LogRecord.resx b/DT_SCADA/LogRecord.resx new file mode 100644 index 0000000..2a7ec94 --- /dev/null +++ b/DT_SCADA/LogRecord.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/DT_SCADA/MW.OnStart.cs b/DT_SCADA/MW.OnStart.cs new file mode 100644 index 0000000..7872aad --- /dev/null +++ b/DT_SCADA/MW.OnStart.cs @@ -0,0 +1,85 @@ +using Newtonsoft.Json; +using OpcBasic; +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using SystemFramework; + +namespace MesWork +{ + public partial class Temp { } + public partial class MesWorkForm + { + protected override void OnShown(EventArgs e) + { + var text = System.IO.File.ReadAllText(@"config.json"); + scadaConfig = JsonConvert.DeserializeObject(text); + + ThreadPool.SetMaxThreads(2000, 800); + Never_Know.Hello_You_All_Never_Know = Hello_You_All_Never_Know; + new ApplicationLog(); + + ConnectService(); + + LoadOPCData(BasicDataTableFile, IsDemoMesServer, IsWriteMonitorLog, true, true, out string err); + if (err.Length > 0) + { + MessageBox.Show($"LoadOPCData错误:{err}"); + Process.GetCurrentProcess().Kill(); + } + + + CommunicationCheckOnLine(); + + LoadDevice(scadaConfig); + + Thread.Sleep(200); + StartServer(); + //Thread.Sleep(200); + //First_TagMonitor(); + + //Thread.Sleep(1000); + //Loop_Fast_Task(); + // Loop_Slow_Task(); + // 开启webApi + initServer = new InitServer(MesWorkForm.WebSvrUrlPort); + + + var task1 = new Thread(new ThreadStart(Loop)); + task1.IsBackground = true; + task1.Start(); + + //var task2 = new Thread(new ThreadStart(getCharDataToken)); + //task2.IsBackground = true; + //task2.Start(); + + //var task3 = new Thread(new ThreadStart(getCharData)); + //task3.IsBackground = true; + //task3.Start(); + + //var task4 = new Thread(new ThreadStart(StationNameStatus_Update)); + //task4.IsBackground = true; + //task4.Start(); + + //var task5 = new Thread(new ThreadStart(StationNameDeviceData_Insert)); + //task5.IsBackground = true; + //task5.Start(); + + //var task6 = new Thread(new ThreadStart(StationNameDeviceData_Update)); + //task6.IsBackground = true; + //task6.Start(); + + //var task7 = new Thread(new ThreadStart(SelectData_WritePLC_Task)); + //task7.IsBackground = true; + //task7.Start(); + + } + + } +} diff --git a/DT_SCADA/Properties/AssemblyInfo.cs b/DT_SCADA/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..081ce25 --- /dev/null +++ b/DT_SCADA/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DT_SCADA")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DT_SCADA")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("d4e30851-a8e7-4275-a7c1-24f034d4cac2")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DT_SCADA/Properties/Resources.Designer.cs b/DT_SCADA/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c1ddba8 --- /dev/null +++ b/DT_SCADA/Properties/Resources.Designer.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace SCADA_JG.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SCADA_JG.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 断开状态 { + get { + object obj = ResourceManager.GetObject("断开状态", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 连接状态 { + get { + object obj = ResourceManager.GetObject("连接状态", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/DT_SCADA/Properties/Resources.resx b/DT_SCADA/Properties/Resources.resx new file mode 100644 index 0000000..da87224 --- /dev/null +++ b/DT_SCADA/Properties/Resources.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\icon\断开状态.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\连接状态.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DT_SCADA/Properties/Settings.Designer.cs b/DT_SCADA/Properties/Settings.Designer.cs new file mode 100644 index 0000000..d91048b --- /dev/null +++ b/DT_SCADA/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace SCADA_JG.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/DT_SCADA/Properties/Settings.settings b/DT_SCADA/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/DT_SCADA/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/DT_SCADA/SCADA_JG.csproj b/DT_SCADA/SCADA_JG.csproj new file mode 100644 index 0000000..993b838 --- /dev/null +++ b/DT_SCADA/SCADA_JG.csproj @@ -0,0 +1,310 @@ + + + + + Debug + AnyCPU + {D4E30851-A8E7-4275-A7C1-24F034D4CAC2} + WinExe + SCADA_JG + SCADA_JG + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\SCADA_JG\ + DEBUG;TRACE + prompt + 4 + true + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + LOGO.ico + + + + ..\DLL\ABB.Robotics.Controllers.PC.dll + + + ..\DLL\BasicData.dll + + + ..\DLL\BouncyCastle.Crypto.dll + + + ..\DLL\BsRmlib.EDM.dll + + + ..\DLL\ConLink.dll + + + ..\DLL\ConLink19.dll + + + ..\DLL\DataLinkMesWork.dll + + + ..\DLL\ICSharpCode.SharpZipLib.dll + + + ..\DLL\log4net.dll + + + ..\DLL\MesWork.DeviceDriver.dll + + + ..\DLL\MesWork.MQTT.dll + + + False + ..\DLL\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\DLL\Microsoft.Extensions.Logging.dll + + + False + ..\DLL\Microsoft.Extensions.Logging.Abstractions.dll + + + False + ..\DLL\Microsoft.Extensions.Options.dll + + + False + ..\DLL\Microsoft.Extensions.Primitives.dll + + + + ..\DLL\MQTTnet.dll + + + ..\DLL\MQTTnet.Extensions.ManagedClient.dll + + + ..\DLL\MySql.Data.dll + + + ..\DLL\Nai.Communication.Robot.FanucVarProxy.dll + + + + False + ..\DLL\Newtonsoft.Json.dll + + + ..\DLL\NPOI.dll + + + ..\DLL\NPOI.OOXML.dll + + + ..\DLL\NPOI.OpenXml4Net.dll + + + ..\DLL\NPOI.OpenXmlFormats.dll + + + ..\DLL\Opc.Ua.Client.dll + + + ..\DLL\Opc.Ua.Configuration.dll + + + ..\DLL\Opc.Ua.Core.dll + + + ..\DLL\OpcUaHelper.dll + + + ..\DLL\Rhino3dm.dll + + + ..\DLL\Robot.Common.dll + + + ..\DLL\Robot.MessageBus.dll + + + ..\DLL\RobotMapper.dll + + + ..\DLL\Robots.dll + + + ..\DLL\RobotStudio.Services.RobApi.dll + + + ..\DLL\RobotStudio.Services.RobApi.Desktop.dll + + + ..\DLL\S7.Net.dll + + + ..\DLL\Serilog.dll + + + ..\DLL\Serilog.Extensions.Logging.dll + + + ..\DLL\SqlCmd.dll + + + + + + False + ..\DLL\System.Net.Http.Formatting.dll + + + + ..\DLL\System.Web.Cors.dll + + + ..\DLL\System.Web.Http.dll + + + ..\DLL\System.Web.Http.Cors.dll + + + ..\DLL\System.Web.Http.SelfHost.dll + + + + + + + + + + + + ..\DLL\Ubiety.Dns.Core.dll + + + ..\DLL\WeifenLuo.WinFormsUI.Docking.dll + + + ..\DLL\Zstandard.Net.dll + + + + + + + + Form + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + JG.cs + + + Form + + + F_RobotMonitor.cs + + + Form + + + LogRecord.cs + + + + + + + + + + + + JG.cs + Designer + + + F_RobotMonitor.cs + + + LogRecord.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Always + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + {1ac112c4-2400-4d03-a26d-2e3ace6fe6d4} + MW_Log + + + + \ No newline at end of file diff --git a/DT_SCADA/SendFormat/DeviceInfo.cs b/DT_SCADA/SendFormat/DeviceInfo.cs new file mode 100644 index 0000000..4917b4f --- /dev/null +++ b/DT_SCADA/SendFormat/DeviceInfo.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SendFormat +{ + public class ToolInfo + { + public string Name { get; set; } + public string TimeRated { get; set; } + public string TimeUsed { get; set; } + } + + public class AxisInfo + { + public string AxisName { get; set; } + public string AxisValue { get; set; } + } + + public class ParameterInfo + { + public string ParameterName { get; set; } + public string ParameterValue { get; set; } + } + + public class AlarmInfo + { + public string Alarm { get; set; } + public string AlarmTime { get; set; } + } + + public class DeviceInfo + { + public string order { get; set; } = ""; + public string Name { get; set; } + public string Id { get; set; } + public string Status { get; set; } + public string Program { get; set; } + public string Feed { get; set; } + public string Speed { get; set; } + public string Rapid { get; set; } + public string ProgramStatus { get; set; } + public ToolInfo Tool { get; set; } + public List Axis { get; set; } + + public List OtherParameter { get; set; } + public List Alarm { get; set; } + + } + + public class JointConfig + { + public string JointName { get; set; } + public string ModelCode { get; set; } + public string JointType { get; set; } + public string Axis { get; set; } + public string Flip { get; set; } + public string Value { get; set; } + public string ValueFactor { get; set; } + public string Delta { get; set; } + } + + public class MachineToolConfig + { + public string Enable { get; set; } + public string Type { get; set; } + public string ConnectStr { get; set; } + public string Id { get; set; } + public string Name { get; set; } + public string DataTimeInterval { get; set; } + public string AxesTimeInterval { get; set; } + public List Joints { get; set; } + + } + + + + public class AppConfig + { + public List MachineTool { get; set; } + } +} diff --git a/DT_SCADA/config.json b/DT_SCADA/config.json new file mode 100644 index 0000000..070e0ea --- /dev/null +++ b/DT_SCADA/config.json @@ -0,0 +1,49 @@ +{ + "MachineTool": [ + { + "Enable": "0", + "Type": "AXIS_CARD", + "ConnectStr": "ST20_AXIS", + "Id": "ST20_AXIS", + "Name": "ST20_AXIS", + "DataTimeInterval": "10000", + "AxesTimeInterval": "30", + "Joints": [ + { + "DeviceCode": "ST20_AXIS", + "JointName": "J1", + "ModelCode": "7abeff9f-633b-404a-891b-2611e6325828", + "JointType": "position", + "Axis": "y", + "Flip": "-1", + "Value": "-1.001", + "ValueFactor": "0.001", + "Delta": "0" + }, + { + "DeviceCode": "ST20_AXIS", + "JointName": "J2", + "ModelCode": "3195df62-4ec6-405e-b8d7-2c8099c26e92", + "JointType": "position", + "Axis": "x", + "Flip": "-1", + "Value": "-1.001", + "ValueFactor": "0.001", + "Delta": "-90" + }, + { + "DeviceCode": "ST20_AXIS", + "JointName": "J3", + "ModelCode": "4a0255a2-78cd-484d-8735-426b8cea0160", + "JointType": "position", + "Axis": "z", + "Flip": "-1", + "Value": "-1.001", + "ValueFactor": "0.001", + "Delta": "90" + } + ], + "TagID_Clamp": "CD2BF6CA-F3F7-4430-B355-2940EFC04013" + } + ] +} \ No newline at end of file diff --git a/DT_SCADA/icon/断开状态.png b/DT_SCADA/icon/断开状态.png new file mode 100644 index 0000000..0ae6189 Binary files /dev/null and b/DT_SCADA/icon/断开状态.png differ diff --git a/DT_SCADA/icon/连接状态.png b/DT_SCADA/icon/连接状态.png new file mode 100644 index 0000000..fcf9db7 Binary files /dev/null and b/DT_SCADA/icon/连接状态.png differ diff --git a/DT_SCADA/webApi/Analysis_MOM_Msg.cs b/DT_SCADA/webApi/Analysis_MOM_Msg.cs new file mode 100644 index 0000000..774a514 --- /dev/null +++ b/DT_SCADA/webApi/Analysis_MOM_Msg.cs @@ -0,0 +1,519 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Net.Mail; +using PLMTEST; +using DataLinkMesWork; +using System.Collections; +using System.Drawing.Imaging; +using Newtonsoft.Json.Linq; +using System.Web.Http; +using NPOI.SS.Formula.Functions; +using System.IO; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Windows.Forms; +using NPOI.SS.Formula; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using System.Net.NetworkInformation; +using System.Resources; +using System.Runtime.Versioning; +using NPOI.SS.UserModel; +using System.Diagnostics; +using System.Runtime.Remoting.Metadata.W3cXsd2001; +using System.Xml.Linq; +using Adapters; +using System.Security.Policy; + +namespace MesWork +{ + public class Analysis_MOM_Msg + { + /// + /// UUID生成 + /// + /// + public static string UuidUtil() + { + string result = Guid.NewGuid().ToString(); + + return result; + } + + /// + /// 获取时间戳 + /// + /// + public static Int64 GetTimeStamp() + { + TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); + return Convert.ToInt64(ts.TotalSeconds); + } + /// + /// 接收检测数据 + /// + /// + /// + public static string OnlineCheckData(string url, [FromBody] JObject jobj) + { + var result = new msgResHeader(); + result.MsgId = ""; + result.Message = ""; + result.Code = "200"; + result.Data = ""; + + string errorMessage = ""; + string parentID = ""; + int AID = -1; + + + int isError = 0; + string str = jobj.ToString(); + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param, out DataTable dt, out errorMessage); + + if (jobj == null) + { + result.Code = "500"; + result.Message = "参数格式不正确!"; + string retString1 = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收检测数据_res", retString1); + return retString1; + } + + // 解析订单内容,存储数据库,根据实际业务来写 + OnlineCheckData onlineCheckData = JsonConvert.DeserializeObject(str); + if (onlineCheckData.MsgId == "") + { + throw new Exception("参数MsgId为空!"); + } + result.MsgId = onlineCheckData.MsgId; + if (onlineCheckData.OpCode == "") + { + throw new Exception("参数OpCode为空!"); + } + if (onlineCheckData.ProductionCode == "") + { + throw new Exception("参数ProductionCode为空!"); + } + int Id_tagCF = 0; + SqlParameter[] param1 = new SqlParameter[6]; + param1[0] = new SqlParameter("@EngineID", onlineCheckData.ProductionCode); + param1[1] = new SqlParameter("@工位号", onlineCheckData.OpCode); + param1[2] = new SqlParameter("@操作者工号", onlineCheckData.CheckPerson); + param1[3] = new SqlParameter("@扫码时间", onlineCheckData.ScanTime); + param1[4] = new SqlParameter("@合格标志", onlineCheckData.QualityMark); + param1[5] = new SqlParameter("@Id_tagCF", Id_tagCF); + param1[5].Direction = ParameterDirection.Output; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("CATL_测量数据合格索引_增加_测试设备", MesWorkForm.ConnectionString, ref param1, out errorMessage); + if (errorMessage != "") + { + throw new Exception(errorMessage); + } + Id_tagCF = Convert.ToInt32(param1[5].Value.ToString()); + + + List onlineCheckData_CheckDataList = onlineCheckData.CheckData; + + for (int i = 0;i < onlineCheckData_CheckDataList.Count;i++) + { + OnlineCheckData_CheckData onlineCheckData_CheckData = onlineCheckData_CheckDataList[i]; + + var param2 = new SqlParameter[] { + new SqlParameter("@Id_tagCF", Id_tagCF), + new SqlParameter("@EngineID", onlineCheckData.ProductionCode), + new SqlParameter("@TagID",onlineCheckData_CheckData.CheckCode), + new SqlParameter("@TagValue",onlineCheckData_CheckData.CheckValue), + new SqlParameter("@IsGoodBad",onlineCheckData_CheckData.QualityMark), + new SqlParameter("@工位号",onlineCheckData.OpCode), + new SqlParameter("@理论值",onlineCheckData_CheckData.StandardValue), + new SqlParameter("@上限值",onlineCheckData_CheckData.MaxValue), + new SqlParameter("@下限值",onlineCheckData_CheckData.MinValue), + new SqlParameter("@测量项目",onlineCheckData_CheckData.CheckName), + new SqlParameter("@测量单位",onlineCheckData_CheckData.Unit), + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("CATL_测量数据合格_增加_测试设备", MesWorkForm.ConnectionString, ref param2, out errorMessage); + if (errorMessage != "") + { + throw new Exception(errorMessage); + } + } + + } + catch (Exception err) + { + result.Code = "500"; + result.Message = err.Message; + } + string retString = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收检测数据_res", retString); + return retString; + } + /// + /// 接收查询检测次数 + /// + /// + /// + public static string OnlineCheckDataCount(string url, [FromBody] JObject jobj) + { + var result = new msgResHeader2(); + result.MsgId = ""; + result.Message = ""; + result.Code = "200"; + result.Data = new checkCountData(); + result.Data.CheckCountOk = 0; + result.Data.CheckCountNg = 0; + string errorMessage = ""; + string parentID = ""; + int AID = -1; + + if (jobj == null) + { + result.Code = "500"; + result.Message = "参数格式不正确!"; + string retString1 = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收查询检测次数_res", retString1); + return retString1; + } + int isError = 0; + string str = jobj.ToString(); + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param, out DataTable dt, out errorMessage); + + // 解析订单内容,存储数据库,根据实际业务来写 + OnlineCheckData onlineCheckData = JsonConvert.DeserializeObject(str); + if (onlineCheckData.MsgId == "") + { + throw new Exception("参数MsgId为空!"); + } + result.MsgId = onlineCheckData.MsgId; + if (onlineCheckData.OpCode == "") + { + throw new Exception("参数OpCode为空!"); + } + if (onlineCheckData.ProductionCode == "") + { + throw new Exception("参数ProductionCode为空!"); + } + + SqlParameter[] param1 = new SqlParameter[2]; + param1[0] = new SqlParameter("@EngineID", onlineCheckData.ProductionCode); + param1[1] = new SqlParameter("@工位号", onlineCheckData.OpCode); + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("CATL_测量数据合格_查询测试次数_测试设备", MesWorkForm.ConnectionString, ref param1, out DataTable dt1, out errorMessage); + if (errorMessage != "") + { + throw new Exception(errorMessage); + } + + if (dt1 != null && dt1.Rows.Count > 0) + { + result.Data.CheckCountOk = Convert.ToInt32(dt1.Rows[0]["OK"]); + result.Data.CheckCountNg = Convert.ToInt32(dt1.Rows[0]["NG"]); + } + + } + catch (Exception err) + { + result.Code = "500"; + result.Message = err.Message; + } + string retString = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收查询检测次数_res", retString); + return retString; + } + /// + /// 接收查询检测次数 + /// + /// + /// + public static string OnlineCheckDataCountBool(string url, [FromBody] JObject jobj) + { + var result = new msgResHeader3(); + result.MsgId = ""; + result.Message = ""; + result.Code = "200"; + result.Data = new checkCountBoolData(); + result.Data.isCheck = false; + string errorMessage = ""; + string parentID = ""; + int AID = -1; + + if (jobj == null) + { + result.Code = "500"; + result.Message = "参数格式不正确!"; + string retString1 = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收查询检测次数Bool_res", retString1); + return retString1; + } + int isError = 0; + string str = jobj.ToString(); + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param, out DataTable dt, out errorMessage); + + // 解析订单内容,存储数据库,根据实际业务来写 + OnlineCheckData onlineCheckData = JsonConvert.DeserializeObject(str); + if (onlineCheckData.MsgId == "") + { + throw new Exception("参数MsgId为空!"); + } + result.MsgId = onlineCheckData.MsgId; + if (onlineCheckData.OpCode == "") + { + throw new Exception("参数OpCode为空!"); + } + if (onlineCheckData.ProductionCode == "") + { + throw new Exception("参数ProductionCode为空!"); + } + + SqlParameter[] param1 = new SqlParameter[2]; + param1[0] = new SqlParameter("@EngineID", onlineCheckData.ProductionCode); + param1[1] = new SqlParameter("@工位号", onlineCheckData.OpCode); + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("CATL_测量数据合格_查询测试次数_测试设备", MesWorkForm.ConnectionString, ref param1, out DataTable dt1, out errorMessage); + if (errorMessage != "") + { + throw new Exception(errorMessage); + } + + if (dt1 != null && dt1.Rows.Count > 0) + { + if(Convert.ToInt32(dt1.Rows[0]["OK"]) > 0 || Convert.ToInt32(dt1.Rows[0]["NG"]) > 0) + { + result.Data.isCheck = true; + } + } + + } + catch (Exception err) + { + result.Code = "500"; + result.Message = err.Message; + } + string retString = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收查询检测次数_res", retString); + return retString; + } + /// + /// 接收打印任务 + /// + /// + /// + public static string ReceivePrintTask(string url, [FromBody] JObject jobj) + { + var result = new msgResHeader(); + result.MsgId = ""; + result.Message = ""; + result.Code = "200"; + result.Data = ""; + + string errorMessage = ""; + string parentID = ""; + int AID = -1; + + if (jobj == null) + { + result.Code = "500"; + result.Message = "参数格式不正确!"; + string retString1 = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收打印任务_res", retString1); + return retString1; + } + + string str = jobj.ToString(); + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param, out DataTable dt, out errorMessage); + + + + // 解析订单内容,存储数据库,根据实际业务来写 + PrintTaskData printTaskData = JsonConvert.DeserializeObject(str); + if (printTaskData.printTemplete == "") + { + throw new Exception("参数printTemplete为空!"); + } + + if (printTaskData.productCode == "") + { + throw new Exception("参数productCode为空!"); + } + if (printTaskData.printDate == "") + { + throw new Exception("参数printDate为空!"); + } + string msg = $"MARK|{printTaskData.printTemplete}|{printTaskData.productCode},{printTaskData.printDate}"; + + // 连接打印机 + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + try + { + socket.Connect(MesWorkForm.MarkingMachine_Ip, int.Parse(MesWorkForm.MarkingMachine_Port)); + } + catch(Exception err) + { + throw new Exception("连接打印机失败:" + err.Message); + } + // 发送数据 + try + { + if (socket.Connected) + { + byte[] decBytes = System.Text.Encoding.UTF8.GetBytes(msg); + //socket.Send(decBytes); + socket.Send(decBytes, 0, decBytes.Length, SocketFlags.None); + } + else + { + throw new Exception("连接打印机失败"); + } + } + catch (Exception err) + { + throw new Exception("发送打印数据失败:" + err.Message); + } + // 关闭 + try + { + if (socket.Connected) + { + socket.Shutdown(SocketShutdown.Both); + socket.Close(100); + } + } + catch (Exception ex) + { + } + } + catch (Exception err) + { + result.Code = "500"; + result.Message = err.Message; + } + string retString = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收打印任务_res", retString); + return retString; + } + + public static string GetCharData(string url, [FromBody] JObject jobj) + { + var result = new CharData(); + result.reqId = ""; + result.msg = ""; + result.errorDetail = ""; + result.code = "0"; + result.data = new List(); + + string errorMessage = ""; + string parentID = ""; + int AID = -1; + + if (jobj == null) + { + result.code = "500"; + result.msg = "参数格式不正确!"; + string retString1 = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收充电数据查询_res", retString1); + return retString1; + } + + string str = jobj.ToString(); + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + if (MesWorkForm.charDataToken == "") + { + throw new Exception("未获取到Token!"); + } + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param, out DataTable dt, out errorMessage); + CharDataSearchPrams charDataSearchPrams = JsonConvert.DeserializeObject(str); + + List testResultList = MesWorkForm.GetCharData_Details(charDataSearchPrams, out string code, out string errorDetail); + //string syncTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + //for (int i = 0; i < testResultList.Count; i++) + //{ + // string vin = testResultList[i].deviceId; + // string testCode = testResultList[i].testCode; + // string testStatus = testResultList[i].testStatus; + // string testBeginTime = testResultList[i].testBeginTime; + // string testEndTime = testResultList[i].testEndTime; + // string faultInfo = testResultList[i].faultInfo; + // B_DB_Opera.BaseData_tagTable_CharData_Insert(vin, testCode, testStatus, testBeginTime, testEndTime, faultInfo, syncTime, out string errMsg); + //} + + result.data = testResultList; + result.code = code; + result.msg = errorDetail; + result.errorDetail = errorDetail; + } + catch (Exception err) + { + result.code = "500"; + result.msg = err.Message; + result.errorDetail = err.Message; + } + string retString = JsonConvert.SerializeObject(result); + MW_Log.LoggerHelper.Info("接收充电数据查询_res", retString); + return retString; + } + } +} diff --git a/DT_SCADA/webApi/CharData.cs b/DT_SCADA/webApi/CharData.cs new file mode 100644 index 0000000..be38e68 --- /dev/null +++ b/DT_SCADA/webApi/CharData.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MesWork +{ + public class CharData + { + public string code { get; set; } + public string msg { get; set; } + public string errorDetail { get; set; } + public string reqId { get; set; } + public long timestamp { get; set; } + public List data { get; set; } + } + + public class TestResult + { + public string vin { get; set; } + public string testCode { get; set; } + public string testStatus { get; set; } + public string testBeginTime { get; set; } + public string testEndTime { get; set; } + public string faultInfo { get; set; } + } + + public class CharData_Token + { + public string code { get; set; } + public string msg { get; set; } + public string errorDetail { get; set; } + public string reqId { get; set; } + public long timestamp { get; set; } + public Token data { get; set; } + } + public class Token + { + public string token { get; set; } + public long expireTime { get; set; } + } + + public class CharDataSearchPrams + { + public string beginDate { get; set; } + public string endDate { get; set; } + public string vin { get; set; } + } + +} diff --git a/DT_SCADA/webApi/Controller/IpcController.cs b/DT_SCADA/webApi/Controller/IpcController.cs new file mode 100644 index 0000000..0357114 --- /dev/null +++ b/DT_SCADA/webApi/Controller/IpcController.cs @@ -0,0 +1,74 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; +using System.Runtime.Remoting.Messaging; + + +namespace MesWork +{ + + public class IpcController : ApiController + { + readonly string headUrl = "Project/"; + + [HttpPost] + [Route("OnlineCheckData")] + public HttpResponseMessage ReceiveMomPlanData([FromBody] JObject jobj) + { + + return new HttpResponseMessage + { + Content = new StringContent(Analysis_MOM_Msg.OnlineCheckData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + + [HttpPost] + [Route("OnlineCheckDataCount")] + public HttpResponseMessage OnlineCheckDataCount([FromBody] JObject jobj) + { + + return new HttpResponseMessage + { + Content = new StringContent(Analysis_MOM_Msg.OnlineCheckDataCount(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + [HttpPost] + [Route("OnlineCheckDataCountBool")] + public HttpResponseMessage OnlineCheckDataCountBool([FromBody] JObject jobj) + { + + return new HttpResponseMessage + { + Content = new StringContent(Analysis_MOM_Msg.OnlineCheckDataCountBool(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + [HttpPost] + [Route("ReceivePrintTask")] + public HttpResponseMessage ReceivePrintTask([FromBody] JObject jobj) + { + + return new HttpResponseMessage + { + Content = new StringContent(Analysis_MOM_Msg.ReceivePrintTask(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + + [HttpPost] + [Route("GetCharData")] + public HttpResponseMessage GetCharData([FromBody] JObject jobj) + { + return new HttpResponseMessage + { + Content = new StringContent(Analysis_MOM_Msg.GetCharData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + } +} diff --git a/DT_SCADA/webApi/InitServer.cs b/DT_SCADA/webApi/InitServer.cs new file mode 100644 index 0000000..66d0e40 --- /dev/null +++ b/DT_SCADA/webApi/InitServer.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Net.Http.Formatting; +using System.Net.Http.Headers; +using System.Web.Http; +using System.Web.Http.Cors; +using System.Web.Http.SelfHost; + +namespace MesWork +{ + + + public class InitServer + { + HttpSelfHostConfiguration config = null; + HttpSelfHostServer server = null; + public InitServer(string Url_WebApi) + { + // var Url_WebApi = System.Configuration.ConfigurationManager.AppSettings["Url_WebApi"]; + Init(Url_WebApi); + } + public void Init(string url) + { + config = new HttpSelfHostConfiguration(url); + + // 启用跨域 + config.EnableCors(new EnableCorsAttribute("*", "*", "*")); + // 启用特性路由 + config.MapHttpAttributeRoutes(); + + //config.Routes.MapHttpRoute( + // name: "DefaultApi", + // routeTemplate: "api/{controller}/{id}", + // defaults: new { id = RouteParameter.Optional } + //); + + // 自定义路由匹配到action + config.Routes.MapHttpRoute( + name: "API Default", + routeTemplate: "api/{controller}/{action}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + + + + server = new HttpSelfHostServer(config); + + server.OpenAsync().Wait(); + + + } + public class JsonContentNegotiator : IContentNegotiator + { + private readonly JsonMediaTypeFormatter _jsonFormatter; + + public JsonContentNegotiator(JsonMediaTypeFormatter formatter) + { + _jsonFormatter = formatter; + } + public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable formatters) + { + var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json")); + return result; + } + } + } +} diff --git a/DT_SCADA/webApi/OnlineCheckData.cs b/DT_SCADA/webApi/OnlineCheckData.cs new file mode 100644 index 0000000..784010d --- /dev/null +++ b/DT_SCADA/webApi/OnlineCheckData.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static NPOI.HSSF.Util.HSSFColor; + +namespace MesWork +{ + /// + /// OnlineCheckData + /// + + public class OnlineCheckData + { + /// + /// MsgId + /// + public string MsgId { get; set; } = ""; + /// + /// OpCode + /// + public string OpCode { get; set; } = ""; + /// + /// ProductionCode + /// + public string ProductionCode { get; set; } = ""; + /// + /// CheckTime + /// + public string ScanTime { get; set; } = ""; + + /// + /// CheckPerson + /// + public string CheckPerson { get; set; } = ""; + + /// + /// QualityMark + /// + public int QualityMark { get; set; } = 1; + + public List CheckData { get; set; } = new List(); + } + + public class OnlineCheckData_CheckData + { + /// + /// CheckCode + /// + public string CheckCode { get; set; } = ""; + /// + /// CheckName + /// + public string CheckName { get; set; } = ""; + /// + /// ProductionCode + /// + public string Unit { get; set; } + /// + /// StandardValue + /// + public string StandardValue { get; set; } = ""; + /// + /// MinValue + /// + public string MinValue { get; set; } = ""; + /// + /// MaxValue + /// + public string MaxValue { get; set; } = ""; + /// + /// CheckValue + /// + public string CheckValue { get; set; } = ""; + /// + /// QualityMark + /// + public int QualityMark { get; set; } = 1; + } + public class PrintTaskData + { + /// string msg = $"MARK|{printTemplete}|{productCode},{printDate}"; + + /// + /// printTemplete + /// + public string printTemplete { get; set; } = ""; + /// + /// productCode + /// + public string productCode { get; set; } = ""; + /// + /// printDate + /// + public string printDate { get; set; } = ""; + + } + + + + +} diff --git a/DT_SCADA/webApi/msgResHeader.cs b/DT_SCADA/webApi/msgResHeader.cs new file mode 100644 index 0000000..725ee42 --- /dev/null +++ b/DT_SCADA/webApi/msgResHeader.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MesWork +{ + public class msgResHeader + { + /// + /// 任务ID + /// + public string MsgId + { + get; + set; + } + /// + /// 返回结果 + /// + public string Code + { + get; + set; + } + /// + /// 返回消息 + /// + public string Message + { + get; + set; + } + /// + /// 返回数据 + /// + public string Data + { + get; + set; + } + } + public class msgResHeader2 + { + /// + /// 任务ID + /// + public string MsgId + { + get; + set; + } + /// + /// 返回结果 + /// + public string Code + { + get; + set; + } + /// + /// 返回消息 + /// + public string Message + { + get; + set; + } + /// + /// 返回数据 + /// + public checkCountData Data + { + get; + set; + } + } + public class msgResHeader3 + { + /// + /// 任务ID + /// + public string MsgId + { + get; + set; + } + /// + /// 返回结果 + /// + public string Code + { + get; + set; + } + /// + /// 返回消息 + /// + public string Message + { + get; + set; + } + /// + /// 返回数据 + /// + public checkCountBoolData Data + { + get; + set; + } + } + + public class checkCountData + { + /// + /// 检测次数 + /// + public int CheckCountOk + { + get; + set; + } + /// + /// 检测次数 + /// + public int CheckCountNg + { + get; + set; + } + } + public class checkCountBoolData + { + /// + /// 检测次数 + /// + public bool isCheck + { + get; + set; + } + + } + +} diff --git a/MW_Log/LoggerHelper.cs b/MW_Log/LoggerHelper.cs new file mode 100644 index 0000000..36cc3b2 --- /dev/null +++ b/MW_Log/LoggerHelper.cs @@ -0,0 +1,47 @@ +using log4net; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MW_Log +{ + /// + /// LoggerHelper + /// + public class LoggerHelper + { + public static event Action ShowMsg; // 显示日志事件 + /// + /// LogInfo + /// + private static readonly ILog LogInfo = LogManager.GetLogger("LogInfo"); + /// + /// 记录Info日志 + /// + /// + /// + public static void Info(string type, string msg, Exception ex = null) + { + if (ex == null) ShowMsg?.Invoke(type, msg); + else ShowMsg?.Invoke(type, ex.Message); + + msg = $"【类别:{type}】\r\n【内容】:{msg}"; + if (ex != null) + { + LogInfo.Info(msg, ex); + } + else + { + LogInfo.Info(msg); + } + + } + + + } + + + +} diff --git a/MW_Log/MW_Log.csproj b/MW_Log/MW_Log.csproj new file mode 100644 index 0000000..9ae8740 --- /dev/null +++ b/MW_Log/MW_Log.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4} + Library + Properties + MW_Log + MW_Log + v4.8 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\DLL\log4net.dll + + + + + + + + + + + + + + + + + Always + + + + \ No newline at end of file diff --git a/MW_Log/Properties/AssemblyInfo.cs b/MW_Log/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d199468 --- /dev/null +++ b/MW_Log/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("MW_Log")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MW_Log")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("1ac112c4-2400-4d03-a26d-2e3ace6fe6d4")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", ConfigFileExtension = "config", Watch = true)] diff --git a/MW_Log/log4net.config b/MW_Log/log4net.config new file mode 100644 index 0000000..d164c22 --- /dev/null +++ b/MW_Log/log4net.config @@ -0,0 +1,35 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SCADA_JG_SLN.sln b/SCADA_JG_SLN.sln new file mode 100644 index 0000000..f4ad761 --- /dev/null +++ b/SCADA_JG_SLN.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCADA_JG", "DT_SCADA\SCADA_JG.csproj", "{D4E30851-A8E7-4275-A7C1-24F034D4CAC2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MW_Log", "MW_Log\MW_Log.csproj", "{1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D4E30851-A8E7-4275-A7C1-24F034D4CAC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4E30851-A8E7-4275-A7C1-24F034D4CAC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4E30851-A8E7-4275-A7C1-24F034D4CAC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4E30851-A8E7-4275-A7C1-24F034D4CAC2}.Release|Any CPU.Build.0 = Release|Any CPU + {1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1AC112C4-2400-4D03-A26D-2E3ACE6FE6D4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9338DC32-EA20-43C9-9073-F048C086886F} + EndGlobalSection +EndGlobal