kaare_t

MrPLC Member
  • Content count

    2306
  • Joined

  • Last visited

Posts posted by kaare_t


  1. Use "AND" (to mask out the upper byte) and "SHR" (shift-bits right to move the upper byte into a new word):

    Lower Byte: AND [data] 16#00FF -> [outData1] (will only pass the lower byte to the output)
    Upper Byte: SHR [data] K8 [outData2] (will shift the upper 8 bits 8 positions to the right).

    Will this work?


  2. It's easy: Just setup an interrupt in your selected PLC (which you haven't specified either) on xx number of pulses, and setup the equation that equals that number of pulses... Reset your counter whenever you want to reset the traveled distance...

    1 person likes this

  3. @huuquyen: You cannot simply use "RS" instruction to trigger Modbus commands. So it doesn't matter if you get the code for writing a Modbus command via RS instruction, you have to build a telegram first. Depending on you budget I would recommend upgrading the PLC to a newer version to get Modbus functionality. Alternatively you can download a function block from Mitsubishi, ready-made including the FX1N (note that you need the BD card): Search for "FXModbusRTUMaster_V200". It's a zip file with a project (GX IEC Developer) but you can use the library file in GX Developer too by selecting to use label in your project. Note that the FX1N is very limited regarding steps, so you might have a too large project...

    2 people like this

  4. On 18.3.2019 at 3:27 PM, evilaid said:

    What i would have liked is to use a something similair to Arduino board connected to PLC for the sake of reading if the machine is running or not?

    You could use an Arduino and connect a digital output from each of the PLC's to indicate the state. However I would recommend selecting a more industrialized version for production environment, I think that RS sells some that looks more or less like a small PLC... However, I'm not sure I fully understand your question?


  5. I'm not sure if I fully understand what you are trying to do, but I can explain a little about the setup:

    First of all, BFM is not the same as dataregisters (D). You create pointers to/from dataregisters to BFM's, so basically the module itself stores data in BFM, while the CPU interchanges data between BFM and CPU devices. In the AutoRefresh page you have set this correctly (BFM<->D). Note that BFM are HEX address based, while dataregisters are DEC address based, so BFM2010 = D2016...

    Secondly, Device Assignement is used ONLY when the QJ71MB91 is a slave. These are the areas that an external master device can access and are basically the cross-reference between CPU devices and Modbus addresses. One Modbus channel cannot be slave and master at the same time, but from what I understand you want to read both Holding Registers and Input Registers from an external device into the MB91 module? If so, you can disregard the Device Assignment and look only to the Automatic Communication Parameter.

    Let us know if anything was misunderstood, or unclear.


  6. I understand. Can you share the cable pinout? RS232 and RS422 aren't directly connectable without a converter, that's why I'm asking about the cable. You have RS232 on the computer and need a cable, converter and plug to be able to connect to any RS422 equipment...


  7. If you need 22/22/22 (in/out/temp) you could consider purchasing a remote IO base-node with communication and a communication module for the FX... Just install it wherever you want to and communicate with the remote node


  8. Hello and welcome.

    Your code is very wrong. CMP instructions destination (d) uses three devices "in a row" after the first specified device, so e.g.:

    CMP D200 D300 M200

    This will compare D200 with D300, and put the results in M200, M201 and M202. When s1 and s2 is equal, M201 will activate and cause issues with your next command in your code. You need to make space for the used devices in your code,:

    CMP D200 D300 M200
    CMP D201 D301 M203
    CMP D202 D302 M206

    and so on


  9. Hi,

    Here are some comments to the code in the picture, referring to network no:

    1. EnableComms starts the "sequence control", and if not already active it will activate the sendstatusbit
    2. Whenever sendstatusbit goes high, it will give one pulse to the sendpulse bit
    3. When sendstatusbit is high, and the sendinstruction is complete, it will reset the sendstatusbit and start sequence again
    4. NOTE: I've replaced the timer-bit with the sendpulse bit so that it will give only one pulse for each send, and only when the instruction is available for a new transmission

    Also mark that you've used the same connection for receiving data. If this is a send/receive connection where you are supposed to receive data before sending new ones then you should implement receive-routine before triggering a new send... If you need to send/receive data independant you should create two different connections in the setup. The setup you have is similar to a sequence where you expect an answer from the remote node before triggering a new send... Something like the following (not in a picture):

    1. Send data to remote node
    2. rst send signal
    3. Wait for receive data from remote node
    4. Receive the data from remote node
    5. process data from remote node
    6. Trigger new send data to remote node

    So depending on which process we are looking at you need to select your route.

    Also, you should implement some kind of error-check (timeouts, no connection and so on)

    You could also download the latest firmware from Mitsu website for your CPU. You will need a SD card for the update process if you choose to do so.

    sequence.PNG


  10. Hi and welcome!

    That was a difficult one... Almost no results on google... But you could try to contact "GTN" in Japan, they were the only ones where I could find a result for this motor. By searching their website, the following came up. But my Japanese is not any good, so google translate indicates that they either have repaired such a motor, or they can get it for you. Not sure what, but you can always give it a try to make contact and see what happens...
    http://gtntokyo.shop26.makeshop.jp/shop/shopdetail.html?brandcode=000000003986&search=HA-RH101Y&sort=


  11. I see that you've used SM409 - 10ms cyclic signal (5ms ON / 5ms OFF) to trigger the socket communication. This is not a good idea. You need to create a small sequence, that interlocks so that you don't try and send data before the previous transmission was sent with or without success. I normally also interlock together with receive if it's a two-way communication (with the Q-CPU): Send data, wait for answer, then send data again after successful reception.


  12. I see. What would be really helpful is the PLC Error log. My guess is that the error that is active (when you cannot connect to the PLC using GX Works3) disappears when setting the PLC into stop. But it will (should) be present in the log. Here's what you do:

    1. On the top-selection in GX Works3, select "Diagnostics"
    2. Select "Module Diagnostics (CPU Diagnostics)" -> Here you can also find the FW version in the upper left corner of the window, please post it.
    3. Select "Event History"

    This will bring up a list of all previous errors (and warnings etc.). You can also create a csv file of the errors (bottom right corner in the history) and post it here. That would be helpful.