wlederer

Modbus TCP and Serial together on FX3u

30 posts in this topic

Dear colleagues, is it possible to operate two working Modbus units on one PLC (FX3u)? For example, one as serial Master with FX3U-485ADP-MB and another TCP Server with FX3u-ENET-p502?

 

 

Share this post


Link to post
Share on other sites

You can use FX3U-485BD card, FX3U-485ADP-MB and the FX3U-ENET P502 unit and have three different Modbus connections at the same time.

Share this post


Link to post
Share on other sites

Thank You Bryll for the answer. I tried FX3U-485ADP-MB as a serial master and the FX3U-ENET P502 as a Modbus TCP server. I works fine. Now the question how to add another serial Modbus unit as a slave? Will it work with FX3u-485-BD?

Share this post


Link to post
Share on other sites

Yes it will work.

 

Share this post


Link to post
Share on other sites

Just received the FX3u-485-BD. Before I had FX3U-485ADP-MB with FX3u PLC and it worked fine on Ch1 as a master. This time I removed FX3U-485ADP-MB and installed FX3u-485-BD instead. Didn't work. Obviously, it needs a special programming. I use GX Works2 and the project is set as structured. What I missed?

Thank You in advance, Wal

Share this post


Link to post
Share on other sites

Found that Mitsubishi offered library and function blocks which allow to use FX3U-485-BD as master or slave in serial Modbus communication for GX IEC Developer. Downloaded FX3UModbusRTUSlave_V210.zip. My project made in GX Works2 but, the library was installed without problems.

After that I created new program and added function blocks FX3UModbusRTUSlaveCh1 and FX3UModbusRTUSlaveDeviceRange, as was written in manual. Compilation wasn't successful. Function ROR (rotate IN right by N bits) caused error (FX3UModbusRTUSlaveCheck, NW33). The reason is obvious: in GX IEC Developer it has different format than in GX Works2.

Dis somebody use this library in GX Works2? Is it possible?

Share this post


Link to post
Share on other sites

I use them in GX IEC Developer 7.04 and they works just fine.

I set channel 1 for FX3U-485BD and channel 2 for FX3U-485ADP-MB when using them together.

 

Share this post


Link to post
Share on other sites

Thank You Bryll for the answer. What did You put in PLC parameters for Ch1? Which protocol or unchecked?

As I understand, the Ch2 in Your project is unchecked?

Share this post


Link to post
Share on other sites

I've got a laptop with GX IEC Developer 7.04. The library V210 was installed without problems, compilation was OK. I connected external master (made on FX3u-485ADP-MB + FX3G), but the board does not respond the messages.

Please, inform which library version did You use?

Which board is installed FX3u-485-BD or FX2n-485-BD? Is it slave or master?

Share this post


Link to post
Share on other sites

When I opened project downloaded from Mitsubishi (instead of creating my own) the slave started to respond as expected (in GX IEC Developer). Don't know what was wrong. Next step is adding FX3u-485ADP-MB as a master.

Thank You Bryll for Your help.

Share this post


Link to post
Share on other sites

The library version for FX3U-485ADP-MB is (FX3UMBModbusRTUSlave_V210) 2.10.

The MB-Modbus library block is only two "MOV_M" instructions since the unit has the protocol built in it.

For the FX3U-458BD card am I also using version 2.10 (FX3UModbusRTUMaster_V210).

 

Sorry for late answer, been out working.

1 person likes this

Share this post


Link to post
Share on other sites

Dear Bryll, I added the second Modbus unit (FX3u-485ADP-MB) on Ch2 as a master to the existing board (FX3u-485-BD) on Ch1, into my GX IEC Developer project. Both channels work simultaneously. Thank You for the help.

But, the initial goal was to implement two serial Modbus communication channels into existing GX Works2 project. What do You think, is it possible?

Share this post


Link to post
Share on other sites

Can't see any problem with that, just add what you've just done to your project and smile.

Share this post


Link to post
Share on other sites

Thank You Bryll.

Does anybody have experience in using in the GX Works2 function blocks, which were written for IEC Developer?

For example, how to replace ROR? Is there a proper manual exist?

Share this post


Link to post
Share on other sites
Just now, wlederer said:

Does anybody have experience in using in the GX Works2 function blocks, which were written for IEC Developer?

Yes, a huge.

Just now, wlederer said:

For example, how to replace ROR? Is there a proper manual exist?

Why do you want to replace the ROR instruction, while the FX3U-serie supports it??

Share this post


Link to post
Share on other sites

Are you using the Modbus blocks for GX IEC Developer in GX Works 2 ?

If this is the case, try ROR_2_M

Share this post


Link to post
Share on other sites
1 hour ago, Inntele said:

Yes, a huge.

Why do you want to replace the ROR instruction, while the FX3U-serie supports it??

Thank You Inntele for the answer.

I installed the library from Mitsubishi and then compiled. One error pointed to FX3UModbusRTUSlaveCheck, NW33.

The ROR function in GX Works2 has only one word input. The function  ROR??? (probably ROR_2_M) in IEC Developer two. Nothing found in the library, I copied function ROR_E from the NW34 and paste in. Input "Enable" was missing in the original source, and I set it to TRUE. The error disappeared.

Another error was in FX3UModbusRTUSlaveProcessing, NW65. This time the compiler was confused with BMOV_E. I replaced it with BMOV from library.

Compilation was without errors this time. But, the board FX3U-485-BD did not show any sign of life. LED "RD" did not respond to his master messages. Another Modbus unit FX3U-485ADP-MB (master on Ch2) worked OK

I compared PLC parameters in working IEC project and not working GX Wortks2. No differences was found. Not sure, what to do next.

Share this post


Link to post
Share on other sites
1 hour ago, Bryll said:

Are you using the Modbus blocks for GX IEC Developer in GX Works 2 ?

If this is the case, try ROR_2_M

Thank You Bryll.

I haven't found. Actually, I saw no functions with index "_M" in the GX Works2 library.

 Is it available? Where to find ROR_2_M?

Share this post


Link to post
Share on other sites

Sorry, might have slipped on the keyboard, search for ROR_2_P instead.

Not sure, but I think that was the instruction we used when importing the GX IEC function blocks to GX Works2

Share this post


Link to post
Share on other sites

Ahhh...... I think I found your problem when looking into the blocks.

GX IEC Dev block

57443d27d4f5e_gxiecv2.10.jpg.8c3892c4c99

 

Changed for GX Works 2

57443d10145a0_gxworks2v1.00.jpg.a8ab7611

The library we used for the GX Works project was Ver. 1.00, that's why you can see the difference between the labels.

I do apologize for not comparing the versions earlier.

There might be more fancy solutions to correct the errors from the compiler, but I made this change quick and easy to get the communication up and running.

Hope it helps.

Edited by Bryll
Tried a couple of times to insert the pictures

Share this post


Link to post
Share on other sites

I didn't find the ROR_2_P as well. Only, ROR and RORP in my GX Works2 library. In my GX IEC Developer's library there are 4: ROR, ROR_2_M, ROR_E and RORP_2_M.

In GX Works2 project I made changes in FX3UModbusRTUSlaveCheck, NW33 similar to what You suggested. Instead of StartAddress ReceivedMessage[1] is placed, and output is ReadStartAddress instead of WtobTmp (What is it?).

Is this network responsible for the "RD" LED not responding master's messages?

Share this post


Link to post
Share on other sites

Select "Input instruction" and type ROR_ and hopefully you'll see this

574456cf59a17_InputInstruction.jpg.74c0a

Does the compiler indicate an error for the ROR instruction ?

 

Would guess that WtobTmp stands for "Word-To-Byte, Temporary Register" or something similar.

All the 16-bit registers are divided into two 8-bit registers for the TX function.

You are also receiving 8-bit data that is combined to a 16-bit register in the RX block.

 

It should work if your code compiles without errors and you connected TXA to RXA and TXB to RXB with small jumpers.

Share this post


Link to post
Share on other sites
3 hours ago, wlederer said:

Nothing found in the library, I copied function ROR_E from the NW34 and paste in. Input "Enable" was missing in the original source, and I set it to TRUE. The error disappeared.

This time the compiler was confused with BMOV_E. I replaced it with BMOV from library.

 

The ROR_E is present among GX Works2 instruction list, so you could use it from the instruction list directly. The replacement of ROR with ROR_E, both and BMOV_E with BMOV, like you describe it, were done correctly, so this is not a cause, why the data exchange is still not active.

Share this post


Link to post
Share on other sites
43 minutes ago, Bryll said:

Select "Input instruction" and type ROR_ and hopefully you'll see this

574456cf59a17_InputInstruction.jpg.74c0a

Does the compiler indicate an error for the ROR instruction ?

 

Would guess that WtobTmp stands for "Word-To-Byte, Temporary Register" or something similar.

All the 16-bit registers are divided into two 8-bit registers for the TX function.

You are also receiving 8-bit data that is combined to a 16-bit register in the RX block.

 

It should work if your code compiles without errors and you connected TXA to RXA and TXB to RXB with small jumpers.

After I made changes, the compiler does not show errors.

In original function I didn't find the WtobTmp is it local or global? If it worked OK with GX IEC Developer, should I worry about TXA to RXA and TXB to RXB ? Are they cable connections or settings somewhere?

Share this post


Link to post
Share on other sites

If master sends a message, should slave's LED "RD" respond somehow or not? Is it parameter somewhere blocking the LED or program? Or something different, connected with the project setting is wrong?

The project I created myself in GX IEC Developer did not work as well but, when I opened project supplied by Mitsubishi it started to work immediately.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now