Sign in to follow this  
Followers 0
lilics

M340 BMX P34 2020 Open connexions Ethernet TCP/IP

3 posts in this topic

Hello, I have a Schneider PLC M340 with an Ethernet port (BMX P34 2020) and I use Unity Pro S to program it. I used Modbus in TCP/IP, so the PLC is the slave of a PC Master. I need to know when the PLC lose the connexion to its Master, so I found in Unity Pro>Project Navigator>Communication>Net>Configuration>Messages> a variable called "Open Connexions" (I attached a picture of this window) which interests me - when the master is on is set to 1, and when the connexion is lost is set to 0. I don't find this variable in the PLC in order to use it in a program. I found with T_COM_ETH_BMX and the Function Block READ_STS some information about 502port (status of the port, IP ADDR, number of refused connexions, RAZ of the messages counter,...) and the variable %MW0.0.3.7 (Number of process messages in the 502 port). Thanks in advance for any new idea!

Share this post


Link to post
Share on other sites
I know this is available through SNMP, but not exactly sure how to make it available to the program. Perhaps read through SNMP then write back to the PLC using Modbus? Not a very nice solution. I don't think you want this information for your purposes. This, I believe, represents the TCP connection only, not the fact that any device is, in fact, reading or writing to the PLC, which is what I think you want. For instance, when this is zero, perhaps you would then know for sure no device is communicating with the PLC - no question there. But if it is one or more, it only says that there are open TCP connections to port 502. No Modbus messages need be in use - only that TCP has an open connection. For instance - say you start up the system and the SCADA system (or PC, or whatever) is communicating with the PLC - no problem. This value, is, say a '1'. Pull the Ethernet cable from the PC and leave it out. What you will have is a half-open connection on the PLC side where the TCP connection is established, but no queries are coming in. The PLC will still show a '1' until the half-open connection times out, and this could be hours. Perhaps a better approach would be to use your PC or SCADA system to increment a known register every period of time (you define). Set a timer in the PLC - if the register is not updated within a couple of event cycles, then you can issue an alarm. This does not look at TCP connections - it doesn't care. If no communication to this one register, we assume all comms are dead and can then take action. If you can use the PLC as the client and the PC as the server, you could use the health bits provided as part of IOScanner with an NOE or NOC Ethernet card. I am sure others have better ideas too on how to verify communications.

Share this post


Link to post
Share on other sites
First of all, many thanks Sparky for your ideas. I have a BMX P342020 card, no IOScanner in this kind of cards Edited by lilics

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