Jump to content

Trevor J

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Trevor J's Achievements

Member

Member (2/4)

0

Reputation

  1. 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. 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. Is there a system integer or bit that is set when a Modbus RTU SLAVE has received a command from a master? I would like the make a watchdog on my slave device to to notify the operator if communications is lost and to pause the process as it is working with stale data.
  3. 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....!
  4. 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.
  5. 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?
  6. Yes the who's who naming is confusing but it makes sense that the slave is a server as its "hosting" data. I have tried all configurations and it has not worked, using a modbus master tool I can read/write to Factory IO so I know their system is working but the Samba PLC is just not communicating. It looks like Socket 3 never connects? modbus_test.vlp
  7. 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?
  8. 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.
  9. 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? 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.
  10. 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...