Day 1 - Review Your Progress

You may now begin testing your driver's functionality. Please do the following to create a station, add your driver to it, and run your station:


Create a New Station in Workbench

  1. To be sure that your driver is completely built, Run slotomatic and perform a full build on your driver (as described in Chapter 2).
  2. If Workbench is open then please close it and re-open it (otherwise, it might not load the latest version of your driver).
  3. On the Workbench main menu, click Tools and then click New Station. A window titled New Station Wizard should appear.
  4. This is an illustration of the 'Tools' menu in the Niagara AX Workbench. The 'New Station' item is highlighted.

  5. Enter a name (such as TestStation) into the Station Name text box.
  6. This is an illustration of the New Station Wizard from the Niagara AX Workbench.

  7. Click the Next button. On the next screen of the wizard, you may enter an administrator password if you wish. You may also leave this blank if you'd rather.
  8. This is an illustration of the second screen of the New Station Wizard from the Niagara AX Workbench.

  9. Click the Finish button. The New Station Wizard window will then disappear.
  10. Notice that the Workbench Nav tree has automatically navigated to a file named config.bog that is directly under a folder with the same name as the one you supplied for the station name. This is your station database. Your new station is in offline mode. It is not actively running. It can still be configured though.
  11. This is an illustration of both the Nav bar and the main Workbench view immediately after clicking Finish from the New Station Wizard.


Add Your Driver's Network to the New Station

  1. Expand the config.bog file in the Nav tree.
  2. Double-click the Drivers component. The Driver Manager should appear in the main Workbench view area.
  3. An image of the Driver Manager

  4. Click the New button that is located towards the bottom of the Driver Manager. A window titled New should appear. It has a drop down list box named Type to Add and a text box named Number to Add.
  5. Click the drop down list box and verify that a listing for your driver's network appears in the list. Hint: If the Java file for your driver's network is named BYourDriverNetwork.java then you should see a listing of Your Driver Network in the list.
  6. Select your driver's network from the drop down list box.
  7. An image of the Driver Manager's New Dialog

  8. Click Ok. The New window disappears but another window titled New should appear.
  9. An image of the Driver Manager's New Dialog

  10. Click Ok. An instance of your driver's network has been added to the station. If you expand the Driver component below the config.bog file in the Nav tree you should see your network underneath. You should also see your network in the Driver Manager's list.

Add Your Driver's Device to Your Driver's Network That You Added to the New Station

  1. Double click the new instance of your driver's network that you added to the station. You may double-click it in the Nav tree or in the Driver Manager. The Device Manager for your driver should replace the Driver Manager in the main Workbench view area.
  2. You should see columns in the Device Manager that correspond to the names of the properties that you added to BYourDriverDeviceId. This happens as a result of adding the slot facet MGR_INCLUDE to the deviceId property in BYourDriverDevice.java and then to the properties that you declared in BYourDriverDeviceId.java.

    The following image shows the Device Manager for the Test Driver Network that the previous illustration added to the TestStation.

    An image of the Driver Manager after adding Your Driver Network to the station

  3. Click the New button that is located towards the bottom of the Device Manager.
  4. Click the drop down list box and verify that a single item is in the listing. The single item should be your driver's device. Hint: If the Java file for your driver's device is named BYourDriverDevice.java then you should see a listing of Your Driver Device in the list.
  5. Select your driver's device from the drop down list box.
  6. Click Ok. The New window disappears but another window titled New should appear. This window should have a text box or drop down list box for each property that you declared in BYourDriverDeviceId with the MGR_INCLUDE slot facet.
  7. An image of the second New dialog that appears after clicking Ok from the first New dialog that appears after clicking the New button on the Device Manager.

  8. Enter what you believe are reasonable values into the fields for your device id. Your goal should be to identify a field-device that you would like your driver to access.
  9. Click Ok. An instance of your driver's device has been added to the station. If you expand your driver's network component (below the Drivers component of the config.bog file) in the Nav tree you should see your device underneath. You should also see your device in the Device Manager's list.
  10. An image of the second New dialog that appears after clicking Ok from the first New dialog that appears after clicking the New button on the Device Manager.


Save your station

  1. In the Nav tree, right click the config.bog file that is the station folder for your offline station.
  2. Select Save from the pop-up menu. The following image illustrates this.
  3. An illustration showing the pop-up menu that appears when the station config.bog file is right-clicked. The pop-up menu features an option to Save the station.


Run Your Station

  1. Open a Niagara Console. You typically do this by clicking the Windows Start menu, hovering over programs, then hovering over Niagara 3.2.8 (or whatever version of Niagara AX you are using), and selecting Console.
  2. In the Niagara Console type station <NewStation> but replace <NewStation> with the name that you assigned to your station. Press enter after you type this text.
  3. 
    d:\Niagara-3.2.x> station TestStation
    MESSAGE [12:27:06 22-Mar-07 EDT][sys.registry] Up-to-date [140ms]
    MESSAGE [12:27:07 22-Mar-07 EDT][sys] Baja runtime booted ("d:\niagara\niagara-3.2.8")
    MESSAGE [12:27:07 22-Mar-07 EDT][sys.registry] Loaded [390ms]
    MESSAGE [12:27:08 22-Mar-07 EDT][sys] Loading "d:\niagara\niagara-3.2.8\stations\TestStation\config.bog"...
    MESSAGE [12:27:12 22-Mar-07 EDT][sys] Loaded (4166ms)
    MESSAGE [12:27:16 22-Mar-07 EDT][alarm.database] Created
    MESSAGE [12:27:16 22-Mar-07 EDT][sys] Services Initialized (210ms)
    MESSAGE [12:27:16 22-Mar-07 EDT][sys.mixin] Updated [0ms]
    WARNING [12:27:16 22-Mar-07 EDT][platform] Local daemon session not available, station not started by niagarad
    MESSAGE [12:27:16 22-Mar-07 EDT][web.server] HTTP Server started on port 80
    MESSAGE [12:27:16 22-Mar-07 EDT][fox] Service started on port 1911
    MESSAGE [12:27:16 22-Mar-07 EDT][sys] nre.version: 3.2.8
    MESSAGE [12:27:16 22-Mar-07 EDT][sys] *** Station Started (832ms) [11938ms total] ***
    niagara>
    
    

  4. Your station program should begin executing. Your station is now online.

Connect to Your Online Station

  1. Return to Workbench.
  2. Click the File menu. Hover over the Open menu item. Select Open Station (fox) in the side-menu that appears. A window titled Open Station should appear.
  3. An illustration showing the Workbench File menu with the mouse hovered over the Open menu item to the Open Station (fox) menu item.

  4. Leave the Host empty. That will cause it to default to the local host, which is your Workstation (personal computer).
  5. For User enter admin (all lower case)
  6. For Password either leave empty or enter the administrator password that you entered back when you created the station.
  7. Click Ok.
  8. Shows the Open Station dialog that appears after following this step.

  9. The Open Station window should disappear. After collapsing the My File System item that is in the Workbench Nav tree, the Nav tree should look something like the following image.
  10. This Image Shows the Nav Tree With An Online Station Component Under the Local Host

  11. Expand the online station component that appears under your host in the Nav tree.
  12. Expand the Config component of your station.
  13. Expand your driver's network that is under the Config component in your station.

    Shows Workbench connected to the sample station, with the Config and Drivers components expanded.


Configure the Communications Settings For Your Driver

  1. If you created a serial device or a Tcp/Ip gateway device during the day's lesson then right-click your driver's network in the Nav tree.
  2. If you created a regular Tcp/Ip device (not a Tcp/Ip gateway device) during the day's lesson then expand your driver's network in the Nav tree and then right-click your driver's Tcp/Ip device.
  3. After right-clicking, hover over the Views menu item. A side-menu should appear.
  4. Click Property Sheet in the Views side-menu.
  5. Shows views side-menu on the sample network that is in the station .

  6. The main Workbench view are should now display the properties for the component that your right-clicked.
  7. Shows the property sheet of the sample network that is in the station.

  8. Notice the Communicator component appears in the Property Sheet. Expand it in the Property Sheet by clicking the plus sign that is next to it.
  9. Expand the Serial Port Parameters or the Tcp Ip Parameters property (which ever one is present) and enter the correct serial settings (such as comm. port, baud rate, etc.) or the correct Tcp/Ip settings (i.p. address and port of a field-device or field-gateway).

    Shows the property sheet of Serial Port Parameters that are on the communicator that is on the sample network of the station.

WARNING: To stop your station, type quit in its console window. Failure to do so will likely discard any modifications that you made to the station while it was online.

The station will automatically, periodically ping your device. You can also right-click your device and invoke the ping action.


To review the data that your driver is transmitting and receiving

  1. Right click the station in the Nav tree.
  2. Click Spy.
  3. Shows the right-click menu that appears over the station component in the Nav tree.

  4. Click logSetup in the main Workbench view that appears.
  5. Shows the Workbench view that appears after you click Spy on the right-click menu that appears over the station component in the Nav tree.

  6. Notice that there is an entry for your network or device. Activate trace for it by clicking the [O] that is in the Trace column.
  7. Shows an entry in the Spy setup for a sample network.
  8. Save the log settings.
  9. Shows how to save the log settings.

  10. Then you will see in the station's standard output a summary of all bytes being sent and received.

It might take some testing to verify that your driver is indeed transmitting the correct bytes to your field device and that your field device is indeed responding as expected.

Congratulations! You now have a driver with a network and a device that communicates!