Index |
Prev |
Next
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
- To be sure that your driver is completely built, Run slotomatic and perform a full build on your driver (as described in Chapter 2).
- If Workbench is open then please close it and re-open it (otherwise, it might not load the latest version of your driver).
- On the Workbench main menu, click Tools and then click New Station. A window titled New Station Wizard should appear.
- Enter a name (such as TestStation) into the Station Name text box.
- 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.
- Click the Finish button. The New Station Wizard window will then disappear.
- 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.
Add Your Driver's Network to the New Station
- Expand the config.bog file in the Nav tree.
- Double-click the Drivers component. The Driver Manager should appear in the main Workbench view area.
- 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.
- 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.
- Select your driver's network from the drop down list box.
- Click Ok. The New window disappears but another window titled New should appear.
- 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
- 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.
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.
- Click the New button that is located towards the bottom of the Device Manager.
- A window titled New should appear.
- This window should look nearly identical to the New window that appeared when you added your network to the new station.
- This New window has a drop down list box named Type to Add and a text box named Number to Add.
- 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.
- Select your driver's device from the drop down list box.
- 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.
- 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.
- 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.
Save your station
- In the Nav tree, right click the config.bog file that is the station folder for your offline station.
- Select Save from the pop-up menu. The following image illustrates this.
Run Your Station
- 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.
- 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.
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>
|
- Your station program should begin executing. Your station is now online.
Connect to Your Online Station
- Return to Workbench.
- 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.
- Leave the Host empty. That will cause it to default to the local host, which is your Workstation (personal computer).
- For User enter admin (all lower case)
- For Password either leave empty or enter the administrator password that you entered back when you created the station.
- Click Ok.
- 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.
- Expand the online station component that appears under your host in the Nav tree.
- Expand the Config component of your station.
- Expand your driver's network that is under the Config component in your station.
Configure the Communications Settings For Your Driver
- 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.
- 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.
- After right-clicking, hover over the Views menu item. A side-menu should appear.
- Click Property Sheet in the Views side-menu.
- The main Workbench view are should now display the properties for the component that your right-clicked.
- 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.
- 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).
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
- Right click the station in the Nav tree.
- Click Spy.
- Click logSetup in the main Workbench view that appears.
- 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.
- Save the log settings.
- 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!
Index |
Prev |
Next
Copyright © 2000-2014 Tridium Inc. All rights reserved.