Drozerce Posted April 5, 2021 Report Posted April 5, 2021 Hi guys, I'm having a little problem here...I have a V700 and a weighing indicator XT1000 (www.thames-side.com). I'm using modbus RTU communication between these to devices. I have prepared my code and it seams that I have communication established, but still I can't read any data from the weighing indicator. I'm not sure where my mistake is...Is it by defining the reading registers or the length or ... Because at the output from Modbus R.I.R FB I'm not getting any error, i.e I'm getting for the Status Message "0", which means Status is OK and from MODBUS CONFIG FB Out Variable "Function in Progress" I'm getting also "0", that means the PLC and the Indicator have established the communication. Can someone from you guys help me? Or just to refer me where should I look for my mistake... I'm attaching the Project that I have and a Manual from the Weighing indicator. Vaga_Funkcionira.vlp UPUTSTVO-ZA-INDIKATOR-VAGA-XT1000-SA-PROTOKOLOM-KOMUNIKACIJE-MODBUS (1).pdf
MVP 2023 Flex727 Posted April 5, 2021 MVP 2023 Report Posted April 5, 2021 You need to change all your SB 2 contacts to Direct Contacts, not Inverted Contacts. You are continuously initializing your configurations on every scan, except the first. It won't work that way. I didn't go any further than that. If it still doesn't work after you fix that then report back and we'll take another look.
MVP 2023 Flex727 Posted April 5, 2021 MVP 2023 Report Posted April 5, 2021 Okay, I see another issue. You are reading 65 registers. When you place those registers into MI 1, you need to also have a vector of 65 registers (The values will go into MI 1 - MI 65). You seem to somehow be assuming all 65 registers will be stored in a single MI. You have other values that are stepping on that vector (such as MI 4 - Status Messages). And you are storing MI 3 into MI 10, which is also part of the vector you are reading from the weigher. One other thing, it appears you SET MB 3 to perform your MODBUS read. That's good, but you need to RESET it at the end of the MODBUS read function, otherwise you are trying to read on every scan and that won't work.
Drozerce Posted April 5, 2021 Author Report Posted April 5, 2021 18 minutes ago, Flex727 said: Okay, I see another issue. You are reading 65 registers. When you place those registers into MI 1, you need to also have a vector of 65 registers (The values will go into MI 1 - MI 65). You seem to somehow be assuming all 65 registers will be stored in a single MI. You have other values that are stepping on that vector (such as MI 4 - Status Messages). And you are storing MI 3 into MI 10, which is also part of the vector you are reading from the weigher. One other thing, it appears you SET MB 3 to perform your MODBUS read. That's good, but you need to RESET it at the end of the MODBUS read function, otherwise you are trying to read on every scan and that won't work. Hi Flex, thanks for the answer...but it's not clear for me, when you say that I'm reading 65 registers... How do I do that? Where can I see that? According to me: If you go to page 85 from the Manual from the indicator (6.5.10.2 Input Registers) all I want to do is to read from Address Register 30010, i.e Dec 9. That's why in Unitronics Software R.I.R FB for Start of Vector I have "9", pointing to this start address. And for Vector Lenght I have "2", pointing to the Lenght of 2 Words (from the Manual of the Indicator for Address Dec 9 and Lenght 2 Word). Is my logic complete false or?
MVP 2023 Flex727 Posted April 5, 2021 MVP 2023 Report Posted April 5, 2021 Your MODBUS read function block has a read length of 64 (sorry, I had a typo of 65 in my answer). For start of Vector you have 0 (zero).
Drozerce Posted April 5, 2021 Author Report Posted April 5, 2021 (edited) Hi, yes, ok... I probably send the version of the software with this values... I was triying something, that's why... But instead of that, in Start of Vector I have "9", refering to the Address of "DEC 9" from the Manual and for Lenght I have "2", refering to the lenght of 2 Words from the Manual. And also I have a reset MB3, at the end of this network, i.e after the R.I.R FB. Edited April 5, 2021 by Drozerce Adding a Printscreen, for clarification...
MVP 2023 Flex727 Posted April 5, 2021 MVP 2023 Report Posted April 5, 2021 Two things: In ladder rung 2 you are trying to activate a timer coil with SB 2. That won't work. A Delay Timer (TD) requires power flow to keep it activated for the full 2 seconds. Further, you are attempting to place two separate logic threads into a single ladder rung. Don't do that. You also need your timer to be self-resetting, or it will only activate once. I would also place a contact in front so you can turn your reading on and off. Your code for rung 2 should look something like this: Turn on MB 0 (or MB of your choice) to start reading every 2 seconds. Turn off MB 0 to stop. You can leave off MB 0 if you wish - it's not absolutely necessary, but gives you some added control.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now