Monitoring Modbus TCP channel in M340

CsmQl

Member
Join Date
Dec 2017
Location
Santiago
Posts
14
Hi there, do you guys know how to detect if the flow information into a Modbus TCP/IP channel stops, i know we can see if the Ethernet port has been disconnected phisically, but i wonder if is there a way to detect if there is no information going through the channel, independently of the phisically connection.

i am reading the values from a 1420 emerson gateway using Read_Var block in Unity Pro - M340 PLC, there is a entry called Gest where i have to put a 4 Array variable of integers, i notice that the bits of one of these integers are constantly changing between 0 and 1, i also noticed that this bits stops in the last value when i lost communication with the Gateway, how could i take this information to monitoring the healty of the channel? any idea?

Thanks in advance pals!.
 
Intra- or extra-PLC?

Hi there, do you guys know how to detect if the flow information into a Modbus TCP/IP channel stops

Wireshark (or tcpdump, or similar) can monitor the ethernet; N.B. that information will be external to the running PLC.

Within the PLC, you could set up a timer that looks at the variables every N seconds, and if those do not change M times in a row, then it seems likely that the Modbus TCP/IP channel's flow has stopped. If any of the values do change, then flow has not stopped and you store all values for the comparison at the next [timer done] event.

Caveats
  • This is an empirical approach
    • There could be other reasons for no change
    • E.g. the upstream process could have stopped changing
  • The only way this works is if there is some noise in the values over time
    • Which you seem to indicate is the case.
    • You may need to store past values of everything in the channel, or
    • If there was a time tag, then that might be all you need to check
  • The N and M will be apropos your process.
  • What you do with any [no change] events is up to you:
    • output or one-shot or latch;
    • whether to reset manually or automatically;
    • whether to count and/or log them;
    • etc.
 
Last edited:
Hi there, do you guys know how to detect if the flow information into a Modbus TCP/IP channel stops, i know we can see if the Ethernet port has been disconnected phisically, but i wonder if is there a way to detect if there is no information going through the channel, independently of the phisically connection.

i am reading the values from a 1420 emerson gateway using Read_Var block in Unity Pro - M340 PLC, there is a entry called Gest where i have to put a 4 Array variable of integers, i notice that the bits of one of these integers are constantly changing between 0 and 1, i also noticed that this bits stops in the last value when i lost communication with the Gateway, how could i take this information to monitoring the healty of the channel? any idea?

Thanks in advance pals!.

Do you mean monitoring the health of the channel in the PLC ?

There is an IODDT for the Ethernet ports, this will give you health and traffic information

https://www.youtube.com/watch?v=jD3UX10ycq8
 
Thak you to everybody, i used a timer and if one of the bits of the integer stops in 1, after a second it will mean that something is not going good in the channel.. this could be a little solution, but it would be great if i can get this from a status of the channel and not using a timer for every moment i have to put a read_var block to work.
i will make another test now, taking some status from the ethernet port, i hope it goes well, thanks again for all the ideas!.
 
Hi, from memory you can access all the diagnostics via the software. This may be a rough procedure as it was a few years since I have used unity pro. You need to add the CPU into the variable list. I think you need to add the rack and slot address or you maybe able to select from a list. Once complete an arrray will be constructed. Within this array all the diagnostics will be available for you within the software.

Hope this helps or pits you in the right direction.
 
Using the read_var and other blocks can be difficult and time consuming for some of the reasons you are dealing with now. If you are able to move to IOScanner functionality, you have a health bit which is directly accessible. You would need an NOE or NOC module in the M340 as the processor Ethernet port does not support IOScanner service. This service does not support all possible Modbus codes, so that could be a stopping point as well.

Totally guessing: to save money, let's skip the extra module and we can make it up in programming costs.
 
Using the read_var and other blocks can be difficult and time consuming for some of the reasons you are dealing with now. If you are able to move to IOScanner functionality, you have a health bit which is directly accessible. You would need an NOE or NOC module in the M340 as the processor Ethernet port does not support IOScanner service. This service does not support all possible Modbus codes, so that could be a stopping point as well.

Totally guessing: to save money, let's skip the extra module and we can make it up in programming costs.


Thanks for taking the time to answer, i know the NOE module, in a little training in Schneider i had to use both NOE and the Ethernet in the CPU, the final customer won't buy these modules, they already have the plc installed and are a lot of points that they have to read in the end of the world (Tierra del Fuego, Chile), they are not going to buy 100 NOE Modules.
I found a solution for my problem, i can use one bit of the integers of the GEST Array, it takes 15 seconds to change from 1 to 0 when i cut communication from the Gateway to the PLC, it works well for this project and i avoid using timers for every Read_var block i have to use. Thanks everybody for all the help!.
 
Thak you to everybody, i used a timer and if one of the bits of the integer stops in 1, after a second it will mean that something is not going good in the channel.. this could be a little solution, but it would be great if i can get this from a status of the channel and not using a timer for every moment i have to put a read_var block to work.
i will make another test now, taking some status from the ethernet port, i hope it goes well, thanks again for all the ideas!.

You should read help files.

This is from read_var help, it shows how to code communication and ok and error counters:

"Example including execution check


At a Glance

The following example illustrates the READ_VAR function with a management parameter check.
Programming the function

Programming in ST:
IF NOT %M21 AND %I0.1.2 THEN %MW210:4 := 0; %MW212 := 50; READ_VAR(ADDR('0.3.1.7'),'%MW',20,1,%MW210:4,%MW1701:1); SET %M21;END_IF;
  • the input bit %I0.1.2 controls the function,
  • the internet bit %M21 is used to test the activity of the function,
  • %MW210:4 := 0; initializes the management table to 0,
  • MW212 := 50; initializes the timeout value to 5 seconds.
NOTE: READ_VAR(ADDM('0.3.1.7'),'%MW',20,1,%MW210:4,%MW1701:1); syntax must be used for Modicon M340 PLCs as ADDR function cannot be used by a Modicon M340 PLC.

Programming the exchange check

Programming in ST:
IF %M21 AND NOT %MW210.0 THEN INC %MW214; IF %MW211 = 0 THEN INC %MW215; ELSE SET %Q0.2.2; INC %MW216; %MW217 := %MW211; END_IF;END_IF;
  • %MW214 counts the number of exchanges,
  • %MW215 counts the number of correct exchanges,
  • %MW216 counts the number of exchanges generating errors,
  • %MW217 stores the error message,
  • %Q0.2.2 indicates an exchange failure

"
 
Totally guessing: to save money, let's skip the extra module and we can make it up in programming costs.

Prescient that. See the response:

[...] the final customer won't buy these modules, they already have the plc installed and are a lot of points that they have to read in the end of the world (Tierra del Fuego, Chile), they are not going to buy 100 NOE Modules.[...]

Well if there are 100 to buy, then maybe the programming cost is less. How much are those cards anyway?

Anyway, with economics like this, maybe I should consider getting into this business.
 
Prescient that. See the response:



Well if there are 100 to buy, then maybe the programming cost is less. How much are those cards anyway?

Anyway, with economics like this, maybe I should consider getting into this business.

NOE I/O scanner isn't the answer to everything as it does have its own limitations but if all the slaves are Ethernet and the registers are contiguous it's a no brainer as its much easier to manage than multiple READ_VAR code

NOE Ethernet card with scanner is £1024 list, but if you buy the non Ethernet processor and an NOE it balances out, but you have to know what you need at point of specification to do that, i'm guessing this isn't the case on this one....
 

Similar Topics

Hi, I am using Prosoft Modbus-RTU module MVI69-MCM installed in a CompactLogix PLC. I have configured the MVI69-MCM to read slaves data and it is...
Replies
1
Views
1,880
Hi all. I have a Modbus ProSoft module in my setup with a capability of 30 clients (0-29), which I'm trying to monitor the Ethernet Connection...
Replies
0
Views
36
Hello everyone! I need to connect to a DL205-1 CPU and, as far as I know, I need to use DirectSOFT 6 software for the connection. Is anyone...
Replies
1
Views
71
Our punch press has a SLC500 with HELM weight module (HM-604-WM) for tonnage monitoring. The operator enters the weight range on the HMI, which is...
Replies
9
Views
217
Hello, I have been trying to figure out how to connect to and monitor a DLR that is on a remote rack from my PLC. The local has a 1756-L81E and...
Replies
0
Views
128
Back
Top Bottom