Sign in to follow this  
Followers 0
MichaelRae

Premium PLC/Unity Modbus TCP problem

7 posts in this topic

Hi, Im having problems with a Premium PLC trying to get it to talk to a modbus TCP device. Im sure im missing something really obvious but just cant quite get it. im trying F NOT %MW790.0 and %s6 THEN (* Test the activity bit to start the transfer *) READ_VAR(ADDR('{1.3}SYS'), '%MW', 1, 1, %MW790:4, %MW799:1); END_IF; i have set under networks the xway addr of 1.3 to the ip address of the device and it is set in "Mono" mode. the PLC can ping the device and vise versa. when it is running looking at the managment report i get %MW790[0] - changing values (session id) %MW790[1] - cycling with %s6 between 0 and 4863 looking at some schnieider documentation does that suggest from the most significant byte an operation report of 10010 suggesting "lack of line resources" and "length error" ? the PLC is communicating using read_var/write_var to another plc in the network just fine. using wireshark on the destination device i dont see any network traffic between it and the PLC. the device responds to modbusTCP packets just fine as if i tell citect to read/write data from the device it works just fine. any suggestions? im stumped.

Share this post


Link to post
Share on other sites
You could use I/O Scanning service.. see in the Ethernet module configuration Anyway... first you don't need to test the activity bit every second by using the system bit 6. And remember the system bit is on for half second and off for other half second. You have just to wait for the bit activity goes off and then give a new start. But before starting you must configure the call by setting the time-out and the length of the string message... if I remember they are the 3rd and 4th word of the report. It could be another problem in the address...... but...... My suggestion is to use I/O Scanning!!! Easier and faster

Share this post


Link to post
Share on other sites
using the %s6 it give it enough time to pause that i can see the error report in the animation table otherwise it just appears as 0 whilst as it cycles. i have the 790.2 timeout set at 200 and 790.3 length i have set at 2 (although have tried values raning from 0 to 50) with no change. it isnt even sending packets out of the plc. is there something i need to do to ensure it gets line time? there are two other requests operating (one read one write) that are going to another PLC via TCP which work just fine. is this possibly the cause of the 4863 error ?lack of line resources? i have tried using IO scanning ang it went haywire on me. it started sending a packet storm from the PLC to the device which wouldnt stop even after i turned off io scanning and reloaded the original program. i had to do a hard reset on the plc to get it to stop streaming packets. the plant is currently offline for upgrades so i have the freedom to do a little testing and development but that wont be the case for long any help ?

Share this post


Link to post
Share on other sites
you've just to set the needed frequency of the request "repetitive rate"

Share this post


Link to post
Share on other sites
i had set that repeat rate at something reasonable for the application ~1000ms iirc. but it was sending packets even after i had disabled io scanning .. ive now resorted to using IO scanning and it is working ok.

Share this post


Link to post
Share on other sites
Hi, If you don't want to use IO Scanning (on some M340 Cpu with Ethernet port on board, you can't use IO Scanning, you have to add an ethernet card), with READ_VAR and WRITE_VAR on Unity, the address of the distant PLC is the IP Address. Example with Write VAR (in french): IF NOT %MW860.0 AND re(TOP_sec) THEN (* com.ok et changement états *) WRITE_VAR(ADDM('10.0.10.10'),(* vers advantys stb *) '%MW', (* type *) 0, (* 1er mot de réception *) 4, (* nombre de mot en réception *) %MW853:4, (* mot a transférer *) %MW860:4); (* controle communication *) END_IF; Here, the advantys STB address is 10.0.10.10. One thing important is that you have to write the IP Adress of the PLC you want to talk with in the configuration of connections (Communications->Networks ->Ethernet_1) It is another solution to your problem.

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