9/28/2018 11:23 AM | |
Joined: 9/23/2005 Last visit: 4/26/2024 Posts: 4522 Rating: (698) |
After checking this it looks like inouts in FBs usually are references and not values. Without knowing your PLC family, access properties of the blocks in question it's hard to investigate further. |
Last edited by: jacek d at: 9/28/2018 11:25:32 AMRegards, |
|
This contribution was helpful to1 thankful Users |
9/28/2018 9:31 PM | |
Joined: 12/4/2009 Last visit: 4/25/2024 Posts: 452 Rating: (134) |
jacek, my target PLCs are S71200/1500. Regarding InOut parameters, I just took a brief look in Hans Berger book, which says: "Block parameter with saved values do not have to be supplied when the function block is called. [...]Block parameters which are saved as pointer to the actual parameter must be supplied with an actual parameter when called." Furthermore: "A block parameter of a function block is located in the instance data of the call. If the block parameter has an elementary data type, the value of the actual parameter is copied into the instance data or from the instance data to to the actual parameter. [...] If an in/out parameter has a structured data type, a 48-bit pointer to the actual parameter is created in the instance data...". Since my InOut parameter is PLC data type,which is structured data type, that seems to be a problem. Since it's in the InOut area, it is stored as pointer, so compiler complains because actual parameter has to be supplied during function call. When I change my parameter to elementary data type, everything works fine. It will have to be in STAT area anyhow Thank you for your help. Regards. |
Last edited by: crazyCow at: 9/28/2018 9:31:42 PMIf this post actually helped, you may consider using the Rate button above. |
|
This contribution was helpful to1 thankful Users |
Follow us on