Imports System.Text Public Class Form1 Const ELEMENT_SIZE_16BITINTEGER = 2 Dim iReturnCode As Integer 'Return code 'Error Handler On Error GoTo CatchError 'Set the value of 'LogicalStationNumber' to the property. AxActUtlType1.ActLogicalStationNumber = CInt(txt_LogicalStationNumber.Text) 'The Open method is executed. iReturnCode = AxActUtlType1.Open() 'When ActUtlType returns error code, display error message. If iReturnCode <> 0 Then DisplayErrorMessage(iReturnCode) Exit Sub End If Exit Sub CatchError: 'Exception processing MsgBox(Err.Description(), MsgBoxStyle.Critical) End End Sub Private Sub btn_Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Close.Click Dim iReturnCode As Integer 'Return code 'Error Handler On Error GoTo CatchError 'The Close method is executed. iReturnCode = AxActUtlType1.Close() 'When ActUtlType returns error code, display error message. If iReturnCode <> 0 Then DisplayErrorMessage(iReturnCode) Exit Sub End If Exit Sub CatchError: 'Exception processing MsgBox(Err.Description(), MsgBoxStyle.Critical) End End Sub Dim iReturnCode As Integer 'Return code Dim sharrBufferForDeviceValue(ELEMENT_SIZE_16BITINTEGER - 1) As Short 'Array for using BitConverter class Dim byarrBufferByte(ELEMENT_SIZE_16BITINTEGER * 2 - 1) As Byte 'Array for reading to the PLC Dim byarrTemp() As Byte 'Temporary array for copying data Dim iNumber As Integer 'Loop counter 'Error Handler On Error GoTo CatchError 'The ReadDeviceBlock2 method is executed.(from D10-D11) iReturnCode = AxActUtlType1.ReadDeviceBlock2("D11", _ ELEMENT_SIZE_16BITINTEGER, _ sharrBufferForDeviceValue(0)) 'When ActUtlType returns error code, display error message. If iReturnCode <> 0 Then DisplayErrorMessage(iReturnCode) Exit Sub End If 'Convert the 'sharrBufferForDeviceValue' to the array for using BitConverter class. For iNumber = 0 To ELEMENT_SIZE_16BITINTEGER - 1 byarrTemp = BitConverter.GetBytes(sharrBufferForDeviceValue(iNumber)) byarrBufferByte(iNumber * 2) = byarrTemp(0) byarrBufferByte(iNumber * 2 + 1) = byarrTemp(1) Next iNumber 'Convert the 'byarrBufferByte' to 32bit integer, and set the data to the TextBox as string. txt_Read32bitInteger.Text = CStr(BitConverter.ToInt16(byarrBufferByte, 0)) Exit Sub CatchError: 'Exception processing MsgBox(Err.Description(), MsgBoxStyle.Critical) End End Sub Private Sub DisplayErrorMessage(ByVal iActReturnCode As Integer) Dim szActErrorMessage As String 'Message as the return code of ActUtlType Dim iSupportReturnCode As Integer 'Return code of ActSupportMsg 'The GetErrorMessage method is executed iSupportReturnCode = AxActSupportMsg1.GetErrorMessage(iActReturnCode, szActErrorMessage) 'When ActSupportMsg returns error code, display error code of ActUtlType. If iSupportReturnCode <> 0 Then MsgBox("Cannot get the string data of error message." & vbLf & _ " Error code = 0x" & Hex(iActReturnCode), _ MsgBoxStyle.Critical) Else MsgBox(szActErrorMessage, MsgBoxStyle.Critical) End If End Sub Private Sub DisplayErrorMessage(ByVal iActReturnCode As Integer) Dim szActErrorMessage As String 'Message as the return code of ActUtlType Dim iSupportReturnCode As Integer 'Return code of ActSupportMsg 'The GetErrorMessage method is executed iSupportReturnCode = AxActSupportMsg1.GetErrorMessage(iActReturnCode, szActErrorMessage) 'When ActSupportMsg returns error code, display error code of ActUtlType. If iSupportReturnCode <> 0 Then MsgBox("Cannot get the string data of error message." & vbLf & _ " Error code = 0x" & Hex(iActReturnCode), _ MsgBoxStyle.Critical) Else MsgBox(szActErrorMessage, MsgBoxStyle.Critical) End If End Sub i have this code am getting the output for that.....simuntanously i need another i had used same code and changed the varibles but am not getting am a fresher plz help me ....