Modbus Examples?
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5009
- Thank you received: 1443
27 Apr 2013 01:35 #33257
by Todd Zuercher
Modbus Examples? was created by Todd Zuercher
Anyone have any examples of controlling a VFD with modbus through Clasicladder?
I need to figure out how to run 8 Lenze AC Tech SF230Y drives. I would like to start/stop (all 8 together), set the speed, and monitor for faults to stop the machine if there is a problem.
Here is a copy of the communication manual for the drives.
Or would it be better to do this another way?
I need to figure out how to run 8 Lenze AC Tech SF230Y drives. I would like to start/stop (all 8 together), set the speed, and monitor for faults to stop the machine if there is a problem.
Here is a copy of the communication manual for the drives.
Or would it be better to do this another way?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5009
- Thank you received: 1443
05 May 2013 21:28 #33657
by Todd Zuercher
Replied by Todd Zuercher on topic Modbus Examples?
I think what I need the help with the most at this point is how to control what is written to the registers that I need to control when I need to control them.
Such as I need to write a 0 to register 48 of each drive to enable control of them.
Then register 1 needs to have certain bits changed to control the drives, (start,stop,lock,...)
Then to set the speed I need to write the speed in Hz(x10) to register 40 I'd write 3000 (for 300Hz)
Part of my problem is I don't really understand how this is supposed to work.
So are these registers constantly being read/written to, and I need to change what is being written in order to control the drive?
How do I make classic ladder change the values of the variables I set to use to control what the modbus is writing to the registers?
I need to find a modbus for morons tutorial.
Such as I need to write a 0 to register 48 of each drive to enable control of them.
Then register 1 needs to have certain bits changed to control the drives, (start,stop,lock,...)
Then to set the speed I need to write the speed in Hz(x10) to register 40 I'd write 3000 (for 300Hz)
Part of my problem is I don't really understand how this is supposed to work.
So are these registers constantly being read/written to, and I need to change what is being written in order to control the drive?
How do I make classic ladder change the values of the variables I set to use to control what the modbus is writing to the registers?
I need to find a modbus for morons tutorial.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7106
- Thank you received: 1177
06 May 2013 02:42 #33662
by BigJohnT
Replied by BigJohnT on topic Modbus Examples?
You might take a look at the gs2 component it might be real close if not just work out of the box if the modbus communications are the same or similar.
I don't know of any examples for classicladder modbus.
John
I don't know of any examples for classicladder modbus.
John
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5009
- Thank you received: 1443
06 May 2013 02:56 #33663
by Todd Zuercher
Replied by Todd Zuercher on topic Modbus Examples?
I took a cursory look at it but I wasn't sure if it would work for multiple drives. I thought that using classic ladder might make using the multiple drives simpler. But since i don't know the first thing about Classicladder (or at least I didn't before starting on this) how should I know..
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7106
- Thank you received: 1177
06 May 2013 03:02 #33664
by BigJohnT
Replied by BigJohnT on topic Modbus Examples?
I'm pretty good with PLC programming and classicladder but know less than nothing about the modbus part which is one reason the modbus part of the manual is not very informative (sucks). I have a GS-2 drive and use the gs2 component and it works well, that is the reason I suggested looking at it. Just looking again at it and I don't see how you could load 8 different gs2's... classicladder might be your best option. I'm guessing once you get past the first one the rest would be easy.
JT
JT
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5009
- Thank you received: 1443
06 May 2013 03:35 #33667
by Todd Zuercher
Replied by Todd Zuercher on topic Modbus Examples?
This is for a machine at work, when I have time to fiddle and study it, is on weekends and after work, but I don't have access to the machine then, When I am at work and have access to the machine I don't have time to futz with it. It makes making any real progress slow.
Please Log in or Create an account to join the conversation.
- bigalex
- Offline
- Premium Member
Less
More
- Posts: 148
- Thank you received: 3
06 May 2013 21:04 #33674
by bigalex
Replied by bigalex on topic Modbus Examples?
Hi Todd.
Are using Modbus communication on serial line or TCP/IP ?
In any case (I prefer to use TCP/IP) I think that into the Classic Ladder configuration you can configure the communication
parameters (which registers to read and wich registers to write) so you should be able to do what you want to do.
I've tried to communicate with 2 slaves on TCP/IP and Modbus seems to work fine.
The Classic Ladder configuration for the Modbus communication create a sort of I/O scanning on the Modbus line.
As I can see there are 16 available connections instance so you have 8 slaves X ( 1 read instance + 1 write instance) = 16 instances .
That means that you will raise the maximum available communication instances .
So you have to pack all the registers you have to write to a single slave (same for the read registers).
I know that there is an HAL component that maybe can fit your application (but I do not know much about it) and you can find some
informations HERE .
bigalex
Are using Modbus communication on serial line or TCP/IP ?
In any case (I prefer to use TCP/IP) I think that into the Classic Ladder configuration you can configure the communication
parameters (which registers to read and wich registers to write) so you should be able to do what you want to do.
I've tried to communicate with 2 slaves on TCP/IP and Modbus seems to work fine.
The Classic Ladder configuration for the Modbus communication create a sort of I/O scanning on the Modbus line.
As I can see there are 16 available connections instance so you have 8 slaves X ( 1 read instance + 1 write instance) = 16 instances .
That means that you will raise the maximum available communication instances .
So you have to pack all the registers you have to write to a single slave (same for the read registers).
I know that there is an HAL component that maybe can fit your application (but I do not know much about it) and you can find some
informations HERE .
bigalex
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5009
- Thank you received: 1443
06 May 2013 22:31 #33680
by Todd Zuercher
Replied by Todd Zuercher on topic Modbus Examples?
If it is infact limited to only 16, then this won't work for me. I need to write to one reg on each drive to enable them, then read another one to keep them enabled, then write to a 3rd for start/stop, and a 4th yet to control the speed. That makes 32
I had been looking at that a little, but I was not able to figure out how to install it from the info given on that page.
Would Modbus to Hal have to be installid on Master, or can it be used with 2.52?
I had been looking at that a little, but I was not able to figure out how to install it from the info given on that page.
Would Modbus to Hal have to be installid on Master, or can it be used with 2.52?
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 761
06 May 2013 23:14 #33681
by ArcEye
According to the wiki, the code is in the master
Yep
It is in ../linuxcnc-dev/src/hal/user_comps/mb2hal
but does not exist in 2.5.2
Replied by ArcEye on topic Modbus Examples?
Would Modbus to Hal have to be installid on Master, or can it be used with 2.52?
According to the wiki, the code is in the master
Yep
It is in ../linuxcnc-dev/src/hal/user_comps/mb2hal
but does not exist in 2.5.2
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23310
- Thank you received: 4858
07 May 2013 19:47 #33716
by andypugh
If you can use multiple drives then the trick is going to be the -n argument to give them all different names.
You could try it in a halrun window:
halrun
loadusr gs2_vfd -n drive1
loadusr gs2_vfd -n drive2
loadusr gs2_vfd -n drive3
And if there are no errors then
show pin
should list three sets of duplicate pins.
Replied by andypugh on topic Modbus Examples?
it isn't clear to me if it will work with multiple drives either, and I can't test it here.I took a cursory look at it but I wasn't sure if it would work for multiple drives.
If you can use multiple drives then the trick is going to be the -n argument to give them all different names.
You could try it in a halrun window:
halrun
loadusr gs2_vfd -n drive1
loadusr gs2_vfd -n drive2
loadusr gs2_vfd -n drive3
And if there are no errors then
show pin
should list three sets of duplicate pins.
Please Log in or Create an account to join the conversation.
Time to create page: 0.086 seconds