The function is used to read the controller parameters, for example, the device ID, door sensor type, driving time of the lock, and read interval.
[in]: The handle that is returned when the connection is successful.
[in]: The buffer used to receive the returned data; the returned data is expressed in a text format;
if the returned data is multiple params, the multiple params are separated by commas.
[in] The size of the buffer used to receive the returned data.
[in]: The parameter names of the device to be read; the multiple parameter names are separated by commas;
you can read at most 30 parameters at a time (Attached table 1 lists the parameter value attributes).
When the returned value is 0 , it indicates that the operation is successful. When the returned value is a negative value,
it indicates that the operation fails. Attached table 5 lists the information about the error codes.
SetDeviceParam
[DllImport("plcommpro.dll", EntryPoint = "GetDeviceParam")] public static extern int GetDeviceParam(IntPtr h, ref byte buffer, int buffersize, string itemvalues); private void GetDeviceParam_Pull() { Connect_Pull(); string valuesToRead = "GATEIPAddress,NetMask"; int ret = 0; int BUFFERSIZE = 10 * 1024 * 1024; byte[] buffer = new byte[BUFFERSIZE]; string tmp = null; ret = GetDeviceParam(h, ref buffer[0], BUFFERSIZE, valuesToRead); tmp = Encoding.Default.GetString(buffer); MessageBox.Show("GetDeviceParam: " + tmp + "."); Disconnect_pull(); }
<DllImport("plcommpro.dll", EntryPoint:="GetDeviceParam")> Public Shared Function GetDeviceParam(h As IntPtr, ByRef buffer As Byte, buffersize As Integer, itemvalues As String) As Integer End Function Private Sub GetDeviceParam_Pull() Connect_Pull() Dim valuesToRead As String = "GATEIPAddress,NetMask" Dim ret As Integer = 0 Dim BUFFERSIZE As Integer = 10 * 1024 * 1024 Dim buffer As Byte() = New Byte(BUFFERSIZE - 1) {} Dim tmp As String = Nothing ret = GetDeviceParam(h, buffer(0), BUFFERSIZE, valuesToRead) tmp = Encoding.[Default].GetString(buffer) MessageBox.Show((Convert.ToString("GetDeviceParam: ") & tmp) + ".") Disconnect_pull() End Sub <DllImport("plcommpro.dll", EntryPoint:="GetDeviceData")> Public Shared Function GetDeviceData(h As IntPtr, ByRef buffer As Byte, buffersize As Integer, tablename As String, filename As String, filter As String, options As String) As Integer End Function