Parameter types for program connections

Connect to a program using these parameter types:
  • Input parameter
    . A parameter that passes data as a value into an executing program. External sources cannot change the value of an Input parameter when the program executes. An Input parameter can have only one connection to the whole tag, or individual connections to member, but not to both the tag and the member. Input parameters can connect to Output parameters, controller-scoped tags and parameters, and device tags. Use Input parameters to connect input card data to a code module or object, or for code module or object commands that are point-to-point.
  • Output parameter
    . A parameter that produces data when the program executes. The value of an Output parameter is buffered and only changes at the end of the program scan when the copy of the parameters execute. Output parameters can connect to one or more Input parameters, controller-scoped tags, and device tags. Use Output parameters to connect a code module or object to an output card or to configure a code module or object to perform operations such as commands and settings in other code modules or objects. You can configure multiple connections for an Output parameter. This process is called fanning and allows one code module or object to send multiple commands to multiple modules or objects using one Output parameter.
  • InOut parameter.
    A special usage program parameter that represents a reference to data that can be both an Input and Output during program execution. InOut parameters pass as a reference rather than value, so an InOut parameter merely points to the original data. InOut parameters behave similarly to an alias tag. InOut parameter values can change when a program executes. An InOut parameter connected to an Output parameter produces an error. Use InOut in a program that contains multiple tasks with different priority assignments. In the program, a higher priority task interrupts a lower priority task. If the higher priority task references data that is in the lower priority task, the InOut parameter allows the higher priority task to point directly to the value of a tag in the lower priority task. This ensures that the higher priority task uses the most up-to-date tag value. Also use InOut parameters when instructions such as MSGs have tags that are only at the controller scope. InOut parameters can connect directly to the Message instruction tags in the controller scope. InOut parameters are useful for programs that have a large data structure so that you do not have to pass the entire structure by value.
    TIP: Input and Output parameters automatically buffer data. You do not need to create separate tags to buffer IO data. Buffer data using the Synchronous Copy File (CPS) instruction.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.