microsoft.jpg (2742 bytes)

Microsoft FAQ:

How do I use my Sealevel I/O Card with Microsoft?

    These examples illustrate how to put the SeaIO ActiveX components into Excel OR Word. 

              


Hardware
3rd Party Software
FAQ

Active I/O_Device in Excel:

Open a new Excel spreadsheet.  First make the Controls toolbar visible, with “Viewà ToolbarsàControls Toolbox.”  This shows drop-and-drag icons for the most common ActiveX controls, such as buttons or checkboxes, and presents a “More Controls” icon.  This picture shows the toolbar, with “Design Mode” the first icon, “Command Button” near the middle, and “More Controls” last.  Hold your cursor over an icon to learn its name.

Clicking the “More Controls” presents a list of registered ActiveIO objects to choose from.  (The SeaIO controls are registered when they are installed.)  Select ActiveIO_Device.  Now drag this over your spreadsheet.  A rectangular field with an oval in it will appear, this is the control itself.  Right-click this, and select properties.  This brings up the properties box.  It is possible to edit these properties to correctly connect to your SeaIO device, by changing the property “

This example uses another activeX control, a “command button.”  Find the command button on the controls toolbar, and single-click it, then drag an area on your spreadsheet.   The button appears.  Right click the button, and choose “Properties.”  A list of attributes appears.  Try changing “Caption,” writing your own text in, and you will see the caption on the button on the spreadsheet appear.  Also, notice that when you clicked on the button on the menu bar, the “Design Mode” button changed.  The “Design Mode” button is used to either edit, or run, your spreadsheet.

Now, select the “More Controls” icon.  The pulldown menu that appears will list all of the controls available, probably a large number of them.   Choose “ActiveIO_Device Control.”
Drag an area onto your screen, and an oval icon will appear.
SeaIO is now a part of your SpreadSheet.

This demo uses an easy way to demonstrate how to attach code to the spreadsheet.  There are many other methods.  Right-click on the “command button” you added previously.  Choose “Show Code.”  This will bring up the Microsoft Visual Basic editor.  Note that a routine is already stubbed out for you , as “Private Sub CommandButton1_Click()…End Sub.”  This is the routine that will be called when a user “clicks” on the button, “CommandButton1,” which you’ve created.  Type in the following lines:

   ActiveIo_Device1.deviceNumber = Sheet1.Cells(2, 2)

   ActiveIo_Device1.SetDirection 0, 1

   ActiveIo_Device1.WriteByte 0, 85, 1

Note that “ActiveIo_Device1” is the name of the SeaIo control you’ve added.  You’ve programmed the button to read the right devicenumber, set the first port to output, and send a byte as output. Now you’re ready to run your spreadsheet.

Get out of “Design Mode” with the “Exit Design Mode” icon on the controls tool bar.  Enter the text “Device Num” in cell A2.  Put the devicenumber of your SeaIO device, probably “2” in cell B2.  Now push the button.  The output should appear on port 1.  The example onoff.xls carries these commands a little further.

 


 

ActiveIo_PortDisplay in Word:

As in the above example, make sure your SeaIo device and software is completely installed, and know your device number.  First make the Controls toolbar visible, with “Viewà ToolbarsàControls Toolbox.”  See the first paragraph of the Excel description above for a description of the icons you’ll need.  Start a new document.

This time, choose the “More Controls” icon, and select “ActiveIo_PortDisplay.”  Drag an area on your document, and the display will appear.  Right-click the display, and choose “View Code.”

This time, we’re going to create a function we need.  Look at the left pull down menu at the top, and choose “Document.”  Note that this is also where we could access “ActiveIo_PortDisplay1” or other items.  Now that document is selected, use the right pull down menu to select “Open”, and click on it.   This should add the stub function to your code “Private Sub Document_Open()”.  This gets called when the document opens.  Add the following lines of code: 

ActiveIo_PortDisplay1.deviceNumber = 2

ActiveIo_PortDisplay1.Port = 0 

This code sets the deviceNumber and the port that this display is attached to.  If your device number is not two, put the correct number in the first line.  Use the Word Icon on the Visual Basic Editor to take you back to your document.  Save it, close it, and re-open it.  This invokes the “Document Open()” function.  You should have eight toggles displayed, and changing them will change the output on your SeaIo device.

WordWithLEDs.doc carries this example a little further.  Note the additional line of code needed to show LEDs on the second display. 

Good places to learn more about this would include the Help section from the Visual Basic Editor, particularly the “Visual Basic How-To Topics” section, and the SeaIo ActiveX documentation.