Large project, need assistance with ideas

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
hi!

Background on me:
Self learned programmer mostly on LOGO, s7-1200, regular HMIs and WinCC Flexible 2008 Runtime. Only smaller projects.

The "Problem":
I have a customer that is going to buy containers and equipt with a small control unit. Very small and easy program to do and only need a LOGO. The real issue here is that he will have 700 of these, not at once but he will buy some every year. These are mobile containers he will move around his grounds.

His initial thought was that he would just build one cabinet for each and have a LOGO to control it. But I think this is a bad idea. Try changing the settings on 700 LOGOs. It will take forever.

So I thought of having a master PLC like s7-1200 ( if it can handle it) and 700 slaves (LOGOs) on the containers. And one more option is to have some master containers and some slave containers (hard wired). Maybe 1 master control 2 slave container, so that I get 233 slave to control from my s7-1200.

No matter how I arrange the structure here it all comes down to how to program 700 identical units in the s7-1200 the best way.

One vision I have (don't know if it's possible) is to make one program and then somehow make a loop and control which tags are used. Example:
1. Loop slave = 1
2. Connect to slave = 1
3. GET values from slave = 1
4. Run Logic on slave = 1
5. PUT values to slave = 1
6. Done slave =1

Start Loop again but set the slave to 2 until all slaves have been gone through and the start over.

One more thought is to make it with Funtion blocks, but the downfall here is that I have to copy it 700 times and then write all the diffrent tags one by one. And when I update the function block I have to update the block on each one, = time consuming.

As a bonus question: How do you connect two subnets? 192.168.1.x and 192.168.2.x ? Is this made automaticly with a router?

Oh, and one more thing. He wan't logging from each container so that makes like 2000 logs. problem: Can a runtime system handle 2000logs? And is there a way of logging from an array in WinCC Flexible 2008 Runtime? If you can't , can you log from an array in WinCC TIA Runtime? If you can't is there a way of doing it? Maybe with script that copy the whole array to internal tags?

/Tim
 
Last edited:
Sound like that you need STL or SCL coding at Siemens. This could be easier with SCL.

On STL you can only point to variables with real address, not with symbol name. On STL you can point with symbol name, so it will be easier and program changing don't effect so much to code.


On older siemens 300/400 there is only STL with default and SCL is optional software with license.

Not sure but I think that TIA portal (CPU 1200/1500) supports SCL without additinol licenses/software?


1200 cpu sound little bit too small so 1500 would be better.


One way can be to make first UDT with variables (for reading and writing different UDT)

Then make two DB's and inside them make array of these UDT's.

On code you need then only one reading and write block (you can use same instance data block for FB) if you use only one communcation at time.


Before writing you need to copy from DB's UDT data for correct slave (STL or SCL coding)

slave 1 -> Pointer=1
slave 2 -> pointer=2
..
slave 233 -> pointer 233

Then in SCL-code you to can copy data to

slave.write1 = DBx.slave[pointer].write1 (UDT data variable 1)
slave.write2 = DBx.slave[pointer].write2 (UDT data variable 2)
...
slave.write10 = DBx.slave[pointer].write10 (UDT data variable 10)






You can do do this also on STL coding, but then you can only use dbxx.dbw.. adresses. Also if you make changes to UDT so that there is more variables -> STL coding points to wrong varibles if you don't repair also pointer.

ex. UDT is 10 reals long

slave1 data start with address dbxx.dbw0 and slave2 data start from address dbxx.dbw40

If you change UDT and it is 15 reals long

slave1 data start with address dbxx.dbw0 but slave2 data start from address dbxx.dbw60

With SCL changing UDT won't make so much effect, because it looks to symbol names.
 
Last edited:
Please do not take this wrong but my idea for you is to partner with or sub this out to someone with more experience in this area and work with them to learn.
...YMMV...
 
rQx said:
As a bonus question: How do you connect two subnets? 192.168.1.x and 192.168.2.x ? Is this made automaticly with a router?

I can't be a lot of help with Siemens (have done a bit, but like you all small stuff), but this one I can help with!

In general, this would be done by a router, or Layer 3 switch. The router has an IP address on both networks (typically 192.168.1.254 and 192.168.2.254) and you set the gateway address in your PLC to the one that corresponds to it's network (e.g. if your PLC is 192.168.2.210, you would set the gateway in that PLC to 192.168.2.254). When this PLC has to send a message to something on the 192.168.1.x network, it will address it to 192.168.1.x but send it to the router for forwarding to the remote subnet.

However, in an application like this, there's a simpler way - one that requires less expensive hardware. If your subnet mask on all your devices is 255.255.255.0, then each PLC will only be able to talk to PLC's that share the same first 3 octets of their IP address - i.e. 192.168.1.xxx can only talk to 192.168.1.xxx.

If you set all your subnet masks to 255.255.0.0, they can talk to anything with the same first two octets - i.e. 192.168.1.xxx can talk to 192.168.2.xxx, and more broadly - 192.168.xxx.xxx can talk to 192.168.xxx.xxx.

Then you can go anywhere in between. If your subnet masks are x then you can talk to -> y (see below)

255.255.254.0 -> 192.168.0.xxx or 192.168.1.xxx
255.255.252.0 -> 192.168.0.xxx through 192.168.3.xxx
255.255.248.0 -> 192.168.0.xxx through 192.168.7.xxx

And so on.
 
I don’t do a lot of Siemens work but in this case it really doesn’t matter
I would use a separate PLC on each unit each running the exact same program
Connected over a high power wireless Ethernet
If these units have to be moved around than I would stay away from hard wiring anything sooner or later the connection will fail.
The last thing you want is 1 single failure to take down all 700 units.
This would give you the ability to upgrade the PLC program as needed.

Then write an application in Microsoft Net Studio to monitor all the units, Status, Alarms whatever you need you really don’t need a PLC to monitor the units unless you want to do it that way.
You can also use the wireless Ethernet to download and upload data as necessary.
It could be to just 1 unit a select group of units or all 700 with just a touch of 1 button it’s all in the way you set it up.

Yes you will need to use multiple subnets but it’s no different than connecting over the internet to a remote PLC. Set up the subnets to divide then into groups or however you want
If you want to do data logging then all you need is to add it to your net studio code and create a database. The size of the database would only be limited to the size of your hard drive.

If this was my project I would use a separate application to check for and post alarms it could be on a separate PC to increase reliability

As for software licensing I only see that you need 1 license for the communication driver that you use with the Net Studio application.

As Russ said this project may be a bit much for you and you may do better to sub out part or all of it. And use it as a learning experience.
 
I'm not quite sure what you would need to change in each LOGO, but a small HMI (something like a KP300) might make that easier if it is just parameter changes, instead of logic. However, the LOGO already has its text display and keys, so I'm not sure how much that helps.

One more thought is to make it with Funtion blocks, but the downfall here is that I have to copy it 700 times and then write all the diffrent tags one by one. And when I update the function block I have to update the block on each one, = time consuming.

The upside of doing the FB route is that you can process every single slave at the same time. This is usually required because of speed constraints, and a 1200 probably wouldn't be big enough for all 700. If the application is very slow, and you have time to cycle through them one at a time, it might be easier to do it the way you described.

Note that when you update the FB, you really only need to do anything in the main program calling it if you change the interface. If you change the internal logic, and add a few internal tags (stat/temp), the project recompile should take care of everything. I believe it is only when you change the in/out/inout tags that the main program needs to be addressed. Typically, when I make an FB, I don't create the rest of the instances until I've finished testing it on the first. It saves a lot of needless work as the in/out/inout params change.

As a bonus question: How do you connect two subnets? 192.168.1.x and 192.168.2.x ? Is this made automaticly with a router?

What ASF said below is exactly correct. Normally this is done via a router, but if you change the subnet mask, you can join two subnets. Note that this must be done on BOTH sides, or communications could have weird errors. 192.168.1.2/255.255.0.0 (device A) will be able to send messages to 192.168.2.2/255.255.255.0 (device B). However, Device B will not be able to send any messages back (unless there is a router) until you change it to 255.255.0.0 as well.

Oh, and one more thing. He wan't logging from each container so that makes like 2000 logs. problem: Can a runtime system handle 2000logs? And is there a way of logging from an array in WinCC Flexible 2008 Runtime? If you can't , can you log from an array in WinCC TIA Runtime? If you can't is there a way of doing it? Maybe with script that copy the whole array to internal tags?
WinCC Advanced v13 only supports 100 logs, but it supports 6144 tags per log. Why does he need 2000 logs? Thats more than the number of containers! How many tags need to be logged per container? Do the logs need to be seperate?
 
One other question: If he wants data logging from all of these individual containers, how will they be connected? Will everything be wired Ethernet, or WIFI, or using cell modems? Will the communications be reliable, or might the containers need to buffer data to make sure it gets added to the communications log? Does it matter if some data is missed?

This project has the potential of needing a full SCADA type system, instead of just an HMI for data logging.
 
How much are you trying to change, control?

I think it would be a bad idea to have one single PLC in charge of 700 logo's.

Perhaps a better way would be to use an OPC server. That would make it relatively easy to connect to all devices and load data. But again, 700 is a huge amount. You could develop your own dedicated board even!

Often, the easiest way to hook up to multiple nets, is to have multiple Ethernet interfaces.
 
Lare: Thanks for the directions. I haven't used UDT so I started to read about it and it seems like a good suggestion you got there.

RussB: Yes, the thought has crossed my mind and maybe in the end it will come down to that but I like to get a grip of the problem before I rush into something (rushing into doing it myself, or rushing in to let someone else do it). Either way I don't think my customer wants to pay to mush for this container control and I don't think he knows what he asks for either (both in way of cost and complexity)

ASF: I see, but this will also be connected to an existing network that has subnetmask 255.255.255.0, maybe that will be a problem? It's not a big concern for me since they have a separate company working with the network there but it's always nice to know how it's done :)

GaryS: Yea, the brand is not that important in this matter. I agree that it would be great having each machine running it's own program. But the way I see it is that if my customer wan't to add a function and I would have to download the program to 700 PLCs, it would take very long time. But that's pretty mush my only concern regarding letting each PLC handling its own program. I have never worked with microsoft NET studio, I would prefer working with something I'm familiar with. Regarding the wirless network it has crossed my mind but since this will make the whole installation mush more expensive I'm not so sure we can go down that road.

MK43: What I want to change is parameters and possibly programs. If my customer want to change a function I will need to download the program to 700 units = time consuming :) . The cycle time is no problem it can be several seconds/minutes. It's a temperature/humidity control unit he wan't to do. I agree with you that testing the FB first is critical ofcourse, but also here a change to the FB later on would be time consuming if I have to update every block call. I'm sorry I was unclear, he wan't to log (if possible, not necesary) humidity and temperature of the container and possibly some other values. So maybe three tags per container and I think I can make three logs with 700 tags each then and problem solved. But I don't think that you can log values from Array can you? It will be wired ethernet cables and it's not critical that if you miss the logging.

Boneless: Not mush. It's a temperature/humidity control unit he want's. So basicly a sensor temp/humidity and a fan. comparing inside and outside temperature and run the fan when the conditions are right. So it is some setpoints that will have to be changed. I agree that it would be better to have one control unit for each container. But my concern is that he in the future want's to add something to the program and then I will have to download the program to 700 units. If only I could find a way to download programs to 700 units automaticly.

Note that this is only me trying to make this as easy for me and the custmer. Originally he just wanted 700 cabinets minding their own buisness. Maybe I over complicate this but I think it's a good idea to have a central control over the containers and change atleast the parameters and managing the alarms.

Wow, that took a while.. ;)

/Tim
 
rQx said:
ASF: I see, but this will also be connected to an existing network that has subnetmask 255.255.255.0, maybe that will be a problem? It's not a big concern for me since they have a separate company working with the network there but it's always nice to know how it's done

The subnet mask is not a network setting, it's an individual device setting. So you can set the subnet mask to whatever you want on your devices to make them talk to one another.

That being said, if there's an IT guy already looking after the network, then leave that one entirely in his court. Almost certainly he'll either have a router set up already, or will set one up for you. Just make sure you sit down with him and work out the fine details before you put together your proposal - routers are expensive, and you don't want to be caught on the end of a "you were supposed to supply that as part of your scope" debacle ;)
 
I have watched this thread read all the opinions and my original thought still stands
I would never consider using a single controller to control 700 remote units that’s a formula for disaster.
1 single component failure out of many interconnected components could lead to all 700 units failing at the same time. With product in units that could lead to millions of dollars in losses very quickly. I don’t think your client would like that, and I certainly would not want to be in your shoes if that happened. Plus the demand on the communication network would be huge.

As for code complexity it would actually be simpler with all the units running exactly the same small ladder code. You only have to write the code for the first unit and download it to all the others after it’s tested and running.

As for the time required to download to all 700 units I don’t see that as a problem. You are certainly not going to receive all 700 units at the same time. In fact I would expect they will be spread out over 6 months or more. Just down load the program and set the IP as they come in or at the same time you install the panels. That would be a very small ladder code that would only take a few seconds to download. I would think you could download several hundred in a single day. Even doing it locally

As said before if you have an IT guy on site anyway let him deal with the network setup, selecting hardware, setting up routers, assigning IP addresses and so on. That lets you off the hook for that. (And also puts the responsibility for the communication on him) All you have to deal with is the ladder code for each unit and that’s the same code in each unit.

Form what I see you only need to read about 4 to 5 words of data from each unit so the actual data packet for each is quite small so it would go fast. And the only time you need to write data to a unit is when you want to change the data, again that would go very fast. Verses the constant communication needed for remote I/O and single PLC.
An OPC server and HMI could handle this but with over 700 units it could tax the server a bit but it’s doable. I only suggested using Net Studio because it would allow you to the greatest flexibility to customize the application as well as provide a good platform for data logging (Should it be needed) and the cost would be much better then what you can get with an HMI. I am quite sure you could find somebody to write the application for you if needed or you could use it as a learning experience it write your own code.
If the communications dose fail at some point you can always connect to each unit locally and change the setup if necessary. And the unit will still operate normally.
As for the cost of the components you would be surprised how much the price per unit comes down when you place an order for over 700 units on one order with your local distributer.
If you wanted you could even put a small HMI on each unit for local setup and data changes or whatever you need.

There may be other solutions but I think in this case keep it as simple as you can no matter what hardware you use.
Keep us updated on what you decide to do, I for one would like to know how you make out.
 
I would only write/change only parameters with scada or main plc to slaves.
Local PLC should do all controls.
 
So may options, but how long will it take before you have 700 units online, in the one place?
I would put a SCADA on there for SP adjustment & monitoring etc.
But, that will require a decent network plan.

If the logic so simple & not time critical, why not make the logic as basic as possible so it lookup table based?
That way, u just change the tables & no logic.

I don't know of any other way to change multiple programs without a download.


Just a penny's worth

LC
 
ASF: Thanks, I'm a little bit more clear on this issue now :)

GaryS: Thanks for your time responding to the thread. I agree it is the best having each container managing its own control. My only concern was that when all 700 units was up and running and the customer descided to change something, then I have to download the program to 700 units. But if I maybe connect three containers master/slave (hardwired) it'll be more manageble coming down to 233 units. The 700 containers will be spread out thorugh several years from my understanding so I don't worry about the initial time downloading and building the cabinets :) Yes, that is one thing I look forward to, order 700 pieces of something and see what price I get :p

Lare: Yes I think that is what I'll do :) My main PLC to read and write SP though a GET/PUT loop that loop through all units. Since I can only have 3 active communications at once.

lostcontrol: I was thinking of having a PC running WinCC Flexible 2008 Runtime managing the alarms and setpoints, or you think maybe it can't handle it?

"If the logic so simple & not time critical, why not make the logic as basic as possible so it lookup table based?
That way, u just change the tables & no logic."


Can you explain? I didn't understand that :)
 

Similar Topics

I have a machine in design stage that has an AB Control Logix PLC, With 24 SEW Eurodrive VFD's.(Movidrive B). The VFD's are talking...
Replies
9
Views
2,397
I know with larger motors you do not want them to start with a contactor above 30HP or so because they will 'sag' the power in the plant and the...
Replies
4
Views
829
Hello, I'm digging all over the internet to find a solution for this but haven't come up with anything yet. We have 3 nearly identical machines...
Replies
2
Views
968
Hi All, On my site, the standard template for storing recipes in the PLC is to create a tag called PartRecipe which is an 2D array - for example...
Replies
4
Views
1,476
We have a panel with a 125HP VFD. We need to run #3/0 wire from the disconnect to the VFD & line reactor. The normal stuff is hard to bend and...
Replies
11
Views
2,806
Back
Top Bottom