Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Runtime Client-Server Domains (Reference):  Understanding the client-server architecture and domain separation in FrameworX runtime execution.

FrameworX uses a client-server architecture that clearly separates server-side processes (data acquisition, alarms, historian) from client-side processes (displays, local scripts). This separation enables:

  • Distributed application deployment
  • Optimized performance through appropriate process allocation
  • Secure data access with proper isolation
  • Flexible scaling of client connections

On this page:

Table of Contents
maxLevel3
stylenone


Domain Concepts

Server Domain

  • Scope: Global across all modules and clients
  • Process: TServer.exe
  • Contains: Device communications, alarms, historian, server scripts
  • Tag Access: Server tags only
  • Use For: PLC data, shared values, system-wide calculations

Client Domain

  • Scope: Local to each client computer
  • Process: Client.exe (Rich/Smart/Web)
  • Contains: Displays, client scripts, local variables
  • Tag Access: Both server and client tags
  • Use For: Operator input, display parameters, local calculations

Namespace Architecture

NamespaceDescriptionAccessExample
@ServerServer computer propertiesGlobal to all clients@Server.Date
@ClientClient computer propertiesLocal to each client@Client.Username
TagAll project tagsBased on tag domainTag.Temperature.Value
DeviceCommunication pointsServer onlyDevice.PLC1.Status
AlarmAlarm managementServer onlyAlarm.Group1.Active
DatasetDatabase accessBoth domainsDataset.Query1.Execute()

Tag Domain Configuration

Server Tags (Default)

Characteristics:

  • Same value across all clients
  • Synchronized automatically
  • Stored in server memory

Use Cases:

  • PLC/device data
  • Process variables
  • Alarm triggers
  • Historian points
  • Shared calculations

Client Tags

Characteristics:

  • Local to each client
  • Not synchronized
  • Client memory only

Use Cases:

  • Operator input fields
  • Display navigation
  • Report parameters
  • Local calculations
  • UI state variables

Module Domain Behavior

ModuleDomainTag AccessExecution
DevicesServer onlyServer tagsTServer.exe
AlarmsServer onlyServer tagsTServer.exe
HistorianServer onlyServer tagsTServer.exe
DisplaysClient onlyServer + ClientClient.exe
Script TasksConfigurableBased on domainServer or Client
Script ClassesConfigurableBased on domainServer or Client
Script ExpressionsAutomaticBased on tags usedAuto-allocated

Dataset Operations

Synchronous Execution

csharp

// Executes where called (client or server)
@Dataset.Table.Table1.SelectCommand()
  • Runs in calling domain
  • Immediate execution
  • Blocks until complete

Asynchronous Execution

csharp

// Always executes on server
@Dataset.Table.Table1.Select += 1
  • Server-side only
  • Non-blocking
  • Fire-and-forget

Important: When using client tags in SQL queries or mappings, use synchronous methods from client domain.


Report Operations

Similar to datasets, reports support both synchronous and asynchronous execution:

MethodDomainFile LocationUsage
SaveCommand()Calling domainServerDirect method call
Save += 1Server onlyServerProperty toggle

Files always save on the server, regardless of where the command originated.


Script Execution

Server Scripts

  • Run in TServer.exe process or separate AppDomain
  • Access server tags only
  • Can be distributed to remote computers
  • Protected execution environment

Client Scripts

  • Run in client process threads
  • Access both server and client tags
  • Local to each client
  • UI interaction capable

Calling Server Methods from Client

When calling server methods from client scripts, use async/await:

C#:

csharp

public async Task DisplayOpening()
{
    await @Script.Class.ServerMain.Method1();
}

VB.NET:

vbnet

Public Async Function DisplayOpening() As Task
    Await @Script.Class.ServerMain.Method1()
End Function

Built-in Protections

Script Safety

  • Automatic try-catch wrapping
  • Reentrancy prevention
  • Task queue management
  • Thread pool optimization
  • Real-time data synchronization

Performance

  • Separate execution threads per task
  • CPU core-based thread pooling
  • Non-blocking architecture
  • Automatic load balancing

Best Practices

Domain Selection

  1. Use Server Domain for:
    • Shared data across clients
    • Device communications
    • System-wide calculations
    • Historical data
  2. Use Client Domain for:
    • User interface state
    • Local preferences
    • Temporary calculations
    • Display parameters

Performance Optimization

  • Minimize client-server tag synchronization
  • Use appropriate domain for calculations
  • Batch database operations
  • Cache frequently accessed server data locally

Security Considerations

  • Server process has database credentials
  • Clients access data through server
  • No direct database access from clients
  • Domain separation ensures data isolation

Using Reports from Server and Client Processes

The Report Module follows a logic similar to Datasets that are accessible from both the Server and Client processes, which resolve the tag values according to where they were activated and have an asynchronous operation that always runs on the server side.

When calling a method, such as the SaveCommand(), the method is executed by the entity that calls it. Therefore, if the call is from a Display or ScriptTask of the Client type, it will be executed and evaluated on the client side. If it is from a Script-Server, it will be evaluated on the server computer.

Saving files will always occur on the server computer, and the filename path will always be resolved on the server side, even if the command to save was initiated from the client computer.

The Report module also allows a command to be executed asynchronously on the server computer. Asynchronous calls are always executed on the server computer. In order to start an asynchronous action, you need to toggle (change) the value of the property. Here are the two options compared:

  • @Report.Report1.SaveCommand(): Will run synchronously, on the server or client domain, using the tags according to where they were called.

  • @Report.Report1.Save += 1: Will run asynchronously, always on the server computer.

You can start an asynchronous call to save a report using the SaveTrigger column and mapping it to a tag.

Note

When configuring the Report module: If you use local tags or symbols mapping to local tags, you must call the queries from the CLIENT process using the synchronous method so the system will be able to do the proper evaluations of those tags.

In this section...

Page TreerootV10:@parentspacesV10