Exploring the jenDbDemo app

The following is one recommendation and other suggestions when examining the “jenDbDemo” app that ships in a new Sedona Dev Board:

Initialize the real-time clock

Initialize the real-time clock on the Sedona dev board, which ships factory uninitialized. To do this from either demo app, once opened in Workbench:

  1. Expand the service folder, and double-click the “time” named component (DateTimeServiceJenRtc), which produces its default Date Time Service View.

  2. Click the Local Time button, then click Save at the bottom.

    The Current Time and Time Zone fields should update to reflect your Workbench PC’s time and date settings.

  3. In the Nav tree, right-click the top-level App node and select Actions->Save.

    To make initialization persistent, this is required. See Saving app changes.

    NoteAlternatively, instead of using the Local Time button, you can use the individual controls in the Date Time Service View. For example, in the Current Time field under the “Desired” column, click on the date/time portion to highlight/select (day, month, year, hours, minutes, and AM/PM), then click the increment/decrement control to change each item. Adjust so the current date and time is displayed.Or, click the calendar for the popup date editor, and advance to today’s date. You can also type in numerals for day, hour, and minutes directly, after selecting such a field. Regardless of method, after reviewing the different fields for accuracy, click Save at the bottom and then save the App node.

Once initialized, the real-time clock should be maintained through a reset (software or hardware) or past a power off period.

See child component relationship to wire sheet of parent

In the Nav tree with the service folder expanded, note the four children named “plat”, “time”, “sox”, and “users”. Double-click the service folder and note the service component glyphs (shapes) are “stacked” on top of each other in the folder’s wire sheet view. This has no ill effects. However, right-click the wire sheet background and select Arrange, then Arrange All. Further drag to reposition the four child components, if desired.

The default view for a folder component is its wire sheet view. Each child component is positioned on the wire sheet according to its x and y “position” integers within its “meta” slot (Meta property), which also holds security group settings. In the case of the service folder in the default jenDbDemo app, all four child components originally had x=1 and y=1 position values. Because no links were made to any of these components, wire sheet usage of this folder had little importance.

Add and link in a digital input component

To see the basis for the JenDbDemo app, double-click its jenDbd folder to display its wire sheet view. The default app has components that continuously flash LEDs D1 and D2 on the Sedona dev board in an alternating pattern. Add a component that allows pausing this sequence by pressing pushbutton SW1. To do this:

  1. Expand the App, and double-click the jenDbd folder, which produces its wire sheet.

  2. In the side bar Sedona Palette, select the basicio kit, to show its five components.

  3. Drag a DioIn component from the basicio palette into the wire sheet, dropping it under the TickToc component.

    In the popup Name dialog, type in “SW1” and click OK.

  4. Double-click the new DioIn component to access its property sheet.

  5. In the property sheet, change the Dio Num property from -1 to 8, then click Save at the bottom.

  6. While looking at the property sheet, press pushbutton SW1 on the dev board, and notice the Out value changing from True (switch open) to False (switch closed).

    By default, digital inputs are “active low”. The Invert property allows “flipping this”, as needed.

  7. Click the Up Level tool to return to the parent folder’s wire sheet.

  8. Right-click the Enable named component and select Views->Link Sheet.

    Two links are shown in the view, each with an “outbound” direction.

  9. Hold the Shift key and click both links to select, highlighting both link rows.

    Right-click and select Delete Links. The link sheet table is now cleared of entries, and the LEDs D1 and D2 on the dev board are no longer flashing.

  10. Click the Up Level tool to return to the parent folder’s wire sheet. Link connectors no longer appear between the component named Enable and the two And2 components.

  11. Click on SW1 component’s Out slot (right side) and drag to the In1 slot (left side) of the top And2 component (And_0).

    When linking this way, the slot’s appearance highlights to indicate selection and availability, and after dragging the link connector graphically appears between the component shapes.

  12. Repeat this to link SW1 component’s Out slot (right side) to the In1 slot (left side) of the bottom And2 component (And_1). Both And2 components should be linked back to the new SW1 (DioIn) component, which enables the LED flashing sequence.

    Depending on the Invert property value of the DioIn component, both LEDs should be either flashing or be off with the SW1 pushbutton open. Press the SW1 pushbutton on the dev board and observe.

Add and link in an analog output component

The default jenDbDemo does not include any components for analog I/O, either inputs (ADC) or outputs (DAC). This exercise simply adds a “Dac” component to interface to the DAC1 output of the SED-M0x module, represented at the 0 to 10V analog output 1 (AO1 terminals) of the dev board. Included is the necessary logic to have it continuously ramp from minimum to maximum output each minute.

  1. Expand the App, and double-click the jenDbd folder, which produces its wire sheet.

  2. In the side bar Sedona Palette, select the basicio kit, to show its five components.

  3. Drag a Dac component from the basicio palette into the wire sheet, dropping it above the And_0 named component.

    In the popup Name dialog, type in “Dac1” and click OK.

  4. Double-click the new Dac component to access its property sheet.

  5. In the Dac’s property sheet, change:

    • Which Dac property from -1 to 0 (addressing is 0-based, where DAC1=0, DAC2=1)

    • Range Max property from 0.00 to 59.00

      leaving Range Min at default 0.00.

    then click Save at the bottom.

  6. Click the Up Level tool to return to the parent folder’s wire sheet.

  7. In the side bar Sedona Palette, select the dbDemo kit, to show its 13 components.

  8. Drag a I2F (Integer to Float) component from the dbDemo palette into the wire sheet, dropping it to the left of the new DAC1 component.

    In the popup Name dialog, leave at default “I2F” and click OK. Now, link the two new components.

  9. To do this, click on the I2F component’s Out slot (right side) and drag to the Value slot (left side) of Dac1. After dragging, the link connector graphically appears between the component shapes.

  10. In the Nav tree, expand the App node, then expand the service folder to list the child components.

  11. In the Nav tree, right-click the time named component, and from the shortcut menu select Link Mark.

  12. In the wire sheet the jenDbd folder, right-click the I2F component, and from the shortcut menu select Link from “time”.

    A popup Link dialog appears, listing slots of the source (time) component on the left, and slots of the target (I2F) component on the right.

  13. In the Link dialog, click to select:

    • Left side time (Source): Second

    • Right side I2F (Target): In

    and click OK.

    The Link dialog closes and a link “knob” appears on the In slot of the I2F component shape.

    If you mouse over the link knob, note that the “status bar area” of the Workbench window (lower left corner of window) reports the link in text format, similar to:

    /service/time.Slot4 - > /jenDbd/I2F.Slot1

To summarize, the integer “seconds” slot of the time (DateTimeServiceJenRtc) component continuously ramps from 0 to 59 each minute. This value feeds the linked I2F component, which converts the integer value to a floating point value. This value feeds the linked Dac component, such that it ramps between minimum and maximum out range each minute.

If you check the AO1 output terminals with a multi-meter set to DC voltage, you should see this reflected as the output voltage ramps from approximately 0 to 10Vdc each minute.

Add and link in an analog input component

As a simple self-contained test, you can wire “loop back” connections between the DAC (AO1 and AO2) output terminals on the Sedona dev board to ADC inputs, say the AI1 and AI2 terminals. For such wiring between the dev board’s two AO outputs and AI inputs, see Figure 20.

Figure 20. Loop back wiring from DAC (AO) outputs to ADC (AI) inputs on Sedona dev board


Loop back wiring from DAC (AO) outputs to ADC (AI) inputs on Sedona dev board

If you added the Dac component and logic to produce the ramping AO1 output on the Sedona dev board (see previous section Add and link in an analog output component), this loopback wiring lets you monitor the ramping output within the app, using an “Adc” component. To do this:

  1. In the side bar Sedona Palette, open the basicio kit, to show its five components.

  2. Drag an Adc component from the basicio palette into the wire sheet of the jenDbd folder, dropping it anywhere. In the popup Name dialog, type in “Adc1” and click OK.

  3. Double-click the new Adc component to access its property sheet.

  4. In the Adc’s property sheet, change:

    • Which Adc property from -1 to 0 (addressing is 0-based, where ADC1=0, ADC2=1, and so on)

    • Range Max property from 0.00 to 59.00

      leaving Range Min at default 0.00.

    then click Save at the bottom.

    The value of the Adc component remains at 0.00—another component is needed for ADC scanning.

  5. In the Nav tree, expand the App node to show the service folder.

  6. From the side bar basicio palette, click and drag the AdcScanService onto the service folder in the Nav tree, until it highlights green showing the add [+] symbol.

    In the popup Name dialog, leave at default “AdcScan” and click OK.

    NoteOnly one AdcScanService is needed, and only if the app uses ADC inputs of the SED-M0x module. Note the AdcScanService has no effective configuration properties.

    Note the previously added Adc component should now be ramping between minimum and maximum value each minute. This should be visible from both the property sheet of the Adc component, as well as the wire sheet of its parent jenDbd folder.