Where in the worl are my inputs in Siemens...

muusic_man

Member
Join Date
Nov 2008
Location
Delaware
Posts
148
Hi all,
I have a Siemens 315 CPU using step7 software. In my rack I have a 16D/I 16D/O module. The inputs are PIW12 and PIW13. I can't find anywhere in any of the program a reference to any of the inputs in the format of I 12.0 or PIW12. All I see is a lot of M addresses. I assume that my inputs are being moved into a memory address but I have no idea how to determine what memory address. I can monitor PIW 12 and see the particular input I am working with (I 13.4) go on and off in the word.

Can anyone give me a Siemens for dummies tutorial on how to determine what memory address contains my inputs. I am an Allen Bradley guy by trade but was handed this project and for the life of me can't find the info I need. Any help would be greatly appreciated.
 
In Simatic manager, right click on the blocks folder and select [reference data] --> [display].
Then select [view] --> [ cross references].
Set the filter [view] --> [filter] to show only the inputs.
This will show you where the inputs are used. If it is not in the list they probably used a pointer to move the data. post your code here if you can't find them and I'll have a look at it.

Just for your info PIW12 is a 16 bits word which contains input byte 12 and byte 13. So PIW12 will contain all the 16 inputs. Each input can be addressed [FONT=&quot]separately [/FONT]as I12.0 to I12.7 and I13.0 to I13.7.
 
The project will be too big to post here, so using simatic manager create a new library, insert an S7 Program into the library then copy all the blocks from your project to the blocks folder in the library. Archive the library and post the resultant zip
 
One method is as I have done with my latest program, do a cross reference you will not see a single IO address.

The reason I have done this is I wanted to structure the IO into a UDT for use in the program, this IO is also passed to another PLC, the UDT is placed in each PLC. The UDT is also used as a STAT in the main control FB, its from the IDB that the IO is passed across the network. You cannot use a UDT directly on IO.

I block transfer the IO from a block at the start and end of OB1, I use pointers set up in a setting DB to indicate source, destination and length.

I have seen on one occassion where all the IO was added as DWORD pointer addresses in a DB.
 
You will have fun with this :)

Some inputs are read in FB50 network 3 (I haven't looked at all the blocks)

Look in DB20 to find the labels
CONFIG_ADDR_DIG_ESTP_IN and CONFIG_ADDR_DIGITAL_IO
where you will find the numbers 33 and 5 respectively.
Emergency Stop inputs are thus located at I33.0 upwards
and other digital inputs are located at I5.0 upwards.

As the Meerkats say, Simples !


Code:
run:  L     #ALM_STATUS_WORD_0          //Saved Alarms
      T     LW     0
//EStop Location
      L     0
      L     #CONFIG_ADDR_DIG_ESTP_IN
      OW                                //IF no address
      JZ    udio                        //  THEN no update
      SLW   3
      T     #TMP_IO_PTR
[COLOR=red]      L     IB [#TMP_IO_PTR]            //Digital Inputs
[/COLOR]      T     DIB  176                    //DIG_IN_EMERG_
      L     0
//Update Digital In
udio: L     #CONFIG_ADDR_DIGITAL_IO
      OW                                //IF no address
      JZ    xio                         //  THEN no update
      SLW   3
      T     #TMP_IO_PTR
[COLOR=red]      L     IB [#TMP_IO_PTR]            //Digital Inputs[/COLOR]
      T     DIB  175                    //DIG_IN_
xio:  S     M     33.0
      S     M     33.1
      S     M     33.2
 
In DB61 you have a variable CONFIG_ADDR_DIGITAL_IO which is set to 12 (Actual value!). This DB is an instance DB from FB56.
Code in FB56:
#CONFIG_ADDR_DIGITAL_IO //Get Pointer to Dig Out
SLW 3
T #TMP_IO_PTR
This makes a pointer from the address 12 and further in NW2:

L IW [#TMP_IO_PTR]
T DIW 648
This part reads input word 12 and writes it to DB61.DBW648 (the opened instance DB). All these bits have a name that starts with DIG_IN_... So if you look in FB56 for these TAGs you can see where they are used.


P.S. If you ever find the original programmer you have my permission to shoot him :)
This software must be a nightmare for regular maintenance guys.

edit: Don't forget that FB51 is also used with the instance DB's for the other components. So if you chance the code you chance it for all components!
 
Last edited:
Ok, one more advice I want to give you. If you look at FB56 the default IO address is 8, this means that if you have to “regenerate” the instance DB’s from this FB that all the IO addresses will be set to 8 again. I assume that this was changed once during commissioning because I cannot find this anywhere in the code. So make sure you have a full backup off the online DB’s before you start changing anything. This code is tricky.
 
Wow. So being an AB guy and seeing this means I shouldn't be too hard on myself for not understanding it.
So what I'm trying to accomplish is if I 13.4 is not true then set an unused bit in DB61.DBW649 for alarming purposes. Also if I 13.5 is not true the I should "inhibit_pour". Looks like I'll need a Siemens persons expertise, That's a real shame because if it were AB it would be so easy. Although I'm comfortable moving around in S7 and making changes, this program just seems insane to me.
 
OB35 is called every 10mS and contains the following code.

Code:
//Update Inputs
      L     PIW    0
      T     MW    38
//MUX Update
      CALL  "TEMP_MUX_READ" , "MUX_TEMP_0"
//Update outputs at start of Pour logic:
      L     MW    12
      T     QW     0
      T     PQW    0


This is only IW0 and QW0 though.
 
Thanks everyone. Jobbe was right on the money. As I look in DB61 I see the DBW containing my inputs, after they have been moved there in FB56. I am now on the right track.

Thanks again for all the wonderful help.
 

Similar Topics

I received an email from a student with the following code attached. This is supposed to control a floodgate system, and supposed to be written...
Replies
18
Views
406
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
I have a lot of different equipment that I inherited from my father's company, he allowed me to sell it, how can I do this? Siemens Simatic S7...
Replies
4
Views
299
Can anyone help me find where is recipe plus or recipe manager in View desginer(studio 5000) software. i want to create an recipe but i am unable...
Replies
2
Views
175
Hi everyone: I went to AB.com, found only firmware, no EDs file showing up. i took a pix of device properties of RSLinx. Thanks
Replies
1
Views
117
Back
Top Bottom