Sign in to follow this  
Followers 0
darmoll

Modbus QJ71MB91 Configuration

22 posts in this topic

Hi all, I am trying to configure a mitsu modbus module (QJ71MB91) with a Woodward Easygen300 diesel genset controller, using GXWorks2. I am getting a 'response monitoring timer timeout' error on the QJ71MB91 (error code: 7378h). The error is as follows: transmission is via RS485 the transmission settings are the same on both master and slave (9600 baud, No parity bit, 1 stop bit, slave id: 01) I have increased the PLC Response Monitoring timer value (currently at 5secs) I have tried wiring using both 4-wire and 2-wire connections (and also reversing relevant polarities) I am unsure how I should proceed, so I would be grateful if anyone had any thoughts on how I can further troubleshoot this issue. I have included further details below. Thanks, Darren Master: QJ71MB91 Slave: Easygen3000 Switch settings: Switch 1,3,5 : 0 Switch 2: 0001 Switch 4: 0544 I have attached screenshots of the automatic communication parameters and auto-refresh settings I've been using.

Share this post


Link to post
Share on other sites
See example

Share this post


Link to post
Share on other sites
Your target Device headstation looks a bit high? I would start with Holding registers 1 o check comms. Normally you would get an out of range error from a slave when you've holding register is out of range.

Share this post


Link to post
Share on other sites
Most likely you have set the Modbus Address wrong. Remember that the Head Modbus Device is NOT the same as the Modbus address. If you want to read from Modbus address 40001, then you select "Holding Registers" like you've done, and then specify "1" as the Head Modbus Device.

Share this post


Link to post
Share on other sites
Thank you all for your input. I did think that the Head Modbus Device was the same as the Modbus address, so thats one thing cleared up. Kazah's example has been a useful guideline. I have now set the Modbus device head number to 5504. However, I am still getting the same timeout error. I have a few more queries: In Kazah's example, there is a ladder program which seems to be initialising some settings. I thought that all the settings could be configured from within the GUI (Automatic_Communication_Parameter and Auto_Refresh) - am I wrong on this? Do I need some initialisation program such as Kazah's? Am I correct in assuming that the 'MODBUS_Device_Assignment_Parameter' settings are only used if the QJ71MB91 is acting as a slave? Apologies if my queries are quite basic, I'm new to this area!

Share this post


Link to post
Share on other sites
1. You are correct. If you use a ladder program it will overwrite some settings that you define in the configurator (yes, you can configure everything in the configurator). 2. Correct If you still can't make it work, you could post your program if possible.

Share this post


Link to post
Share on other sites
Program attached. For the moment I'm just trying to read one parameter from the device (at Modbus address 45504) Thanks, Darren Easygen485_01a.zip

Share this post


Link to post
Share on other sites
Are these correct comm parameters for the serial line??

Share this post


Link to post
Share on other sites
Yeah they seem to be the correct parameters. Here's the settings on the device end:

Share this post


Link to post
Share on other sites
Then my quess is that the cabling is wrong. How did you connect them (which terminals to which terminals)??

Share this post


Link to post
Share on other sites
OK finally made some progress. Looks like you were right kaare_t - I checked the wiring again and found a 2-wire configuration that works (I had been using a 4-wire config). So I can now read in a parameter. However I cannot write to this parameter. It should have write access, I have been able to write to it before using a direct PC->Device serial connection and Modscan. If I try using the "0505h: Read/Write Holding Registers" or the "0005h: Write Holding Registers" functions in the Automatic communication parameter setting, I get the same timeout error as before (7378h). Any ideas on why this could be? Screenshot of parameter settings below. Thanks, Darren

Share this post


Link to post
Share on other sites
Try separating the instructions first so that you have one read and one write instructions. It's easier to debug cause you will see which instruction fails. Post the new config.

Share this post


Link to post
Share on other sites
I seperated the instructions. Screenshot attached. The read instruction works fine, however in the write instruction there is an exception response from the slave device. In relation to the permission issue, there is a password required for changing the parameter (via the device’s display screen anyway). The Modbus head device number for the password is 10404. I have tried writing the password to this, but I received the same exception response error. Also, I didn’t need this p/w when I was reading/writing using the direct PC->Device connection and Modscan. Could this be due to the password? If so, why would the password be required when communicating via the PLC but not required when the device is connected directly to the PC? Thanks again, Darren

Share this post


Link to post
Share on other sites
Do you want to both read and write the same Modbus address (Holding Register: 5503)??????? Could this be the issue, that you are trying to write to a "Read-Only" variable in your slave?? Have you tried writing to a different address, a variable you are sure that is write enabled?

Share this post


Link to post
Share on other sites
Bit more progress made! The write issue seemed to be due to a password protection in the device. Once I wrote the password to register 10430 (rs458 serial interface password), I was able to write to register 5503 (using the same settings in my previous post). One thing I found strange, was that it works ok when I seperate the read & write instructions (as in my previous post), but I get a timeout error when I try to combine the instructions and use the "Read/Write Holding Registers" function (as in post #11). Any ideas why this could be? Also if you don't mind, I just have a more general query about the automatic communication parameters (a.c.p) that I'm hoping you could shed some light on - In GxWorks2, there is only space to enter 32 a.c.p. This seems quite low, espectially when multiple devices are in use. Is there a better way to have access to more device parameters? My understanding is that I can access multiple parameters from each a.c.p, but this seems to be only if the parameter addresses are sequential. i.e. if a.c.p 1 is set to read register 5503, and the number of access points is say 10, I will read in registers 5503-5512. But what happens when the parameters I want to accesss are non-sequential? Am I limited to 32?? Or am I missing something here? Many thanks (as always!) Darren

Share this post


Link to post
Share on other sites
1: Read/Write holding registers is a separate instruction (FC:23), and not a combination of read (FC:3) and write(FC:16) holding registers. Therefore, the slave device must be capable of using FC:23 in order to use the read/write instruction. Your slave(s) probably don't support that FC. 2: You are correct. You are limited to the parameters in the a.c.p. I agree with you, there should be a lot more entries, as you mention the problem arises once you need to access devices with gaps in between. The only alternative is to implement a function block (you need to use either GX IEC or "Structured Ladder" in GW2): http://www.beijer.no...12573E2004BC91B Using the function block, you can create a sequence of steps that change the address parameter on the FB. That way you'll be able to access as many devices as you wish without concern of acp. However, the performance will be a bit lower.

Share this post


Link to post
Share on other sites
Thanks kaare_t, much clearer now. I tried using that function block you suggested, but I wasn't able to open it in GxWorks2. However, I found a similar FB on the mitsubishi site FB_QJMB91ModbusSerial_V120 (need to be logged in first). I've followed an example given with the FB, however my program won't compile. I get the same error on a number of different labels, such as " 'ReadData' is not a member label of SDT or a function block label". The source of the error is from inside the FB (which I haven't made any changes to). Any ideas what this could be? I'm wondering if it could be a software issue, I'm using GxWorks2 v.177 and the FB seems to have been created in GX IEC Developer 6.10... Config_FB03.zip

Share this post


Link to post
Share on other sites
Strange, the program compiles just fine to me. Try upgrading to the latest version of GW2 (1.87). You can download it from "your Mitsubishi"... In addition: It seems that your compiler is complaining about the FB "MbrwInstr". You can try opening the FB (open the QJ71MB91....._V120 library), and open MbrwInstr. When I open your project it looks like this: (* Write each hexadecimal digit to four separate words *) LD TRUE DIS_M HeadAddress, K2, DataDisunited[0] (* Add 16#30 to convert hexadecimal digit to ASCII. If the result is higher than 16#39 add another 16#7 to convert into letters A-F *) LD TRUE PLUS_3_M DataDisunited[0], 16#30, DataDisunited[0] AND_GT_M DataDisunited[0], 16#39 PLUS_3_M DataDisunited[0], 16#7, DataDisunited[0] LD TRUE PLUS_3_M DataDisunited[1], 16#30, DataDisunited[1] AND_GT_M DataDisunited[1], 16#39 PLUS_3_M DataDisunited[1], 16#7, DataDisunited[1] (* Swap bytes to position the data *) LD TRUE SWAP_MD DataDisunited[1] (* Unite data to a string *) LD TRUE WOR_3_M DataDisunited[1], 16#55, DataStrFormat[0] MOV_M DataDisunited[0], DataStrFormat[1] (* End of string *) MELSEC_START (* Write result to the output *) LD TRUE BMOV DataStrFormat HeadAddressStr K2 MELSEC_END MELSEC_START LD TRUE Z.MBRW HeadAddressStr (* Read / write Modbus data *) ControlData ReadData WriteData StatusArray MELSEC_END

Share this post


Link to post
Share on other sites
Ok so the problem was in MbrwInstr, it didn't seem to like the 'MELSEC Start/End' commands. Unfortunately I'm unable to upgrade at the moment. I tried removing the MbrwInstr FB and just call the Z.MBRW FB within the main FB "FB_QJMB91ModbusSerial_V120". This didn't work. I since tried stripping everything down and using only the Z.MBRW dedicated instruction to read 1 parameter, but once again I am running into a timeout error issue. As soon as I start the command, error led comes on. Error code 7379h. I've followed the example shown in the user manual for this dedicated instruction, but I can't see where I'm going wrong. Comms settings and wiring are all ok. I've attached the program, I would be very grateful if you could take a look and see if you can spot anything I'm doing wrong. Thanks, Darren TestZMBRW.zip

Share this post


Link to post
Share on other sites
On the way out, but just to make sure: Your card is installed in the first slot, directly to the right of the CPU..!??

Share this post


Link to post
Share on other sites
Not really sure what the problem is, but here's what I would do if I were in your situation: -Use a Modbus tool like ModSim32 (just use the trial/free version) on your computer so that you are able to see the received messages from the MB91 -Connect the RS232 port on the MB91 to your computer using a special cable (2-3, 3-2 and 5-5. In addition shortcut these on both sides in the Dsub plug: 1-4-6 and 7-8) -You can now start up ModSim32 and attach it to the correct serial port. Put in the correct start address and length of the data you wish to receive and hit connect Using that it will be much easier to debug your problem. Is this possible for you to do??

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
Sign in to follow this  
Followers 0