Siemens PLC MachMotion Overview Video
Summary of video: This 16-minute video is a walk-thru of the MachMotion CNC integration with the Siemens PLC. The demo covers sequence blocks, g-code integration, macros, and more. Contact us for additional information about our controllers and integration with Siemens, Allen Bradley, or other PLC platforms.
0:00 Hi everyone, this is Josiah at MachMotion. I'm going to demonstrate with you today the integration that we have with our Siemens PLC systems. We've got a very similar integration on the Allen Bradley platform and several other platforms soon to come. I'm going to walk you through our Siemens interface here real quick today. Just some of the basics.
0:21 We've basically got set up 64 sequence blocks in your PLC, that allow you to integrate that directly with your G-Code or with other features within your control system. And then you can do whatever you like to do within ladder logic when that sequence is triggered. So I'm going to show you some of the basic ways we utilize that. If you look at our G-Code here in the control system, I've got M 225; that's a sequence call macro that we’ve built, and then we’ve got 226 is a sequence wait macro. Then we're going to pass it an S parameter for which sequence you would like to call and which sequence you want to wait for, and then we have got a couple other optional parameters that you can pass. I’ve got commented out here; I'll talk you through those in a second. So if I run this, this is going to call the sequence Call Macro, and we're going to call sequence number 1. I'll talk through you a little bit more detail in a second here, but so we walk through here this runs all the way through this immediately; it completes immediately, and we're back to the top of the G-Code file. Let me step over to the PLC side now. This is one of those sequence blocks I was talking about.
1:37 We're naming it sequence number one that's a parameter input to the block. Then we've got a couple of those parameters that this block will either have input to it on the left side or as an output from the block on the right side. So when the macro runs and calls the sequence number one this internal bit, I've got these named as a table but really you could use any internal memory register or this could go straight to an output from the PLC. But when you call this sequence, your sequence bit is going to light up as active. So I got this dropped in the ladder logic here as a set of contacts, this will go active and then as soon as you do whatever you want in your ladder logic when you decide that you're done with a feature you were wanting to call, you can internally light up the sequence done bit. I’ve got that tagged back to the block. Here is the sequence done input to this block and then that will return to this waiting macro and then your G-Code can continue. So as a demonstration here we can drop a timer block into our code.
2:45 Let me put this right here between the start; we're going to start a timer. Let’s wait for 2 seconds, and then when the timer completes it's going to close this done output memory bit, that will come back to the sequence done. It looks like I accidentally dropped this in the wrong place. Let me patch that. Let me download this to the PLC. These internal blocks I'll walk you through a little bit more in a second, but these internal blocks, this is a pre-loaded library that we ship out in all of our Siemens PLCs. You'll get this with any of our VMC controls or any of our lathe turret systems. We have some canned operations for your tool change system and then this allows you to set up maybe your oiler or a chuck/tailstock, the kind of stuff that's a little more custom that you want to tailor towards your machine.
3:41 So here if we start to the top of this G-Code file, and I run this again, you can see the start that is lit up. We are waiting on the timer. When that completed, the G-Code completed. Watch that again here. We’re sitting here waiting for the sequence to complete. We waited 2 seconds, and then we continue through. This could be used in a lot of different ways. You can put this throughout your G-Code for different features that you want to do. Maybe you wanted to pause in your G-Code until you press some input or until an analog scale reaches a certain level.
4:14 Maybe you want to wait for a flow sensor to say that you got enough coolant in the system, and then you continue on in your G-code. Really the possibilities are endless there for you as a user in your ladder logic. We're trying to tie together the tools and give you the integration that you need between the CNC system and the PLC ladder logic system so that you can easily seamlessly integrate them. So you've got up to 64 of these sequences. This is what your canned system is going to look like when we ship it to you. You’ve got sequence number one and sequence number two here. And then I think we give you sequence number nineteen, and you can put anything in between there. Those are your user sequences you can use for whatever little canned features you'd like to add to the system. Within our own operation block, we have a bunch of the more basic features that you are more likely to see. This is a VNC system you’re seeing here. So this has shuttle in, shuttle out sequence. These are tied into our system. They will be utilized throughout the tool change. For a more indepth view on this, stay tuned for upcoming later videos.
5:34 Okay, now I’d like to go more into the optional parameters we mentioned. Let me comment this back into this G-code file and remove the parentheses around them so we're passing a V. That's the memory location in the PLC that we want to pass it to, and then this is the actual data that we want to pass down to the PLC. So when this sequence number gets called, there's also going to be a volatile memory address number one. These are access. You can use this data get block that we have canned for you in our library.
6:07: Drop this out here in your network. I'm going to address this to position number one. That's the same position that we're sending the data to. I'm sorry. This is the start that we're going to have it read all the time. And the index is position number one. We're going to pass the data; we're going to make a temp variable here. Temp data for demo. That’s we’re going to name it. It says that's not a current variable. We're going to define it as an internal variable. So now if we download this to the PLC, when I run this G-Code, let me load. Just dropping it into the PLC. Now when I run this G-Code file, you see this temp data is immediately passed to 500. That's the value that we passed in the G-Code. If I edit this and make this a 1000.
7:14: This is a 500. As soon as we press Cycle Start, it’s going to pass a 100. This is an easy way that you could send information from the CNC control system down to the PLC. We could send the current XY positions to the PLC. We could send any kind of analog data that we had or number of parts we were going to run and then the PLC could pick up on that and do sequencing along with what the CNC control system is operating under. We’ve got a lot of other blocks here in the PLC in canned libraries that we give you. I'm going to demonstrate a couple of these and then for more information why don’t you just give us a call, and we will talk you through any of the other features you're interested in.
8:05 This is our control Axis position block. This gets passed all day long what the current position of the machine is. So I'm going to make some local variables here. Exposition Y. We’re just going to call them Pos. To just stay consistent. I'm going to assign all these some local memory space.
8:50 Just assign each one of those. It gave it a memory address internally. I'm going to download this to the PLC. Okay. So the current position of each axis it’s saying is 0. If I go over here into machine coordinates, that is correct. If I jog the machine from an on screen jog here the X, I’m going to jog over .1358, we’re sitting at 2.28. That’s my X position. I can jog the Y Axis. Just kind of a neat thing that you don't usually see in your PLC systems.
9:39 We've got integrated straight in here at any point and time you could monitor the Axis position within your ladder logic and easily set something with internal here. Let's do this real quick. To demonstrate we could say if the X-axis is greater than, fill this out here. If the X position is greater than Y position, then we’ll close, and we’ll do Q0.0. We’ll turn on an output. Let’s not use that one. Q0.1. Just for demonstration purposes, we’re going to do Q0.0 This will be our spindle forward bit. This is on a desk PLC here but just to demonstrate to you guys. Here this goes. Okay, so if the X position is greater than the Y position. It's not currently. If we jog the X volume back, or greater than, and if we jog the Y position back, as soon as the X position is greater than the Y, we can turn on the outputs based on the machine’s position. So maybe we've got a coolant spray from the right side of the table and a coolant spray from the left side. And as you travel past a certain point, you want to switch which nozzle you activate. You can put the solenoids from your PLC system, and you could easily switch back and forth between which coolant nozzle you're going to run based on the x-axis position.
12:02 We’ve got several other blocks like this that we can monitor the control’s state. We can see whether it's enabled, whether it’s idle, whether it’s jogging; we can get the data like we showed in the G-Code file. We can do messages from the PLC back up to the control system. So let's do instead of this, let me slide over here, instead of turning the spindle on. Let me delete that. We’ll drop a message block in here. And we’ll say as soon as the X-axis is greater than the Y-axis, we’re going to send message number 1. I'm sorry this is going to go right here. We’re going to do a comparison on the start bit. If the X position is greater than the Y position, then we're going to send message number 1 to the control system. Or we’ll send message number 6.
13:08 You can index these messages and then within the control system you set up what that message is going to do. So let me go over here to some of our, don't get hung up in this too much. I'm just trying to demonstrate what some of the capabilities of the PLC system are. If you want more info on that we can go into there. I’m going to set the odbus device. We’re going to look at PLC message number 6. Set up the action. I want to throw a warning and say “Feed Hold,” we’ll print to this screen. Message 6 is active. We’ll save that. Okay. We’re going to load this onto the PLC. It looks like that was active immediately. Let me bypass that. We’ll make it not active for a second, so you can see it trigger. So on the PLC so we’ll jog the Y-Axis back so it’s greater than the X-Axis, the messages are all cleared. If the Y-Axis ever jogs greater than the X-Axis, we get a warning message. Message 6 is active. It's going to feed hold the system if that would ever happen. It's kind of a goofy demo system here, but you get the concept that you can really easily monitor different conditions within the PLC and be able to message status’ back to the control system and create an error condition within seconds of a set up here. So that's our message system. We’ll skip over a couple of these. That's a real handy thing that's something which could easily take a lot of integration on a serial system; so that's our message system: real quick and really handy. This is Josiah with MachMotion, I hope this has been useful, until next time...