How to return a calculated value from an external program (Set value via = Program)?

How to return a calculated value from an external program (Set value via = Program)?

I have a question regarding zenon 12 Engineering Studio and the use of the “Set value via” property set to “Program” on a screen element.

I configured a screen element so that when its value is set, zenon calls an external .exe file using the Set value via = Program option.
The external program is a custom application written in C#.

With this setup, zenon successfully passes the current value to the external program as a command-line argument, and the program can display and process that value.

However, I have not been able to determine how a modified or calculated value should be returned to zenon and written back to the variable:

  • I cannot find documentation that explains where or how the external program is expected to return a value.
  • Returning a value from the program’s Main method (void or int return) does not update the zenon variable.
  • At this point, it is unclear whether zenon expects the result via exit code, standard output, a specific interface, or another mechanism.

Background / Use case

My goal is to implement a custom date/time input interface that is not available as a standard zenon input control.
For that purpose, I would like to use an external C# executable to:

  1. Receive the current date/time value from zenon
  2. Let the user edit it in a custom UI
  3. Return the edited value so that zenon writes it back to the original variable

Question

Is there a supported or documented way for an external program called via Set value via = Program to return a calculated value to zenon and update the variable?
If so, where and in what form is the value expected?

Any clarification based on Engineering Studio / Runtime behavior would be appreciated.