Pavan

MrPLC Member
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Pavan

  • Rank
    Sparky

Profile Information

  • Country India
  1. mx-components

    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 ....
  2. mx-components

    hellloooo dear.....; already am having the mx component software version 4 and i have install in my pc..... but i dnt how to communicate the serial port communication with plc in vb.net......... can plz help me am fresher.....
  3. Fx_3u plc communication

    Thankqqqqq...... u have a given a good reply .....my problem s how the mx component s used to serial port communication communicated with plc in vb.net ....can u plz guide me .... Thanks & regards......
  4. Fx_3u plc communication

    hi guys ..... wat exactly am asking s .....can u snd me simple code ......... get the values from plc ... in vb.net ...by using the usb serial port mx component package.......... Thanks and regards......
  5. Fx_3u plc communication

    hi to all supports........; i have the mx- component software .... how to use mx component in vb.net programming . in order to read and write data from\ to plc................ Thanks nd regards.......
  6. mx-components

    hi to all supports........; i have the mx- component software .... how to use mx component in vb.net programming . in order to read and write data from\ to plc................ Thanks nd regards.......
  7. Fx_3u plc communication

    Guru..... Can we access data from PLC with out MX-Component software....?Actually I used GX-Works 2 Software for PLC programming But What my exact need is i want get data from PLC(ie particular register data) by using of VB6 programming..............
  8. Fx_3u plc communication

    Guru...... How we access mx-componet in vb(visual basics programming) in order to display the particular register value in vb forms........
  9. Fx_3u plc communication

    Thanks for response......can help me how to check Mx-Component in Mitsubishi..........
  10. Fx_3u plc communication

    Hi All.............., I have FX-3U PLC. I want communicate with PLC(ie..read the data from particular register and write the data to particular register) by using of com port communication in vb.I am fresher in vb please can any one help me..................
  11. plc accessing

    I am trying to change the ipaddress for PLC by using of as mention in document .In this which module(module number) i have to select .... FX Configurator-EN - Operation Manual JY997D20501-D (10.09).pdf
  12. plc accessing

    Yes Same process i had but ip address does not changed it shows same ip address.....................
  13. plc accessing

    I am using two plc's and two Ethernet adapters. PLC type- FX-3U PLC and Ethernet Adapter- FX3U-ENET-ADP.In this when i trying to change the ip address for Ethernet adapters in GX-Works 2 software it does not change the ip address it gives same ip address for both Ethernet adapters .So please help me how to differentiate two Ethernet adapters with different ip addresses.
  14. plc accessing

    can You help me how to give Ipaddress for PLC. Actually i am trying to Change Ipaddress for particular PLC through GTWORKS2 Software but defaultly 2 plc's accessed by same ipaddress(ie 192.168.1.250) so i Am confused which plc i am accessing either first PLC or second PLC.