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.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com