DLMUK
Member
Hi,
I need a bit of help from you more experienced programmers please. I have a bit of ladder logic, which "works", I don't think it is the smoothest but I have tested it on my PLC and it does what I want it to do which is...
I have a multiple RS485 modbus RTUs, they go into a serial server, then my PLC connects to the serial server via modbus TCP. The Serial server does not have a watchdog on it, therefore, if one RTU drops out, all the PLC sees is that the value of that particular RTU just remains the same.
Therefore my program looks at the input (which is constantly changing), saves the input value, then saves the input value again 1 second later. If the value hasn't changed then it activates a timer, if the timer doesn't get interrupted for 10seconds (10 matching values) then an error flag is generated.
I have this over 4 networks in an FB. What i want to know is, can I make it more concise? Reason being is that I have 46 RTUs and don't want to repeat anymore code than I need to.
Code can be found here...
https://www.dropbox.com/s/tj2em2az8dohx34/fb.png?dl=0
Thanks!
I need a bit of help from you more experienced programmers please. I have a bit of ladder logic, which "works", I don't think it is the smoothest but I have tested it on my PLC and it does what I want it to do which is...
I have a multiple RS485 modbus RTUs, they go into a serial server, then my PLC connects to the serial server via modbus TCP. The Serial server does not have a watchdog on it, therefore, if one RTU drops out, all the PLC sees is that the value of that particular RTU just remains the same.
Therefore my program looks at the input (which is constantly changing), saves the input value, then saves the input value again 1 second later. If the value hasn't changed then it activates a timer, if the timer doesn't get interrupted for 10seconds (10 matching values) then an error flag is generated.
I have this over 4 networks in an FB. What i want to know is, can I make it more concise? Reason being is that I have 46 RTUs and don't want to repeat anymore code than I need to.
Code can be found here...
https://www.dropbox.com/s/tj2em2az8dohx34/fb.png?dl=0
Thanks!