UEIPAC Web UI

advertisement
UEISIM Desktop
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Overview
The UEISIM is a Linux based system that
runs Simulink models.
UEISIM Desktop allows remote monitoring
and parameter tuning while a model is
running.
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Remote monitoring/Parameter tuning
•
External mode:
•
•
Use Simulink itself as client to connect to the
UEISIM target.
UEISIM Desktop:
•
•
A client written in C#, C/C++ or LabVIEW can
display the model’s signals and parameters
without Simulink being installed.
Signals and parameters are also accessible
via a web page.
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Extra features (UEISIM desktop only)
•
Remotely start/stop simulation
•
•
Host PC client can start or stop simulations
remotely
Timing statistics:
•
•
•
•
Average simulation step execution time
Minimum step execution time
Maximum step execution time
Model execution time
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Shared Data protocol
UEISIM
Simulation executable
Client application
LibSharedData
LibSharedData
PC #1
PC #2
UeiSimTarget.dll
Web browser
Client Application
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Shared data protocol
•
•
•
•
Implements a simple message based
protocol (set/get variable) using JSON or
binary data representation
Local processes communicate over UNIX
sockets
Remote processes communicate over
TCP/IP sockets
Web browser communicate over Web
Sockets
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Signal Monitoring
•
A model automatically publishes all “exported” signals
under the name:
•
•
/model_name/block_name/signal_name
To export a signal, right-click and set “Storage Class”
to “Exported Global”
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Parameter tuning
•
A model also publishes all tunable parameters under
the name:
•
•
/model_name/block_name/param_name
For example the constant block “value” parameter is
tunable:
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Data hierarchy
• This naming convention allows a hierarchical
view of the model signals and parameters
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Shared Data Client
Shared Data client is an application that provides a
quick and easy way to monitor a model.
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Client API
UEISIM Desktop API supports C/C++, .NET (C#,
VB), LabVIEW and Javascript
The API provides the following services:
• Start/Stop Simulation
• Enumerate and read signals
• Enumerate, read and write parameters
• Reboot or shutdown UEISIM
• Read timing statistics and CPU load
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
C# client API 1/4
Create a client object
UeiSimTargetClient client = new UeiSimTargetClient();
Open communication with UEISIM
client.Open("192.168.100.2");
Load and Start Model
client.LoadApp("/tmp/test_ai_rt2“, 2345);
if(client.IsAppRunning())
{
client.StopApp();
// Stop model if already running
}
client.StartApp();
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
C# client API 2/4
Enumerate signals
for(int sigIdx=0; sigIdx< client.GetNumSignals(); sigIdx++)
{
string sigName = client.GetSignalName(sigIdx);
double[] sigVals = client.GetSignalValue(sigIdx,
client.GetSignalWidth(sigIdx));
Console.Write("{0} = {1}", sigName, sigVals);
}
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
C# client API 3/4
Enumerate and tune parameters
for(int prmIdx=0; prmIdx=0<client.GetNumParams(); prmIdx=0 ++)
{
string prmName = client.GetParamName(prmIdx);
double[] prmVals = client.GetParamValue(prmIdx,
client.GetParamWidth(prmIdx));
Console.Write("{0} = {1}", prmName, prmVals);
// Tune parameter
prmVals[0] = 102.90;
client.SetParamValue(prmIdx, prmVals);
}
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
C# client API 4/4
Display timing stats
Console.WriteLine("Model ran for {0} secs", client.GetExecTime());
Console.WriteLine("Min TET = {0}", client.GetMinTET());
Console.WriteLine("Max TET = {0}", client.GetMaxTET());
Console.WriteLine("Avg TET = {0}", client.GetAvgTET());
Close communication channel
client.Close();
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
LabVIEW API 1/4
Open communication and start application
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
LabVIEW API 2/4
Enumerate and monitor signals values
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
LabVIEW API 3/4
Enumerate and tune parameters
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
LabVIEW API 4/4
Display timing stats
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
LabVIEW client example
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
HTML5 client
• UEISIM Desktop web interface is built on top
of web sockets
• Web sockets are part of HTML5. Supported in
the following browsers:





Google Chrome
Firefox
Safari for MacOS and iOS
Android web browser
Internet Explorer 10
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
HTML5 client – default page
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
HTML5 client – custom page
www.UEIDAQ.com
© 2010 UEI, Inc. All Rights Reserved
Download