Jump to content

Trevor J

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Trevor J

  1. 12 hours ago, AlexUT said:

    See SDW 37 description.

    And SI 274, 275, 276.

     

    SDW 37 was just what I wanted. I simply check if it hasn't changed and allow the watchdog to run, every change will reset the counter.

    4 hours ago, Ausman said:

    In crucial operations I have a deliberate time check on data being updated correctly.  Every nominated time period, I place a number well outside the normal range in a register, having the system ignore it for that small time, and then see if it gets changed.  If it doesn't get changed within a given delay, the alerts come up.

    This is actually a very easy thing to implement as you only need to check one piece of data, not a full vector, and isn't based on any reads of system stuff that Alex has rightly suggested.  It is based on actual results.  You could do it to an entire vector if you felt it needed...I've never found it necessary.

    I should mention that all my slaves are routinely called in a varying sequence, with a given maximum time between calls, which you definitely have to relate to the slave's checking time periods.

    cheers, Aus

    I do a similar thing on the master to guarantee sane data or generate errors. The slaves though I was using a "heartbeat bit" but SWD 37 is essentially that and simpler.

  2. Well I got it working last night! 

    It turns out that Windows was the complete failure here. Windows 7 has a bug where if you have 2 networks the firewall settings apply ONLY to the FIRST to connect. The second gets the default config and there is no option to specify interface. The only way to make it work was "Run, service.msc, find Windows Firewall, Stop & Disable".

    I knew it couldn't be this hard...

    Apparently the slave ID on Modbus TCP is ignored as the IP inherently only points to one device, only RTU checks the ID.

    Also the R/W mix I have not tried, I put a standard read inputs FB and it did not work until I figured out the firewall thing. Just for fun when I have more time I will see if R/W mix only works for Unitronics stuff.

    Thanks for the help, even though it was Windows all along....!

  3. 18 hours ago, Ausman said:

    I've had a quick squiz over the ladder (after working through the hiccouphs as I still use 9.8.65) and to me some things stand out.

    1.  Your socket init is showing as master, so backtracking to my previous notes, make sure the relationships are correct.

    2.  Your card init is showing the gateway as the same address as you have in comments for the FCTORY IO.  I don't know the quirks of Factory IO but think this might be an issue if you're not getting a DNS resolution.  Can Factory IO do this, or should you be referencing your router?

    3.  For interest's sake, try making the ports the same.  And ensure that Factory IO is set to work on said ports.

    cheers, Aus

    1 - I want the PLC as Master. I have run QModMaster on the same machine as Factory IO and made sure I can interact properly and it works as expected.

    2 - The PLC and the laptop running Factory IO are connected with a ethernet cable. No switch or router. Laptop has a static ip of 192.168.1.1. As it is a static network without DHCP there should not be any DNS request at all. I can try the PLC as the gateway though. I have never put a router in a field install, only switches.

    3 - Which ports the same? I have the slave configured in the setup block with port 502 and I connect with port 502. I verified Factory IO is communicating on 502 with QModMaster.

    Not sure why this isn't working... I can try and get an old router out of the box but it will just be connected to the local LAN switch anyways. Maybe a MDX issue and I need a crossover cable? All switches nowdays are Auto MDX.

  4. 23 hours ago, Joe Tauser said:

    Try putting a positive transitional you set yourself in series with the Connect logic.

    I put a positive transition attached to a button and Socket 3 still never connects, thus not even getting to the modbus r/w mix FB.

    I don't understand why it wouldn't work, it as basic of a setup as possible. Will Socket 3 only connect when the slave accepts the TCP connection? As this is running on a Windows 7 machine maybe its a firewall issue?

  5. I am trying to interface to Factory IO  and I can not read or write anything.

    I used the TCP Master config example in the help file for modbus tcp and running a modbus bus monitor shows a connection being made but no actual communications happening.

    All code is exactly as shown except I don't close the socket as there is no other slaves to worry about. Anybody know how I should configure a read/write block to pull the virtual IO out of Factory IO?

     

  6. I got ModBus working properly on my two Sambas. Structs are really useful!

    Comms is now essentially instantaneous (from the users perspective).

    I have had some TERRIBLE luck win Can and CanOPEN in the past and have ripped out complete systems and gone to ModBusTCP and it worked right off the bat. My supplier also had the rs485 card on hand so that helped make the decision.

    In the end as long as it works the protocol is irrelevant.

  7. 6 hours ago, Isakovic said:

    Bundle all bits and registers into couple of consecutive registers with struct command, so you can send them all with one Modbus command. Of course, you have to unpack it on the other side.

    Even if I bundle I will need a few modbus calls for bits and ints. How do I do the logic to get the few function blocks to run back to back and over and over?

    24 minutes ago, Ausman said:

    Isakovic's suggestion is correct and the best for your current hardware, but you are still working within Modbus limitations.  if you really need to get things moving even faster than this, you could put in some Canbus modules and use Unican b/n the two.  Much faster and in many ways much easier to do.

    cheers, Aus.

    I had to go with isolated rs485 due to emi noise and distance issues. I don't need to update the bits every scan but something on the order of 33ms would be great. 

  8. I have two SM43's in my current project with Modbus RTU working. One handles the IO and one is essentially the operator station.

    I am not sure how to get the communication working reliably. Currently I copy pasted from the examples. So I have an MB set a coil,, the positive transition interlocked with the modbus XIC status calls the modbus function which resets the coil when complete. All fine and dandy and works fine. 

    Now as things get more complex I am sending and receiving several groups of MB & MI's and I want them all to update constantly.

    I  then set the first coil with SB3 and reset/set down the chain to the bottom. This did not really work at all. I then got rid of the SB3 call and made a circular set/reset loop between all the calls. I used an XIC SB2 to set them off and that didn't work great either.

    What is the best way to get a bunch of modbus commands to run in an endless loop so I can treat both Sambas as if they are one?

×
×
  • Create New...