snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CHAPTER 3: USING THE SNAP ETHERNET I/O DRIVER TOOLKIT<br />
other specific brain models. See page 6 for features that apply to each model. For example, SNAP<br />
Simple I/O does not do high-speed digital counting. Methods such as GetStreamReadArea<br />
normally read <strong>and</strong> write data on active counters; you can still use these methods for SNAP<br />
Simple I/O, but disregard any data in the areas that don’t apply.<br />
A Note on Multithreading<br />
The components <strong>and</strong> classes in this toolkit do not have internal synchronization. If you wish to<br />
access a single instance of an object from multiple threads, you must provide your own external<br />
synchronization.<br />
Installing the Driver Toolkit<br />
The SNAP Ethernet I/O Driver Toolkit consists of examples <strong>and</strong> all source code. It is included on<br />
the CD that came with the brain <strong>and</strong> is also available from our Web site at www.opto22.com.<br />
Two installations are available:<br />
For Windows, use SnapENETDTK_R20a.exe. It will copy all files <strong>and</strong> register the ActiveX<br />
components.<br />
If you have difficulty using the toolkit, make sure you have installed OptoEnetUtilities.exe,<br />
which updates certain system files.<br />
For Linux, use <strong>snap</strong>enetdtk_R20a.tar. It contains just the files needed for a Linux system.<br />
Overview of the ActiveX Components<br />
You can use the OptoSnapIoMemMapX <strong>and</strong> OptoSnapIoStreamX ActiveX components from<br />
Windows <strong>programming</strong> environments that support ActiveX components, such as Borl<strong>and</strong> Delphi,<br />
Microsoft Visual Basic®, Visual Basic for Applications, VBScript, <strong>and</strong> Visual C++. See “Important<br />
ActiveX Client Issues” on page 47 for more details on suitable clients.<br />
ActiveX is an umbrella term for many technologies <strong>based</strong> on COM (Component Object Model, a<br />
Microsoft technology allowing binary code reuse). Different <strong>programming</strong> environments use<br />
different terminology; in this chapter, we use terms as follows:<br />
An interface is a set of related functions (not a user interface).<br />
A component is an implementation of one or more interfaces.<br />
A control is a component that also has user interface elements.<br />
An object is an instance of a component.<br />
A type library is a description of a library’s exposed classes, interfaces, methods, <strong>and</strong><br />
properties. In this toolkit, the type library is contained in the OptoSnapIoMemMapX.dll file.<br />
46 SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide