I'll provide the following information to try distinguish the terminology I'm about to use...
A "Program Local Tag" is a tag created at the Program-Scope for which its "Usage" is set for "Local". This makes it a "Local Program Tag", "Local Tag", or "Program Tag".
A "Program Tag" for which its "Usage" has been changed to anything but "Local" is now called a "Program Parameter Tag", or "Program Parameter". This could be "Input", "Output", "InOut" or " Public".
An AOI "Parameter" is the name used for the parameters or members we create inside an AOI. These parameters are at the AOI-Scope and should not be confused with the Program Parameters described above. They are similar in name, but quite dissimilar in Scope.
Moving on...
Now that we have some more info I'll come back to your opening post...
theColonel26 said:
So I noticed that in Studio 5000 there are Program Parameter Connections. They seem to be a way to map a parameter to something inside the program, like for example an AOI parameter...
A way, yes, but not what they are primarily intended to be used for. Program Parameters are primarily for passing data from one Program directly to another Program, or from Programs to the Controller-Scope. At the Program-Scope, this gives us the option to create just the Local Tags and not have to include Controller-Scope Tags to pass the data out to the wider Project-Scope. They are not so much intended for passing data around within the same Program, as you seem to be doing. But, this is possible.
theColonel26 said:
...But they don't seem to work that way. I connected the Program level output parameter "Seconds" to the AOI level output "Second". When I run it "Second" is now zero. I remove it and run it and the AOI level output has the expected value...
Reiterating what I had said earlier, but now with some more information, I will repeat the fact that you are attempting to output data from one Tag into another Tag which is also set to output its data. This will not work.
A clarification on my clarification...
When I said that you cannot create a Connection from a Program Output Parameter to another Program Output Parameter, this is correct. The software will not allow this. However, if the target "Parameter" is belonging to an AOI, then this is not another Program Parameter. This is an AOI Parameter. There is a difference, as I've mentioned. When you are assigning the target for a Program Output Parameter, and it happens to be an AOI Output Parameter, the software does not check that the target is also an Output Parameter inside of an AOI. It just thinks it is a target tag within a structured data type ("DateTime_V2"). Just because the software allows this Connection does not mean it is valid. As I said, both the source and the target are outputting their data, so neither can write to each other successfully.
You have the usage for the AOI instance set as "Public". This makes the AOI, as a whole, available as a Public Parameter. You would only need to do this if you intend to pass the entire structure of the AOI to other parts of the project. If not, and you are only using the AOI inside this Program, then you would set the usage to "Local".
If you want to directly input values to the AOI from the Program Parameters then for each Program Parameter ending with "...In", change their "Usage" to "Output". This will instruct them to send their values wherever you connect them to.
Leave each of the Connections as is to the AOI Parameters. The equivalent named AOI Parameters are already Input Parameters inside the AOI. This means they are instructed to receive data from where they are connected to.
When the program is executing, the values for the "...In" Output Parameters will be passed to the Input Parameters in the AOI, as you seem to be looking to do.
Likewise for the AOI Output Parameters, leave everything as is and just change the "Usage" for the equivalent Program Parameter from "Output" to "Input".
When the program is executing, the values for the AOI Output Parameters will be passed to the Program Input Parameters, as you seem to be looking to do. Example: AOI Output Parameter "Second" (or "Seconds" if you have changed its name?) will pass its value to Program Input Parameter "Seconds".
The tricky part in all this is if you are using Program Parameters at the Project-Scope and you change the "Usage" to the opposite, just to pass data within the same Program, then you will break the Project-Scope Connections.
As I keep saying, without knowing
exactly what you are trying to do here, it can be difficult to advise you to a satisfactory end. We may need to know yet more, or, perhaps the info so far will be enough to get you over the line?
Regards,
George