Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - controls.guy

Pages: [1]
1
Support Questions / Re: Address format Mitsubishi PLC
« on: August 26, 2016, 08:53:19 PM »
As correctly noted, the FX3U-ENET-ADP does NOT support ModbusTCP, however, you do not need to use the -P502 version either... in any event your ADP version isn't going to work, so you will need to acquire either a FX3U-ENET or FX3U-ENET-P502.

The standard FX3U-ENET (the module that connects on the RHS Bus, not ADP version) has a limitation in that you cannot specify Ports below 1024... I guess this is why the came up with the -P502 version, so you could use the default Port 502.

As an aside, FX3G-E PLC's with built-in Ethernet (in effect a built-in FX3U-ENET-ADP) also do NOT support ModbusTCP, however the FX3U-232MB-ADP Serial card does support ModbusRTU if you want a much lower cost alternative.

When using a FX3U-ENET, you connect the module, then must use FX-Configurator-EN to set it up. And in setting up, you are only actually going to give the module its IP Address and open 2 of it's 8 channels with TCP Support for reading/writing on the Port you specify.

After this has been done, the ModbusTCP functionality is handled by function block code running in the PLC that you edit and download with GX Works2.

To get started, log in to your MyMitsubishi account, search for "ModbusTCP" in the software downloads and download the correct version of sample code depending on the type of FX3 you are using... for example, FX3G_ModbusTCPServer_V100.zip or FX3U_ModbusTCPServer_V100.zip... you must get the correct sample for the hardware in use... or the code will not work! The download includes a Compiled Helpfile, a Power-Point presentation and a GX Works2 example code project in compressed format that can be un-packed. (See Image #1)

You are setting up your FX3 to act as a ModbusTCP "Server" when using Ethernet.

Using FX-Configurator-EN, setup the Initial (See Image #2) and Open Settings (See Image #3) as shown, then download the configuration via USB into the PLC target.

When you read the supplied helpfile, you see that the listening Port is set by a function block... change this to an address above 1024... in my experiment, I changed this to 1502 (See Image #4). Compile and download the project in GX Works2 via USB. Cycle the power to the PLC/ENET just to be sure all settings are updated.

In GX Works2 use the Online > Monitor > Device/Buffer Memory Batch feature to write a value to a D Store, for example, 123 into D0.

Over in AdvancedHMI set up your form to use a ModbusTCPCom driver. Enter the IP Address of your ENET module, enter the Port you set, eg 1502.

Add a gauge, for example, and set its ComComponent to use your ModbusTCPCom1 (default name), then set the PLCAddressValue to 40001. 40001 actually maps to D0 (you need to add 1 to the target D Store address you are interested in).

Hope helps. C.G

2
Yes, the patch fixed this issue (see attached)... and many thanks for the prompt resolution. C.G

3
I am brand new to AdvancedHMI and MODBUS but have connected successfully to a Mitsubishi FX3G PLC c/w a FX3U-ENET module using the ModbusTCPCom driver. (As an aside, I have also connected a Mitsubishi FX3G c/w a FX3U-232ADP-MB Serial module using the ModbusRTUCom driver.)

An observation using VS2012 Express with AdvancedHMI 399m and Modbus/TCP is as follows....

When polling COILS using address 00001 to 00003 for example, only devices 00001 and 00002 return status values when the form is running, by adding additional COIL addresses, then the returned TRUE or FALSE status signals always seem to stop one short. The COILs being read are M0 thru M4 in the PLC shown.

To double check this I added a button with code behind to independently check the coils, and all coils required reported correctly. (See the first attached image.) Also, here is the code behind...

Code: [Select]

Private Sub btnReadCoils_Click(sender As Object, e As EventArgs) Handles btnReadCoils.Click
        Dim CurrentValues() As String = ModbusTCPCom1.Read(CStr(TextBox1.Text), 8)
        Dim msg As String = ""
        For i = 0 To CurrentValues.Length - 1
            msg = msg & "Index " & i + 1 & "=" & CurrentValues(i).ToUpper & vbNewLine
        Next
        MsgBox(msg)
End Sub

If we disconnect the actual Ethernet cable to the PLC, we then get the error message display that indicates that only the first 4 devices are actually being polled, which chimes with the experience described above. (See second attached image.)

Pages: [1]