Cunctiv.com

We know how the tech is done.

Gaming

How to Program a Siemens S7-300 Programmable Logic Controller

Have a Siemens S7-300 Programmable Logic Controller that you are unfamiliar with but need to program NOW? Below is a quick set of instructions that I have put together to help you get started programming a Siemens S7-300 PLC.

After loading the programming software and connecting a Siemens MPI cable between your programming computer and the PLC, open the SIMATIC Manager by clicking the icon on the desktop. The “New Project” window of the STEP 7 wizard will open. It is easier to use the wizard to set up communications with your PLC, but I chose to take the panoramic route. I thought I would learn more this way. Therefore, close the STEP 7 wizard window by clicking Cancel. If there are other windows or projects open, close them. We want to start with a totally new program.

Create a new project by clicking the new project button on the toolbar in the upper left corner of your screen.

The New Project window opens. Here you will see the existing programs located on your computer. Near the bottom of the window, you will see the Name: input form. Enter the name you want for your new project and click OK.

A new window will open showing the name of your project at the top. You will also see your project in the window on the left side of the screen at the top. Right click on your project and choose “Insert New Object”. Choose the device to program. We will be using the SIMATIC 300 station, so choose that selection.

You will now see SIMATIC 300 appear in the right window of your screen. It should be highlighted in blue. Click anywhere in the window to make the blue disappear. Double-click SIMATIC 300 and it will move to the left window and “Hardware” will appear in the right window.

Double click on “Hardware” and two (maybe three) new windows will open. On the left will be SIMATIC 300 – (the name of your project). The window on the right will be the parts catalog.

Look in the right window, the parts catalog, and click on the plus sign next to SIMATIC 300.

Click the plus sign next to RACK – 300. Click and drag the rail to the left window. You will now see the Slots window appear. This is where we will place our PLC components.

We will first choose our CPU. Looking at the parts catalog, in the SIMATIC 300 tree, choose the CPU you are using. We are using the CPU – 300, so click on the plus sign next to that option.

Now look at the upper left front of your PLC. This is where you will find the PLC model. I will use CPU313C-2 DP as an example, as this is the PLC model I use.

Find this CPU in your parts catalog and click the plus sign. You will now see some part numbers.

Look back at your PLC. Locate the door that covers the MPI port. This will be the lower left side of the PLC. You will find the part number on the bottom of the door. The part number of the PLC that I am using as an example is 313-6CF03-0AB0.

Find this part number in the parts catalog. You will notice that this is another folder. Open it and you will see V2.0 and V2.6. Look back at the PLC, open the door that covers the MPI port, and just above the MPI port you will see V2.6.3.

Go back to the parts catalog and click V2.6. Notice how a slot in the left window will be highlighted in green. I think it will be slot n. 2. (Slot # 1 is reserved for power supplies.) This is where you will drag and drop your CPU. (Note that the software will not allow you to put the CPU in any other slot than slot # 2).

When you release the mouse button over slot n. 2, a new window will open, “Properties – PROFIBUS interface”. Click new, a new window opens, click OK, and then click OK again. We are not setting up a network at this time.

You will now see your CPU and associated hardware listed.

Double-click on the slot that shows your DI16 / DO16 (Digital In / Digital Out).

A window with three tabs will open. The first tab will be General, the second tab will be Addresses, and the third tab will be Entries.

Open the “Addresses” tab. We need to change the default addresses. Do this by unchecking the System Default button and changing 124 (or whatever address it has) to 0. Do this for both Inputs and Outputs.

Now we need to change the node address. Go back to the window where you double-clicked DI16 / DO16 and double-clicked slot 2, the 313-2DP CPU slot.

The Properties – CPU 313C-2DP window opens.

Look down the window a little more than halfway and find the Interface area and click Properties. Another window will open, “Properties – MPI Interface CPU 313-2DP”.

Change the address to meet your specific criteria. I know that my laptop, which I am using to program my PLC, is always addressed as 1 and my target PLC is usually addressed as 2. You will probably be the same.

Now click MPI (1) and click OK. Click OK again to close the Properties window.

Save and compile by clicking the icon on the left of the toolbar.

Download the hardware configuration to the PLC by clicking the download icon located on the toolbar.

A window titled “Select target module” should open. Click OK.

Another window titled “Select Node Address” will open. You should see a list of the node address for the PLC you are working with as you configured it in a previous step. Otherwise, click View and click the node address that appears and click OK.

Return to the SIMATIC Manager (by clicking on the tab in the taskbar).

Click Options. Choose Configure PG / PC interface. Choose PC Adapter (Automatic).

Click on Properties. A new window will open showing the automatic detection of the bus profile or local connection. Click Local Connection and choose USB. Now choose Automatic Bus Profile Discovery and change the address to 30. You can verify your connection now by clicking Start Network Discovery. If a new window opens showing network type = MPI, baud rate = 187.5 kbps, you have established communications with your S7-300. Click Close. Click OK. Click OK.

Now is the time to start programming. In the SIMATIC Manager window, click the plus sign next to SIMATIC 300 (1), click the plus sign next to CPU 313C-2DP, click the plus sign next to S7 Program (1). Now click on Blocks and you will see the system data and OB1 appear in the right window of your screen.

Double click on OB1 and a new window will open called Properties – Organization Block

Here you can choose how you want to program, in LAD (ladder), STL (instruction list) or FBD (function block diagram). Choose which one you want to use and click OK.

Double-click OB1 again and the programming window LAD / STL / FBD opens.

Now you can start programming.

I have these same instructions with pictures on my website at http://www.saturdayafternoonhobbies.com

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *