Sign in to follow this  
Followers 0
BenJones

FX3u and FX3u-485ADP-MB and RS485 communication

10 posts in this topic

Hello, I'm pretty new to PLC programming and haven't set up a MODBUS protocol before. I have read all the manuals and downloaded the FB's from the Beijer website. I've connected the slave and have been trying to get comms for 2 weeks without much luck. Today I had the red "Send" light flashing on the 485 card and error message 211 which is as far as I've got. Cant even believe I got the light flashg to be honest. All I need to do is read data from a slave (kWh's etc) but I'm not sure the best way to go about programmingit it. I'm trying to use the ModbusFX3uMASTERADP_MB_CH1 FB at the moment but not totally convinced how it works. I've gone into Parameter / PLC and set up PLC system(2) for CH1 with 485 protocol etc but not sure if I need 8 bit, Even etc. I dont even know if I need to set this ? (It doesn't say in the slave manual if its ODD / EVEN/ 8bit etc, so I'm a bit lost) : http://uk.rs-online.com/web/search/searchB...t&R=0531226 http://docs-europe.electrocomponents.com/w...66b80da29db.pdf Ive set up the protocol with MB_192_8E1 which I believe makes it 19200 baud rate. Not quite understanding the addressing or command codes. My boss wont pay for any training for me (he's from Yorkshire), so I've spent hours reading the manuals and trying to work it out. Any help would be very useful and thanks in advance. Cheers, Ben

Share this post


Link to post
Share on other sites
What is your hardware configuration? What board is installed in the CPU? What module are you using for communications. I assume you are using GX IEC Developer since you mentioned function blocks from Beijers.

Share this post


Link to post
Share on other sites
Hello Ben, Please be more specific. What kind of help you would like to get? Edited by Inntele

Share this post


Link to post
Share on other sites
Hello. You probobly use the GX IEC Developer for programming. In order to get the 485 MB module to work i belive you also need GX Developer. This because a win socet driver file you need dosen't come with the IEC version for some reason( Mistake from Beijer) You also need to make som changes in your libraries. (Had the same prob. as you) I adwise you to contact Beijer and get support and nessasary files from them. I don't think they will charge you anything for this. You don't need to make any changes in any parameters when you have the right software.

Share this post


Link to post
Share on other sites
Hello all, Thanks for all your advice. I called Beijer and got the updated variables list as advised, that wasn't the problem it was just a problem with my program. I've now got communications with the Modbus slaves (even though it says ERROR No. 211). Which I'm not bothered about because I'm reading the correct numbers from the slaves. I've attached a project backup file of the program which works, so feel free to use it if you ever need to read from MODBUS slaves. Just change the .doc to .pcd I do have one final question as follows. The Function Block reads from 2 slaves (kWh meters in this case) using a counter (counting from Station No. 1 then Station No. 2 cyclicly) and writes the answer to a register "ReadData", this is set as D642. The only problem is that it keeps overwriting this register with the answers it reads from the slaves. I'm trying to find a way to program it so that it writes into a different register for each slave station. I've put 2 exrtra lines of code at the end of the program (last 2 lines to try and MOVE "ReadData) to different registers but it doesnt work, it just writes all values to a different register. I've uploaded a 2 pictures to show you what I mean. Any help would be appreciated to let me know how I can write the answers from the "ReadData" register to into 2 seperate registers, Thank you in advance, Ben MODBUS_PROGRAM.doc Edited by BenJones
2 people like this

Share this post


Link to post
Share on other sites
Hi Ben, You did mistake, because you try to use two communication procedure for one communication channel. The decision is not so easy, as you think. While... looking at the functional block, can assume that you can switch between two Modbus Addresses on "Finish" flag.

Share this post


Link to post
Share on other sites
Hello, I'm not totally sure what you mean by "two communication procedures". I put up 2 screenshots of the same code, but these 2 lines are only programmed once in the program (I just added them twice to show you that the outputs are the same from the two stations). Sorry to confuse ! Maybe the problem I have is that there is a delay with the modbus communications so maybe it hasnt got enough time to move the data to different registers ? Surely this function block should have been made so that so that the data which has been read from the slaves should be written to different registers in the master so that it doesnt keep over-writing the data ? Ben

Share this post


Link to post
Share on other sites
On 1/29/2010 at 0:30 AM, BenJones said:

Hello all, Thanks for all your advice. I called Beijer and got the updated variables list as advised, that wasn't the problem it was just a problem with my program. I've now got communications with the Modbus slaves (even though it says ERROR No. 211). Which I'm not bothered about because I'm reading the correct numbers from the slaves. I've attached a project backup file of the program which works, so feel free to use it if you ever need to read from MODBUS slaves. Just change the .doc to .pcd I do have one final question as follows. The Function Block reads from 2 slaves (kWh meters in this case) using a counter (counting from Station No. 1 then Station No. 2 cyclicly) and writes the answer to a register "ReadData", this is set as D642. The only problem is that it keeps overwriting this register with the answers it reads from the slaves. I'm trying to find a way to program it so that it writes into a different register for each slave station. I've put 2 exrtra lines of code at the end of the program (last 2 lines to try and MOVE "ReadData) to different registers but it doesnt work, it just writes all values to a different register. I've uploaded a 2 pictures to show you what I mean. Any help would be appreciated to let me know how I can write the answers from the "ReadData" register to into 2 seperate registers, Thank you in advance, Ben MODBUS_PROGRAM.doc

May I have a copy of your program please?

Share this post


Link to post
Share on other sites
On 1/29/2010 at 9:30 PM, BenJones said:

Hello all, Thanks for all your advice. I called Beijer and got the updated variables list as advised, that wasn't the problem it was just a problem with my program. I've now got communications with the Modbus slaves (even though it says ERROR No. 211). Which I'm not bothered about because I'm reading the correct numbers from the slaves. I've attached a project backup file of the program which works, so feel free to use it if you ever need to read from MODBUS slaves. Just change the .doc to .pcd I do have one final question as follows. The Function Block reads from 2 slaves (kWh meters in this case) using a counter (counting from Station No. 1 then Station No. 2 cyclicly) and writes the answer to a register "ReadData", this is set as D642. The only problem is that it keeps overwriting this register with the answers it reads from the slaves. I'm trying to find a way to program it so that it writes into a different register for each slave station. I've put 2 exrtra lines of code at the end of the program (last 2 lines to try and MOVE "ReadData) to different registers but it doesnt work, it just writes all values to a different register. I've uploaded a 2 pictures to show you what I mean. Any help would be appreciated to let me know how I can write the answers from the "ReadData" register to into 2 seperate registers, Thank you in advance, Ben MODBUS_PROGRAM.doc

On 1/29/2010 at 9:30 PM, BenJones said:

Hello all, Thanks for all your advice. I called Beijer and got the updated variables list as advised, that wasn't the problem it was just a problem with my program. I've now got communications with the Modbus slaves (even though it says ERROR No. 211). Which I'm not bothered about because I'm reading the correct numbers from the slaves. I've attached a project backup file of the program which works, so feel free to use it if you ever need to read from MODBUS slaves. Just change the .doc to .pcd I do have one final question as follows. The Function Block reads from 2 slaves (kWh meters in this case) using a counter (counting from Station No. 1 then Station No. 2 cyclicly) and writes the answer to a register "ReadData", this is set as D642. The only problem is that it keeps overwriting this register with the answers it reads from the slaves. I'm trying to find a way to program it so that it writes into a different register for each slave station. I've put 2 exrtra lines of code at the end of the program (last 2 lines to try and MOVE "ReadData) to different registers but it doesnt work, it just writes all values to a different register. I've uploaded a 2 pictures to show you what I mean. Any help would be appreciated to let me know how I can write the answers from the "ReadData" register to into 2 seperate registers, Thank you in advance, Ben MODBUS_PROGRAM.doc

 

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