[?]: Problem with FC and udt

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
aguere
Posts: 26
Joined: Tue Oct 11, 2005 5:54 am
Location: Europe

[?]: Problem with FC and udt

Post by aguere » Sat Dec 06, 2014 7:19 pm

I create a Fc with IN_OUT UDT, when I call in OB1 call fc1, name:= (INOUT UDT) , I write P#DB1.DBX0.0 , but the system say error, I know about it, Could you tell me where it´s mistake,
Thank you

I send my project, but I know how here!!


Spanish
Buenas, estoy creando un fc parametrizado y he puesto en IN_OUT un UDT que tengo creado y elaborando en un db. La cosa es que no logro insertarle el puntero del db cuando llamo al fc.
Por si me he enrollado, tengo un UDT con 10 variables, esta va dentro de un db con un array 1...10, ahora tengo un fc creado donde en IN_OUT tengo puesto este udt, dentro del fc proceso los valores de este udt, tengo las variables,etc...ahora bien, si este fc, lo llamamos fc1 , lo llamo desde el OB1 por ejemplo,
call fc 1
sale el nombre que le he puesto
Tanque:= (INOUT UDT) es lo que sale cuando paso el ratón por encima, aquí añado P#DB1.DBX0.0 Que es donde empieza el udt dentro del db y me sale el siguiente error (el área de declaración de la página actual no es compatible con el área de declaración formal VAR_IN_OUT del parámetro formal tanque)
Alguien podría indicarme que es lo que hago mal,etc...
Muchas gracias antemano

SHKODRAN
Posts: 197
Joined: Wed Dec 24, 2008 4:37 pm
Location: Europe
Contact:

Re: [?]: Problem with FC and udt

Post by SHKODRAN » Sun Dec 07, 2014 4:20 pm

Dear aguere,
The UDT is not a data type in the sense of a data type that the CPU recognizes, but it is a user-defined (composed) data type in the offline project. User defined data types of the S7 program are not loaded into the S7 CPU. They are either created by an incremental editor and edited or they originate from the compilation of sources. It is not possible to transfer UDTs for use as memory area when transferring variables on block calls. For this it is recommended to specify the BYTE data type with the relevant data length as an absolute value, or to parameterize the IN, OUT and IN_OUT declaration symbolically, because then the system creates the address accordingly.

You're trying to usine like that:

Code: Select all

      CALL  "FC1"
       IN_OUT:=P#DB1.DBX0.0
 
But you should use like that:

Code: Select all

      CALL  "FC1"
       IN_OUT:="Your DB Name".Name offset of your db
 
Regards!

aguere
Posts: 26
Joined: Tue Oct 11, 2005 5:54 am
Location: Europe

Re: [?]: Problem with FC and udt

Post by aguere » Sun Dec 07, 2014 5:59 pm

Thank you very much, but I try change P#db1.dbx0.0 for symbol name, and error continue. Could I send my project here?

SHKODRAN
Posts: 197
Joined: Wed Dec 24, 2008 4:37 pm
Location: Europe
Contact:

Re: [?]: Problem with FC and udt

Post by SHKODRAN » Mon Dec 08, 2014 5:29 am

aguere wrote:Thank you very much, but I try change P#db1.dbx0.0 for symbol name, and error continue. Could I send my project here?
Send to me your project , i want to check what happen.
Thanks.

aguere
Posts: 26
Joined: Tue Oct 11, 2005 5:54 am
Location: Europe

Re: [?]: Problem with FC and udt

Post by aguere » Thu Dec 11, 2014 9:28 pm

Good Night from Tenerife, Canary Islands, I can resolved my problem, if I write db name,etc...always fail, but I put mouse on IN_OUT, appear drop box, here I select db, then anyproblem, allright

Thank you very much

Post Reply