Apart from the “jenDbDemo” app already installed on a new Sedona dev board, the Sedona Workbench installation copies another
demo app to your
folder: <sedonaHome
>/sedona/appsjenDbDemo2.sax
. Using the Sox Manager, you can install this different app to see other Sedona component features.
To install, with a sox connection open to the Sedona dev board:
In the Nav tree, expand the node and double-click the sox icon to open the Sox Manager view.
To first save the current app to your PC, click the button at the bottom of the view.
A Get App dialog box appears with a default apps folder path and file name. Adjust file name if desired and click
.A Backup dialog appears showing progress writing the sax file. Click
when done.After saving the current app, click the button at the bottom of the view.
A Put App dialog box appears with a default path to a folder to find Sedona apps:
“
”
<SedonaHome>
\sedona\apps
Click
.The File Chooser dialog opens, showing the contents of the sedona\apps
folder.
Click the jenDbDemo2.sax
file to select, then click .
The Put App dialog box reflects “
”
<SedonaHome>
\sedona\apps\jenDbDemo2.sax
Click OK.
The Manage Kits dialog appears, listing kits used by the app chosen for installation. In this case, these will be the same kits used by the first demo app (jenDbDemo). Changes are not needed.
Click OK.
A Manage Kits progress dialog appears as the app is installed.
Click OK when done.
The dev board resets at the end of an app install, so you will need to reopen a sox connection when the node reappears ghosted
in the Nav tree. As in the other demo app, admin user credentials are:Username:
admin
Password: <none>
To see the basis for this app, expand the App node and double-click the jenDb2
folder to display its wire sheet view (Figure 21). Several pre-linked components are near the top.
These components are intended for use with pushbutton switches SW1 and SW2 to specify a “starting address”. SW1 increments this address up by 4 with each press, and SW2 decrements this address down by 4 with each press. The lower “toInt” named component converts the float out value of the “addr” component to an integer value.
By adding a few additional components from the dbDemo palette, along with a few links, you can write to (and read from) address locations in the serial EEPROM on the Dev Board. These values will be retained following a reset or power cycle, for example.
Figure 22 shows the JenDbDemo2 app after adding and linking an “Eeprom” component, along with a few others (note some components were re-positioned to make the screen capture smaller).
To recreate modifications shown in Figure 22:
Drag an Eeprom component from the dbDemo palette and drop under the “toInt” component.
Link the “Out” slot of the toInt component to the “Start Addr” slot of the Eeprom component.
Link the “seconds” slot of the “time” named component (child of the other “service” folder) to the “Write Value” slot of the Eeprom component. This link appears as the “knob” on the Eeprom glyph. Note the “toFloat” named component already has its “In” slot linked back to this same source.
The seconds output provides a ramping 0 to 59 integer value that repeats every minute. It is now the “source value” stored upon any invoked “Write to Eeprom” action on the Eeprom component. This ramping value is also driving the dac0 (analog output 1, 0 to 10V) from minimum to maximum.
(optional) Drag a DioOut component from the dbDemo palette onto the wire sheet, naming it “Led0”. Set its “Dio Num” property to 0, and its “Invert” property to True.
Link the “Out” slot of the “Up”-named component to the “In” slot of this Led0 DioOut component.
(second optional) Duplicate the Led0 DioOut component (right-click and select Duplicate), naming it “Led1”. Set its “Dio Num” property to 1, and leave its “Invert” property as True.
Link the “Out” slot of the “Down” component to the “In” slot of this Led1 DioOut component.
The two optional DioOut components simply provide visual feedback when you press the pushbuttons SW1 (increment) and SW2 (decrement)
to change the start address in EEPROM.
Test out the app changes after saving (right-click the top-level App node and select -> ).
The target “start address” location in EEPROM is visible on the top “Start Addr” slot of the Eeprom component, for example 0 or 4 (each press of SW1 increments this address up by 4). If you linked the “seconds” slot to the Eeprom component’s “Write Value” slot, you should see this value continually ramp from 0 to 59, then repeat. Below that, the “Read Value” slot reflects the read value at the start address, but only after a “Read from Eeprom” action is invoked.
Right-click the Eeprom component and select
-> .To see the value just written, right-click again and select
-> .Press SW1 to increment the starting address, then repeat the above. Repeat again as many times as desired (the EEPROM is 32KB, so the max starting address, in 4B intervals, is around 8000).
Press SW2 to decrement the starting address to any previously written, then read again to verify.
Alternatively, instead of writing the current time “seconds” value to EEPROM, you can drag a “ConstInt” component from the dbDemo palette, and link its “Out” slot to the Eeprom component’s “Write Value” slot instead. This way you can use the right-click “Set” action of the ConstInt component to specify any signed integer value (positive or negative) to store, not just 0 to 59.
Any target slot, that is receiving slot, such as “Write Value” can only be linked to one source slot. If “Write Value” is already linked, delete that link first. If linked to the “seconds” slot of the “time” component
(link appears as knob at “Write Value”), the quickest way to delete that link is:
In the Nav tree, expand the service folder.
Right-click the “time” component, and select
-> .Right-click the link to delete (in this case, its “other path” will be slot:/jenDbDemo2/Eeprom), and select
. The link is removed.In the Nav tree, double-click the jenDbd2 folder to return to its wire sheet view.
Add and link other components to discover other possibilities in the JenDbDemo2 app.
By default in the standard JenDbDemo2 app, if you take a multi-meter on a DC voltage setting, and put its probes in the AO1 (DAC 0) terminals, you should see periodic ramping from near 0V to 10V repeat each minute. See Figure 23 for location of these terminals.
Copyright © 2000-2014 Tridium Inc. All rights reserved.