CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sat Oct 19, 2019 4:13 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2 3 Next
Author Message
PostPosted: Tue Apr 22, 2014 6:40 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3494
Hi,

i've tried to reproduce that...for me the correct fb occure after insert it with input assistent.
But anyway if you have steps to repeat to reprocude it please let me know.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Tue Apr 22, 2014 1:22 pm 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Thank you Edwin.
Enclosed I am sending the project. Maybe you can try the same. When I am adding TCP Modbus server function block in MB_FBD, inserted block is not right.

Best regards,
Zdenko.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sat Apr 26, 2014 5:32 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3494
Hi,

on 3.5SP5 Release (July 2014) there is an solution for this issue,
because we recommend to have all in the configuration it should not be needed to use modbus fb's and call them
manually. (Sure this will be always possible but the easy way is to have everything called implicit by the system)

Holding Registers (Slave %I) can be configured to overlay Input Registers (Slave %Q).
This way they can be made updateable by the Slave's application code.
See Screenshot.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sat Apr 26, 2014 8:11 am 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Hi,

this will be great. Thank you.

Best regards,
Zdenko.


Top
   
PostPosted: Sat Apr 26, 2014 2:48 pm 
Offline
Frequent User
Frequent User

Joined: Fri Dec 23, 2005 7:36 pm
Posts: 179
Edwin Schwellinger wrote:
Hi,

on 3.5SP5 Release (July 2014) there is an solution for this issue,
because we recommend to have all in the configuration it should not be needed to use modbus fb's and call them
manually. (Sure this will be always possible but the easy way is to have everything called implicit by the system)

Holding Registers (Slave %I) can be configured to overlay Input Registers (Slave %Q).
This way they can be made updateable by the Slave's application code.
See Screenshot.

BR
Edwin


That is great news. Keep up the good work!

_________________
nOrM
=====
nOrM = Norman Dziedzic Jr.


Top
   
PostPosted: Thu May 01, 2014 4:15 pm 
Offline

Joined: Sun Mar 16, 2014 7:32 pm
Posts: 1
Hi All,

Is it possible to have a Modbus TCP server with the same port number per each slave ID and a unique I/O mapping for each of the slaves ? I'm not a very experienced Codesys user, just wondering whether there is a possibility to amend a TCP message processing somewhere in Codesys, which could allow me to point specific slave ID's to specific data maps ?

At the moment, if we have a one ModbusTCP_Slave _Device added to the devices structure it allows to have (simulate) all 255 slaves on the same port (as I understand this functionality comes by default). Each slave has the same I/O mapping. Now, under "ModbusTCP --> Configuration Parameters" there is an option which should allow to apply a Unit ID, tried to use it expecting to have just one slave active, but looks like it makes no difference at all - am I thinking correctly about the usage of this option ?.

Besides, tried to add two ModbusTCP_Slace_Devices with different port number and only in this way I did managed to get different I/O mapping for slaves.

Thanks


Top
   
PostPosted: Wed Aug 06, 2014 2:09 pm 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Hi all,

I like new Modbus functions support in 3.5SP5 (coils and discrete inputs).

@Edwin:
I like to change holding registers with RPi application. I made a configuration with overlay input and holding registers like you suggest. But unforunately it doesn’t work for me. Can you please suggest how to configure this to make it work.

Thank you.
BR
Zdenko.


Top
   
PostPosted: Thu Aug 07, 2014 6:20 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3494
Hi Zdenko,

please send me your project.

BR
Edwin


Top
   
PostPosted: Sun Aug 10, 2014 6:00 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3494
Hi Zdenko,
see attached example, this should show how it works, Pi is ModbusMaser and Modbus Slave at the same time (only for me to test purpose),
in case you use this with you Modbus Master which is running on you windows machine, please remove the Modbus Master from this project example.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Aug 11, 2014 8:45 am 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Thank you very much Edwin,

I understand the solution. It can be done. I tested it and works ok. But I must say that this is more like a work-around. It is not so easy to define all needed helping variables and program functionality if we have bigger project with a lot of holding registers.

I think it is easiest to use MB server function block from Modbus lib. In this case this functionality works ok. But unfortunately there are no coils and discrete inputs integrated.

It will be the best if you integrate this functionality directly in Modbus driver. It is normally used in industrial devices on the market. Do you have a plan to integrate this in the next Codesys release?

Best regards,
Zdenko.


Top
   
PostPosted: Thu Jan 22, 2015 2:32 pm 
Offline

Joined: Mon Feb 17, 2014 12:05 pm
Posts: 30
Any updates on this?

/U


Top
   
PostPosted: Fri Jun 16, 2017 12:28 am 
Offline

Joined: Wed Apr 05, 2017 12:02 am
Posts: 4
Edwin Schwellinger wrote:
Hi Zdenko,
see attached example, this should show how it works, Pi is ModbusMaser and Modbus Slave at the same time (only for me to test purpose),
in case you use this with you Modbus Master which is running on you windows machine, please remove the Modbus Master from this project example.

BR
Edwin



Hey Edwin,
Can you explain what's this part is doing? I can't understand what's it doing. Thank you


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Jun 13, 2019 2:43 pm 
Offline

Joined: Sun Jan 04, 2015 9:36 pm
Posts: 2
Is there any update?
I want to share Holding & Input Registers in the same way WAGO does in Codesys V2.3 (ADR 3000hex = %MW0).
Thanks!


Top
   
PostPosted: Sun Aug 11, 2019 3:19 pm 
Offline

Joined: Tue Mar 11, 2014 2:43 am
Posts: 16
The WAGO e!COCKPIT Modbus TCP library works well, in that you can locate the holding register data array at %MW0, and then locate your global variables overlapping. Then your variables work essentially like C2.3 %MW R/W modbus variables. Tip: If you declare the array starting at a number, that is used as the offset. For example Holding_Data AT %MW0 : ARRAY[100..200] OF WORD; this would be MB4x100 - 4x200, which is very clever.

FYI: This overlapping trick also works with the C3.5 modbus slave library, however when the master is stopped all variables are set to 0 / FALSE! I had to add extra array that I "save" and "load" when the modbus slave FB client count goes to zero. Not very elegant, but works. Also I did not see any way to offset the MB address, it always starts at 4x0.

I tried the built in modbus slave server but the check box for overlapping Input and Holding did not work for me unfortunately. I was using 3.5.14.10 so maybe its been fixed since then. This would be better than using libraries, however the way WAGO implemented this in C2.3 was the best in my opinion and was loved by many. I don't like using %IW and %QW because then the HMI has to retain all parameter values, and the PLC has no means of changing those variable values which is very limiting. Of, you have to implement complicated logic to look at two variables, ugh, no thanks!


Top
   
PostPosted: Thu Aug 15, 2019 6:03 pm 
Offline

Joined: Tue Aug 13, 2019 3:46 pm
Posts: 18
Hi everyone,
how can I insert the modbus server block in the project?
Can you tell me how I can insert more registers both in writing and in reading because in the menu 'modbus tcp slave devide iec objects I have only 10 registers and I don't know how to add them.
Thank you all for your answers.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2 3 Next

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited