MrPLC Member
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About darmoll

  • Rank

Profile Information

  • Country Ireland
  1. Hi, I am looking at options for integrating MATLAB/Simulink with Q-series PLC (Q04UDE) for hardware-in-the-loop simulations. I would like to have a Simulink model send speed/torque setpoints to the PLC and have measured values feedback from the PLC to the model. I know this can be done via OPC but I think the update rate may too slow for our purposes (I would ideally like to have <100ms update rate). Also, I saw Simulink have a toolbox for converting their models to PLC code, but they don't seem to support Mitsubishi PLCs. Anyone have any ideas on how this can be done? Thanks, Darren
  2. GX Works2 Reversing word order (32bit)

    Thank you both for your suggestions. I have tried both but I am still having trouble. 1. DROR/DROL doesn't work on floats. It does seem to work on double words, but there doesn't appear to be a function for converting double words to floats. 2. I tried using XCH to swap the words, but then I am left with 2 words (rather than 1 float). I couldn't find any options in the card/software for reversing the float 'endianness'. I would have thought this would be a relatively common issue, I am surprised GxWorks does not account for this. I have seen other software implement options for the float 'endianness'. Does anyone have any more suggestions?
  3. Hi, I am interfacing a device with a Mitsu PLC (Q04UDE) via modbusTCP (QJ71MT91). The device's modbus data is mostly 32-bit float and in big-endian format (most significant word first). However it seems the PLC/GxWorks2 reads/writes floats in little-endian format (least significant word first). There doesn't seem to be any obvious method of reversing the word order in GxWorks2, resulting in incorrect readings. Can anyone provide any assistance with this? i.e what is the best method for reversing the word order? Thanks, Darren ps I am using GxWorks2 V1.77F
  4. ModbusTCP Speeds

    Many thanks for your response Russ. We are limited in our options. Our devices only support CanOpen and ModbusTCP, but our PLC (Mitsubishi Q-series) doesn't support CanOpen. I think ModbusTCP should be fine for our purposes. I imagine we will be limited by the scan time of our PLC anyway (~10ms, which is ok for us). I really just wanted to check that we weren't in danger of going slower than this
  5. Hi, I'm currently looking into using ModbusTCP and I have some queries regarding transmission speeds. I have used ModbusRTU in the past, but have found it too slow for our current application. If we have 4 slave devices - 3 with baud rate of 100Mbs and 1 with baud rate of 10Mbs, is the overall network speed limited to the slowest transmission rate in the network (i.e. 10Mbs) or can the three 100Mbs devices still operate at the higher speeds? Is the communication between master/slave performed sequentially (as in ModbusRTU)? Also, say the 4 devices have a baud rate of 100Mbs and we're reading 100 16-bit words from each device, is the theoretical sample time for each word (4*100*16)/100e6 = 64 microseconds? How much would this differ in a practical test? I would appreciate it if anyone had some input to these questions, or can point me in the right direction. Thanks, Darren
  6. Modbus QJ71MB91 Configuration

    Yeah, first slot!
  7. Modbus QJ71MB91 Configuration

    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
  8. Modbus QJ71MB91 Configuration

    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
  9. Modbus QJ71MB91 Configuration

    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
  10. Modbus QJ71MB91 Configuration

    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
  11. Modbus QJ71MB91 Configuration

    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
  12. Modbus QJ71MB91 Configuration

    Yeah they seem to be the correct parameters. Here's the settings on the device end:
  13. Modbus QJ71MB91 Configuration

    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
  14. Modbus QJ71MB91 Configuration

    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!
  15. Modbus QJ71MB91 Configuration

    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.