Driving Multiple Displays
One application, several Storyboard engines, one shared model. This is an OpenView Pro and Flex capability — Select drives a single display.
Table of Contents
One Engine Per Launch Configuration
Addressing an Engine From Code
Receiving From Several Screens
The Three Mechanisms
Three separate things have to line up, and they are configured in three different places. Most multi-display problems are one of them being out of step with the others.
| # | Mechanism | Configured in |
|---|---|---|
| 1 | One engine instance per display | launchConfigurations in StoryboardConfiguration.json |
| 2 | Each engine bound to a screen | surfaceId plus the screen's surface list in PackageInfo.json |
| 3 | The application addressing each engine | One outbound channel per engine, and ChannelId on each message |

One Engine Per Launch Configuration
"launchConfigurations": [
{
"generatorProjectPath": "../StoryboardProject.Dashboard",
"storyboardAppName": "Dashboard",
"surfaceId": "2000"
},
{
"generatorProjectPath": "../StoryboardProject.Detail",
"storyboardAppName": "Detail",
"surfaceId": "2001"
}
]
The installer emits one sbengine command per entry into the UI start script. Each engine loads
its own .gapp and is an independent process.
Important
Both projects' events/custom.evt files are merged into one generated namespace. Event names
must be unique across every project, or generation produces two classes with the same name.
Prefixing per screen — dashboard_command, detail_update — solves this and helps with
receiving, below.
Binding an Engine to a Screen
surfaceId is the IVI surface the engine renders to. On Pro and Flex it is passed straight through
as -orender_mgr,zorder=<surfaceId>, because with ivi_application the zorder is the surface id.
The same id must also appear against the intended screen in PackageInfo.json:
screen 0 ── surface 2000 ── Dashboard engine
screen 1 ── surface 2001 ── Detail engine
screen 2 ── surface 2002 ── (disabled)
The layer manager assigns each surface to its screen's layer. An id in the launch configuration that appears in no screen's surface list leaves the engine rendering to a surface nothing places, so the display stays blank.
Addressing an Engine From Code
Each engine listens on a channel named after its own application name — the app/n node of its
.gde, not the filename:
internal static class MultiScreenChannels
{
public const string Backend = "multiscreen_backend";
public const string DashboardApp = "dashboard_ui";
public const string DetailApp = "detail_ui";
public const int DashboardChannel = 0;
public const int DetailChannel = 1;
}
Open one outbound channel per engine, in the order the ids assume:
client.AddOutputChannel(MultiScreenChannels.DashboardApp); // id 0
client.AddOutputChannel(MultiScreenChannels.DetailApp); // id 1
client.AddInputChannel(MultiScreenChannels.Backend);
Then stamp the channel on each update in OnInit, so it is set once rather than at every call
site:
public partial class DashboardUpdate
{
protected override void OnInit()
{
Message.ChannelId = MultiScreenChannels.DashboardChannel;
}
}
public partial class DetailUpdate
{
protected override void OnInit()
{
Message.ChannelId = MultiScreenChannels.DetailChannel;
}
}
Warning
The generated constructor leaves ChannelId at zero. An update without this override goes to
whichever engine happens to own channel 0 — so on a two-screen application, half your updates
land on the wrong display and nothing reports it.
Because ids are positional, the constants and the AddOutputChannel call order must agree. Adding
a channel in the middle renumbers everything after it.
Receiving From Several Screens
This is where multi-display differs most from what you would expect.
A received message does not record which channel it arrived on. The SBIO callback delivers the event name, format and data, but not the channel handle. Opening one inbound channel per screen therefore buys you nothing — the arriving message would not say which one it came from.
The workable pattern is a single shared inbound channel, with screens distinguished by event name:
void HandleInputMessage(object model, StoryboardEventArgs e)
{
switch (e.Message.Name)
{
case DashboardCommand.Name:
e.Message.GetObject<DashboardCommand>().UpdateModel();
break;
case DetailCommand.Name:
e.Message.GetObject<DetailCommand>().UpdateModel();
break;
}
}
Both .gde projects send to multiscreen_backend, and the event name carries the origin. This is
why per-screen event name prefixes are worth adopting from the start.
Sharing One Model
The point of driving two displays from one application is that they show the same state. Keep a single model and publish it to every screen:
public void Publish()
{
var dash = new DashboardUpdate(); // ChannelId stamped in OnInit
dash.EngineRpm = Rpm;
dash.Load = Load;
dash.Mode = ModeLabel;
client.SendEvent(dash.Message);
var detail = new DetailUpdate(); // different channel, same data
detail.EngineRpm = Rpm;
detail.Load = Load;
detail.Mode = ModeLabel;
client.SendEvent(detail.Message);
}
A command from either screen updates the model, and the model republishes to both — which is what
makes LOAD + on the dashboard change the load on the detail screen too.
Warning
Status labels published to several screens are a common place to hit the equal-length string
problem. The MultiScreen demo's IDLE / RUN / SERVICE are deliberately different lengths,
because a string write only commits when the buffer length changes. See
View Models & Property Binding.
Adding a Third Display
The Flex declares three IVI screens. Screen 2 ships disabled with surface 2002. To use it:
- Set
isEnabledtotrueon screen 2 inPackageInfo.json, and checkscreenSizeKeymatches the panel — it is encoded aswidth << 16 | height. - Add a third Storyboard project and a third
launchConfigurationsentry withsurfaceId2002. - Add its channel name and id to your channel constants.
- Open a third outbound channel, in the right position.
- Publish to it from the model.
- Give its events unique names.
Checklist
| Check | Where |
|---|---|
One launchConfigurations entry per display |
StoryboardConfiguration.json |
Each entry has a distinct surfaceId |
StoryboardConfiguration.json |
Each surfaceId listed against the right screen |
PackageInfo.json |
Screen enabled, screenSizeKey correct |
PackageInfo.json |
| Event names unique across all projects | each custom.evt |
Channel name matches each .gde's application name |
Designer, app/n node |
AddOutputChannel order matches the id constants |
your startup code |
Every update stamps ChannelId in OnInit |
your partial classes |
| Screens distinguished by event name, not channel | your inbound handler |
The Ahsoka.CS.MultiScreen.Storyboard demo implements all of this and is the fastest way to see
it working.
Next: C++ Integration.