TcOpen

  • Articles
  • API reference
Show / Hide Table of Contents
  • Introduction
  • Conventions
    • General
    • Components
  • TcOpen Framework
    • TcoCore
      • Introduction
      • TcoContext
      • TcoObject
      • TcoTask
      • TcoState
      • TcoSequencer
      • TcoComponent
      • TcoMessenger
      • TcoLogger
      • TcoDialogs
    • TcoData
      • Introduction
    • TcoInspectors
      • Introduction
    • Howto(s)
      • How to get started using TcOpen libraries
      • How to write a sequence
      • How to include TcOpen in a project
  • TcOpen Inxton
    • Colors Material Design WPF
    • Inxton Conventions
    • Inxton.Vortex.Framework.Blazor
      • Introduction and installing
      • RenderableContentControl
      • Layouts
      • Custom libraries
      • Security

Dialogs

API

Dialogs provide capability to interact with the user rising dialogs directly from the PLC program.

Jump start

PLC

VAR   
    _invokeDialog   : BOOL;
    _dialog1        : TcoCore.TcoDialog(THIS^);  
    _answer         : STRING; 
END_VAR
//----------------------------------------------
IF(_invokeDialog) THEN
    _dialog1.Show()
                .WithType(eDialogType.Question)
                .WithYesNoCancel()
                .WithCaption('Hey')
                .WithText('Do we go ahead?');

    IF(_dialog1.Answer = TcoCore.eDialogAnswer.Yes) THEN _answer := 'YES'; END_IF;
    IF(_dialog1.Answer = TcoCore.eDialogAnswer.No) THEN _answer := 'NO'; END_IF;
    IF(_dialog1.Answer = TcoCore.eDialogAnswer.Cancel) THEN _answer := 'CANCEL' END_IF;

    IF(_dialog1.Answer <> TcoCore.eDialogAnswer.NoAnswer) THEN _invokeDialog := FALSE; END_IF;
END_IF;    

Listening to dialogs in a WPF application

  TcOpen.Inxton.TcoAppDomain.Current.Builder               
        .SetPlcDialogs(DialogProxyServiceWpf.Create(new[] { PlcConnector.MAIN })); // Will listen to all dialogs contained in MAIN.PRG
  • Improve this Doc
In This Article
Back to top

Generated by DocFX | Delivered by TcOpenGroup contributors