I thought I'd finally got this clear, but apparently this is not the case!
I'm monitoring the commissioning of a new project at the moment and the sub-contracters concerned have a very structured approach to programming that I think S7Guy would approve of. However, most of their programming is done using FBs, in this case over 400 against 29 FCs.
Of these FCs about half are so-called "Typicals" for all sorts of basic functions, including simple and redundant measured value handling. These "Typicals" are then repeatedly called from within the FBs that make up most of the program.
I've already had a couple of cases where they've been using fully qualified DB-addresses as parameters for the FC call and then trying to access the data directly instead of laying it onto a TEMP and accessing the TEMP - no great problem, fairly quickly spotted and solved.
Now I've got what feels like a related, but not quite identical, problem and I'm a bit puzzled.
Here's the calling FB and as you can see they're passing over a pointer to the start of the UDT for this particular measurement.
Oops, the facility to insert pictures in the middle of text seems to have disappeared, so both the calling FB and the called FC are appended as attachments.
Now what's confusing me is that according to Berger in chapter 19.3 it is permissible to pass on a UDT as an actual parameter. However, in table 19.5, which details what can and can't be used as parameters under the various possible calling conditions, in the case of an FB calling an FC, it's permissible to pass over a UDT for an IN or an OUT parameter, but not for an IN-OUT parameter.
The other thing that bothers me is that, in my opinion, they are not passing over a UDT itself, but rather an ANY-Pointer pointing to the instance UDT for this particular measurement - and that brings us back to where this Thread started!
Just to confuse the issue further, so far we've tested about half-a-dozen measurements and this is the first one to cause problems.
Can any of the "usual suspects" throw a bit of light on whether or not this is an acceptable practice, or whether it's just luck that it's worked so far?