The tasks described in this section demonstrate the typical workflow for offline app development on your local Workbench installation, using either NiagaraAX Workbench 3.7 (enabled for Sedona TXS-1.2) or Sedona Framework Workbench 1.2.
The examples shown here use a sample app file and platform from the device simulator zip file archive included in the TXS-1.2 bundle. For details, see Sample device simulator platform included in TXS bundle.
The following procedures are described here:
If you have an app file on hand and have already imported a simulator platform into your Workbench installation, then you
can skip to the procedure for Running an app on a simulated device.
If you have imported a device simulator platform but do not yet have an app file, you can use the Sedona - New App tool to create an app to run in the simulator. Begin with the following procedure for Creating a new app in offline mode.
Creating a new app in offline mode
This procedure describes how to use the Sedona - New App tool to create new app in offline mode.
When creating a new app using the Sedona - New App tool, you must select the correct Platform Service Type in the last step
of the app creation process. If using the sample device simulator platform, the correct platform service type is
jennic::JennicRouter
.
In Workbench, click New App dialog box.
to launch theIn the New App dialog box, enter the App Name and click .
Enter credentials for the app, leave the default Sox port unchanged and click .
Select the Platform Service Type and enter the App Device Name and click , as shown below.
The PlatformServiceType drop down is populated with a list of available platforms. This list is built from the PAR files which
you have imported using the Sedona Installer. The platforms may have been imported as part of a bundle, environment file archives,
regular PAR files, or simulator PAR files.
On completion, the Sedona property sheet for your new app displays.
Once the app is created, you can further develop the new offline app by configuring components for it, such as adding new points offline or making provisioning changes offline.
Configuring components in an offline app
This procedure provides an example of configuring components in a new offline app. Specifically, making provisioning changes and adding new points while working offline.
Prerequisites:
A new offline app file
Open a Wire Sheet or Property Sheet view for the app.
Select
In the Sedona palette, click the Edit App Schema icon to add kits to the palette, such as the control, logic, and math kits.
Drag and drop components from the palette to add them to the wire sheet, as shown below.
Save the modified app file.
Running an app on a simulated device
This procedure describes how to run an app in the Sedona Device Simulator.
Prerequisites:
An app file
A simulator platform PAR file (containing a simulator SVM with a default scode image and default “bootstrap” app file) already imported to your Workbench installation.
Do NOT attempt to run the vendor’s default “bootstrap” app file in the Sedona Device Simulator. This file is constructed by
the platform vendor to provide a basic Sedona app for that platform that, once loaded, is then re-provisioned with your selected
Simulator App. If you need a clean App file to start with, create one using the Sedona - New App wizard (for details, see
Creating a new app in offline mode).Provisioning the vendor’s default “bootstrap” app with a different app file (containing different properties and possibly
different kits), either in the Device Simulator, or through a Sedona Tools connection, and then saving this app using the
Stop button, will corrupt the vendor’s default app file and prevent proper operation of the Device Simulator.
In the Device Simulator View, select your app file. Locate your app file by clicking the directory icon (to the right of the Simulator App File field) which displays a standard File Chooser dialog box.
The Device Simulator determines a list of compatible simulation platforms for the selected app. If only one compatible simulation platform is present, it displays in the Simulator Platform field, as shown below.
If multiple compatible simulation platforms are present, then the simulator populates the Simulator Platform field with a
drop-down list of options. You can then select a platform to use in the simulation.
In the Device Simulator View, with the Simulator App File and Simulator Platform selected, click
to start the simulation.The SVM Output pane displays information on the app initialization and re-provisioning process. An example of the typical SVM output on completion of the initializing process is shown here.
The Device Simulator runs in a “sandbox” folder called “
sedonaDeviceSim
” which is created under your user folder: <niagara-release>/users/<username>/sedonaDeviceSim
). The SVM, scode, and app files are copied to this folder and run from this location. The provisioning process writes files
to this location.
Now that the app is successfully initialized and running in the simulator, you can open a Sox connection to the app in the simulated device exactly as you would connect to an ordinary Sedona device running this app, see Connecting to the app running on a simulated device. You might want to make the Sox connection to the simulated device in a separate tab, that way you can easily access the SVM output pane and controls in the Device Simulator.
Connecting to the app running on a simulated device
The procedure describes how to open a direct Sox connection to the app running on a simulated device, in the same manner as you would connect to an ordinary Sedona device running the app.
Prerequisite: An app file must be successfully running in the Device Simulator.
In Workbench, open a direct Sox connection using localhost. Select
.In the Connect dialog box, for Host IP, enter: localhost
.
In the User name and Password fields, enter the credentials used in the new app file that you created, and click .
If using the sample app from the sample device simulator download, enter these credentials:
Username:
admin
Password: <blank
>.
On completion, you have a direct Sox session connection to the app running in the simulated device, as shown here.
Modifying the app running on a simulated device
This procedure provides an example of viewing and modifying the app running on a simulated device. The example shows typical app logic modifications that you can make, such as adding points.
The sample app used here is developed to run on a device that has four leds but currently controls only two of those leds. The example shows steps to add two more digital outputs to control the remaining two leds.
Interim changes to the simulator app are actually applied to a copy of the app file that is running in the Device Simulator’s
sandbox area. When you end the simulation using the Stop button, you are prompted about where to save the modified app file.
For more information about the sandbox area, see “About the Run process” in the section on Running an app on a simulated device.
Prerequisites:
The app must be successfully running in the Device Simulator.
A Sox connection exists to the app currently running on the simulated device.
In the Nav tree under MyHost, expand the Sox device node and the App node. Double-click the JenDbd component to display the wire sheet view, as shown below.
In the Sedona palette, open the jenDigitalIO palette and drag two DioOut objects to the wire sheet, naming them “led2
” and “led3
”.
In the wire sheet view, link the And_0
output to the led2
input.
In the wire sheet view, link the And_1
output to the led3
input.
After making this change, the app lights leds 0 and 2 when And_0
is true, and lights leds 1 and 3 when And_1
is true, as shown.
Making provisioning changes to the app running on a simulated device
This procedure provides an example of making provisioning changes in the app running on a simulated device using the Kit Manager provisioning tool under the device to add a kit to the app.
Prerequisites:
The app must be successfully running in the Device Simulator.
A Sox connection exists to the app currently running on the simulated device.
To add the jenAnalogIo kit to the app:
In the Nav tree, expand the Sedona Tools node under the Sox device and double-click Kit Manager to launch the provisioning tool.
In the Kit Manager view, click the checkbox to select the jenAnalogIo kit, as shown below, and click
and .When kit changes have successfully completed, click
to start the device.In the Nav tree, double-click the Sox device node to reconnect to the app running in the Device Simulator.
Access the wire sheet view for the JenDbd component in the app, and in the Sedona palette, open the jenAnalogIo palette, as shown here.
This change makes the palette of Jennic analog input/output controls available for use in app logic modifications.
When finished making changes to the app running in the Device Simulator, you can stop the simulation and save the modified app to your file system.
Saving the modified simulator app file
This procedure describes how to stop the simulation and save the modified app to your file system.
In the Sedona Device Simulator, while the app is running, click
, as shown below.A File Chooser dialog box displays prompting you to choose a location to save the app file, as shown below. The default location
is the
folder. The default file name is the original Simulator App file name that you began with. Change the file name as needed
to avoid overwriting the original app file.
!sedona/store/apps
If the filename you are saving is the same as an existing file, a prompt displays asking if you wish to overwrite the file.
If you click , the File Chooser displays again so you can modify the filename. If you click , the file is overwritten with the revised app saved from the simulator's sandbox.
On completion of this step you successfully stopped the simulation and saved the modified app to your file system.
If you encountered any problems while working with the simulated device, see the Troubleshooting appendix.
Copyright © 2000-2014 Tridium Inc. All rights reserved.