IMPORT TO ACTIVE - Αντίγραφο

download IMPORT TO ACTIVE - Αντίγραφο

of 12

Transcript of IMPORT TO ACTIVE - Αντίγραφο

  • 7/29/2019 IMPORT TO ACTIVE -

    1/12

    4 IMPORT TO ACTIVE-X COMPONENT

    Products for USB Sensing and Control Home

    Support

    Forums

    Drivers

    Programming

    Contact Us

    Dealers

    Language - Delphi

    From Phidgets Support

    Jump to: navigation,search

    Embarcadero Delphi is an integrated development environment for

    console, desktop graphical, web application, and mobile applications.

    Contents[hide]

    1 Introduction

    2 Quick Downloads

    o 2.1 Documentation

    o 2.2 Example Code

    o 2.3 Libraries and Drivers

    3 Getting Started with Delphi

    4 Windows(XP/Vista/7/8)

    o 4.1 Borland Delphi

    4.1.1 Import ActiveX Objectso 4.2 Embarcadero Delphi XE2

    4.2.1 Import ActiveX Objects

    4.2.2 Use Our Examples

    4.2.3 Write Your Own Code

    5 Follow The Examples

    o 5.1 Code Snippets

    5.1.1 Step One: Initialize and Open

    5.1.2 Step Two: Wait for Attachment (plugging in) of the

    Phidget

    5.1.3 Step Three: Do Things with the Phidget

    5.1.4 Step Four: Close and Delete

    http://www.phidgets.com/index.phphttp://www.phidgets.com/docs/http://www.phidgets.com/phorum/http://www.phidgets.com/docs/Operating_System_Supporthttp://www.phidgets.com/docs/Programming_Resourceshttp://www.phidgets.com/docs/Contact_Ushttp://www.phidgets.com/docs/Dealershttp://www.phidgets.com/docs/Language_-_Delphi#mw-head%23mw-headhttp://www.phidgets.com/docs/Language_-_Delphi#mw-head%23mw-headhttp://www.phidgets.com/docs/Language_-_Delphi#p-search%23p-searchhttp://www.embarcadero.com/products/delphihttp://www.phidgets.com/docs/Language_-_Delphi#%23http://www.phidgets.com/docs/Language_-_Delphi#Introduction%23Introductionhttp://www.phidgets.com/docs/Language_-_Delphi#Quick_Downloads%23Quick_Downloadshttp://www.phidgets.com/docs/Language_-_Delphi#Documentation%23Documentationhttp://www.phidgets.com/docs/Language_-_Delphi#Example_Code%23Example_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Libraries_and_Drivers%23Libraries_and_Drivershttp://www.phidgets.com/docs/Language_-_Delphi#Getting_Started_with_Delphi%23Getting_Started_with_Delphihttp://www.phidgets.com/docs/Language_-_Delphi#Windows.28XP.2FVista.2F7.2F8.29%23Windows.28XP.2FVista.2F7.2F8.29http://www.phidgets.com/docs/Language_-_Delphi#Borland_Delphi%23Borland_Delphihttp://www.phidgets.com/docs/Language_-_Delphi#Import_ActiveX_Objects%23Import_ActiveX_Objectshttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_Delphi_XE2%23Embarcadero_Delphi_XE2http://www.phidgets.com/docs/Language_-_Delphi#Import_ActiveX_Objects_2%23Import_ActiveX_Objects_2http://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Write_Your_Own_Code%23Write_Your_Own_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Follow_The_Examples%23Follow_The_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Code_Snippets%23Code_Snippetshttp://www.phidgets.com/docs/Language_-_Delphi#Step_One:_Initialize_and_Open%23Step_One:_Initialize_and_Openhttp://www.phidgets.com/docs/Language_-_Delphi#Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidget%23Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidget%23Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Three:_Do_Things_with_the_Phidget%23Step_Three:_Do_Things_with_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Four:_Close_and_Delete%23Step_Four:_Close_and_Deletehttp://www.phidgets.com/http://www.phidgets.com/docs/http://www.phidgets.com/phorum/http://www.phidgets.com/docs/Operating_System_Supporthttp://www.phidgets.com/docs/Programming_Resourceshttp://www.phidgets.com/docs/Contact_Ushttp://www.phidgets.com/docs/Dealershttp://www.phidgets.com/docs/Language_-_Delphi#mw-head%23mw-headhttp://www.phidgets.com/docs/Language_-_Delphi#p-search%23p-searchhttp://www.embarcadero.com/products/delphihttp://www.phidgets.com/docs/Language_-_Delphi#%23http://www.phidgets.com/docs/Language_-_Delphi#Introduction%23Introductionhttp://www.phidgets.com/docs/Language_-_Delphi#Quick_Downloads%23Quick_Downloadshttp://www.phidgets.com/docs/Language_-_Delphi#Documentation%23Documentationhttp://www.phidgets.com/docs/Language_-_Delphi#Example_Code%23Example_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Libraries_and_Drivers%23Libraries_and_Drivershttp://www.phidgets.com/docs/Language_-_Delphi#Getting_Started_with_Delphi%23Getting_Started_with_Delphihttp://www.phidgets.com/docs/Language_-_Delphi#Windows.28XP.2FVista.2F7.2F8.29%23Windows.28XP.2FVista.2F7.2F8.29http://www.phidgets.com/docs/Language_-_Delphi#Borland_Delphi%23Borland_Delphihttp://www.phidgets.com/docs/Language_-_Delphi#Import_ActiveX_Objects%23Import_ActiveX_Objectshttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_Delphi_XE2%23Embarcadero_Delphi_XE2http://www.phidgets.com/docs/Language_-_Delphi#Import_ActiveX_Objects_2%23Import_ActiveX_Objects_2http://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Write_Your_Own_Code%23Write_Your_Own_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Follow_The_Examples%23Follow_The_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Code_Snippets%23Code_Snippetshttp://www.phidgets.com/docs/Language_-_Delphi#Step_One:_Initialize_and_Open%23Step_One:_Initialize_and_Openhttp://www.phidgets.com/docs/Language_-_Delphi#Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidget%23Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidget%23Step_Two:_Wait_for_Attachment_.28plugging_in.29_of_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Three:_Do_Things_with_the_Phidget%23Step_Three:_Do_Things_with_the_Phidgethttp://www.phidgets.com/docs/Language_-_Delphi#Step_Four:_Close_and_Delete%23Step_Four:_Close_and_Deletehttp://www.phidgets.com/index.php
  • 7/29/2019 IMPORT TO ACTIVE -

    2/12

    5.1.5 Enabling Logging

    5.1.6 More How-To's

    6 Common Problems and Solutions/Workarounds

    o 6.1 Embarcadero XE2: The Phidget Manager creates a runtime fault

    o 6.2 Embarcadero XE2 under Windows in Oracle VirtualBox: SystemCrash

    Introduction

    If this is your first time working with a Phidget, we suggest starting with the Getting

    Startedpage for your specific device. This can be found in the user guide for your

    device. That page will walk you through installing drivers and libraries for your

    operating system, and will then bring you back here to use Delphi specifically.

    Delphi is capable of using the complete Phidget API. We also provide example code

    in Delphi for AdvancedServo, Servo, Phidget Interface Kit, Phidget IR, Encoder, and

    RFID.

    Delphi can be developed with Windows.

    You can compare Delphi with our othersupported languages.

    Quick DownloadsJust need the Delphi documentation, drivers, libraries, and examples? Here they are:

    Documentation

    COM API Manual

    Example Code

    Delphi Example Code

    Libraries and Drivers

    32-bit Windows Drivers Installer

    64-bit Windows Drivers Installer

    Windows Driver and Library Files (Zipped)

    Getting Started with Delphi

    If you are new to writing code for Phidgets, we recommend starting by running, then

    modifying existing examples. This will allow you to:

    http://www.phidgets.com/docs/Language_-_Delphi#Enabling_Logging%23Enabling_Logginghttp://www.phidgets.com/docs/Language_-_Delphi#More_How-To.27s%23More_How-To.27shttp://www.phidgets.com/docs/Language_-_Delphi#Common_Problems_and_Solutions.2FWorkarounds%23Common_Problems_and_Solutions.2FWorkaroundshttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2:_The_Phidget_Manager_creates_a_runtime_fault%23Embarcadero_XE2:_The_Phidget_Manager_creates_a_runtime_faulthttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crash%23Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crashhttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crash%23Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crashhttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/Software_Overview#Language_Supporthttp://www.phidgets.com/documentation/COM_API_Manual.pdfhttp://www.phidgets.com/downloads/examples/Delphi.ziphttp://www.phidgets.com/downloads/libraries/Phidget-x86.exehttp://www.phidgets.com/downloads/libraries/Phidget-x64.exehttp://www.phidgets.com/downloads/libraries/Phidget21-windevel.ziphttp://www.phidgets.com/docs/Language_-_Delphi#Enabling_Logging%23Enabling_Logginghttp://www.phidgets.com/docs/Language_-_Delphi#More_How-To.27s%23More_How-To.27shttp://www.phidgets.com/docs/Language_-_Delphi#Common_Problems_and_Solutions.2FWorkarounds%23Common_Problems_and_Solutions.2FWorkaroundshttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2:_The_Phidget_Manager_creates_a_runtime_fault%23Embarcadero_XE2:_The_Phidget_Manager_creates_a_runtime_faulthttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crash%23Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crashhttp://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crash%23Embarcadero_XE2_under_Windows_in_Oracle_VirtualBox:_System_Crashhttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/Software_Overview#Language_Supporthttp://www.phidgets.com/documentation/COM_API_Manual.pdfhttp://www.phidgets.com/downloads/examples/Delphi.ziphttp://www.phidgets.com/downloads/libraries/Phidget-x86.exehttp://www.phidgets.com/downloads/libraries/Phidget-x64.exehttp://www.phidgets.com/downloads/libraries/Phidget21-windevel.zip
  • 7/29/2019 IMPORT TO ACTIVE -

    3/12

    Make sure your libraries are properly linked

    Go from source code to a test application as quickly as possible

    Ensure your Phidget is hooked up properly

    Delphi is a .COM-based language. Currently Windows is the only supported

    operating system for Delphi:

    Windows 2000 / XP / Vista / 7

    Windows(XP/Vista/7/8)

    Borland Delphi

    The Phidget examples were written using Borland Delphi 2005 and 7, although they

    also work with other versions of Delphi as described on this Delphi Language page.

    We include the method to import ActiveX objects onto these platforms, but ourcurrent in-depth support for using our examples and writing your own code is only for

    Embarcadero Delphi XE2.

    Import ActiveX Objects

    The ActiveX objects installed with the Phidget libraries are not automatically

    imported into Delphi, so to begin you will need to manually import them.

    In Delphi 2005/2006:

    1. Go to FileNewPackage - Delphi for Win32. Rename and save thepackage using FileSave Project As...

    2. Import the ActiveX component, go to ComponentImport Component.

    3. Choose Inport ActiveX Control and click Next

    4. Select Phidget Library 2.1 and click Next

    5. Click Next

    6. Select Add unit to [Package Name] project and click Finish.

    7. Install the ActiveX package you have created by right-mouse-clicking the

    package name in the Project Manager pane and selecting Install.

    8. Delphi should now display a confirmation that the package was installed.

    Click ok and save the package.9. When you open a new or existing application, you should now see all the

    Phidget device control objects listed under the ActiveX category.

    In slightly newer versions of Delphi:

    1. Go to ComponentImport Component...

    2. Choose Import ActiveX Control and click Next

    3. Pick Phidget Library 2.1 from the list and click Next

    4. Set the palette Page to ActiveX and check the Generate Component Wrappers

    option

    5. Choose Install into a new package and click next

    http://www.phidgets.com/docs/Language_-_Delphi#Windows.282000.2FXP.2FVista.2F7.29%23Windows.282000.2FXP.2FVista.2F7.29http://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_Delphi_XE2%23Embarcadero_Delphi_XE2http://www.phidgets.com/docs/Language_-_Delphi#Windows.282000.2FXP.2FVista.2F7.29%23Windows.282000.2FXP.2FVista.2F7.29http://www.phidgets.com/docs/Language_-_Delphi#Embarcadero_Delphi_XE2%23Embarcadero_Delphi_XE2
  • 7/29/2019 IMPORT TO ACTIVE -

    4/12

    6. Give the package a name and description such as Phidgets, and then click

    Finish

    Once installed, all future projects will be able to use the Phidget ActiveX objects.

    Embarcadero Delphi XE2

    Embarcadero Delphi is the more recent platform for developing Delphi on. To use it,

    we follow the same setup procedure as Borland, which is to first import the Phidget

    library as an ActiveX object. We then offer in-depth instructions on how to use the

    Phidget examples, both as described below.

    Import ActiveX Objects

    The ActiveX objects installed with the Phidget libraries are not automatically

    imported into Delphi, so to begin you will need to manually import them. In

    Embarcadero XE2, do the following:

    1. Go to ComponentImport Component...

    2. Choose Import ActiveX Control and click Next:

  • 7/29/2019 IMPORT TO ACTIVE -

    5/12

    3. Pick Phidget Library 2.1 from the list and click Next:

  • 7/29/2019 IMPORT TO ACTIVE -

    6/12

    4. Choose Install into a new package and click next:

    5. Give the package a name and description such as Phidgets, and then click Finish.

    6. To finish, the objects need to be re-linked. When prompted to do this, click Yes:

    At this point, opening a new project will have the use of the Phidget library. If you

    already had a project open, you will need to close and re-open it for the linking to

    Phidgets to occur.

    Use Our Examples

    After you have installed the Active X objects, you can open our examples and run

    code to test your device. The source file will be named the same as the software

    http://www.phidgets.com/docs/Language_-_Delphi#Install_ActiveX_Objects%23Install_ActiveX_Objectshttp://www.phidgets.com/docs/Language_-_Delphi#Install_ActiveX_Objects%23Install_ActiveX_Objects
  • 7/29/2019 IMPORT TO ACTIVE -

    7/12

    object for your device. If you are not sure what the software object for your device is,

    find your Phidget on ourwebpage, and then check the API documentation for it.

    First download the Delphi examples and unpack them. Each project has its own

    folder. You can open an existing project and navigate to the project file itself to open

    it:

    Then, the project and all of its files will appear in your project navigator on the right.

    Plug in your Phidget to your computer, and make sure no other programs are

    accessing the Phidget. Right-click on the project root and select "Run". For example,

    for the Interface Kit Phidget, your project will probably look something like this:

    The GUI form of the example will open, and you can test your device.

    Write Your Own Code

    http://www.phidgets.com/http://www.phidgets.com/downloads/examples/Delphi.ziphttp://www.phidgets.com/http://www.phidgets.com/downloads/examples/Delphi.zip
  • 7/29/2019 IMPORT TO ACTIVE -

    8/12

    In Embarcadero, the lower right panel displays the available ActiveX objects for

    coding. You can create a new project and then simply drag the ActiveX object that

    matches your Phidget device into your project.

    We have a teaching sectionbelow which includes code snippets to augment the

    examples and help you compose your project.

    Follow The Examples

    By following the instructions above, you probably now have a working example and

    want to understand it better so you can change it to do what you want. This teaching

    section has resources for you to learn from the examples and write your own.

    Your main reference for writing Delphi code will be our .COM API information, with

    syntax for all of our functions:

    .COM API (This is the complete set of functions you have available for all

    Phidgets)

    Device Specific APIs - The one for your Phidget can be found in itsuser

    guide.

    To learn the details behind opening, configuring, using, and closing your Phidget, try

    the General Phidget Programmingpage. That page also describes using the Phidget in

    an event-driven manner and in a traditional manner, both of which are available in

    Delphi.

    Code Snippets

    Specific calls in Delphi will differ in syntax from those on theGeneral Phidget

    Programming page, but the concepts stay the same.

    It may help to have the General Phidget Programming page and this section open at

    the same time, because they parallel each other and you can refer to the Delphi

    syntax. However, many additional concepts are covered on the General Phidget

    Programming page on a high level, such as using multiple Phidgets, handling errors,

    and different styles of programming.

    Step One: Initialize and Open

    Before you can use the Phidget, you must declare and initialize its ActiveX object.

    The simplest method is to place the control from the ActiveX component tab on to

    your form. For this tutorial, we create a Phidget Interface Kit control

    (PhidgetInterfaceKit1) and then add a text edit field to the form for the purpose of

    capturing simple output. The object name for any type of Phidget is listed in the API

    manual. Every type of Phidget also inherits functionality from the Phidget base class.

    Next, we need to tell the program to try and connect to the Phidget through a call to

    open(). The open will tell the program to continuously try to connect to a Phidget,based on the parameters given, even trying to reconnect if it gets disconnected:

    http://www.phidgets.com/docs/Language_-_Delphi#Follow_The_Examples%23Follow_The_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Follow_The_Examples%23Follow_The_Exampleshttp://www.phidgets.com/documentation/COM_API_Manual.pdfhttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/Language_-_Delphi#Follow_The_Examples%23Follow_The_Exampleshttp://www.phidgets.com/documentation/COM_API_Manual.pdfhttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/Category:UserGuidehttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programming
  • 7/29/2019 IMPORT TO ACTIVE -

    9/12

    procedure TForm1.FormCreate(Sender: TObject);

    begin

    PhidgetInterfaceKit1.Open(-1);

    end;

    The parameters (here just a -1) can also be used to open the first Phidget of a type it

    can find, open based on its serial number, or even open across the network. The APImanual lists all of the available modes that open provides.

    One important thing to remember is that when working with Phidgets, a local

    connection will reserve the device until closed. This prevents any other instances from

    retrieving data from the Phidget, including other programs. The one connection per

    device limit does not apply when exclusively using the Phidget WebService. To open

    multiple Phidgets, they each need their own ActiveX object, and you can distinguish

    between them by serial number.

    Step Two: Wait for Attachment (plugging in) of the Phidget

    Calling open does not guarantee you can use the Phidget immediately. To use the

    Phidget, it must be plugged in (attached). We can handle this by using event driven

    programming and tracking the AttachEvents and DetachEvents, or we can handle this

    by calling WaitForAttachment. You can put the wait function right after your open

    function. So we can modify our opening block to read:

    procedure TForm1.FormCreate(Sender: TObject);

    begin

    PhidgetInterfaceKit1.Open(-1);

    PhidgetInterfaceKit1.WaitForAttachment(3000);

    end;

    This function works for any Phidget. WaitForAttachment will block indefinitely until

    a connection is made to the Phidget, or an optional timeout is exceeded.

    Step Three: Do Things with the Phidget

    We recommend the use ofevent driven programming when working with Phidgets.

    This allows the program to execute other tasks until the Phidget fires a new event.

    In Delphi, when the event library was installed as described in theUse Our Examples

    section, it added Phidget ActiveX components for each type of Phidget. TheseActiveX components will show up in the toolbox under the ActiveX tab, usually in

    the lower right. The ActiveX object for your Phidget can be added to the form and

    then hooked to the event handlers you wish to use like any other control.

    For example, for a Phidget21COMIPhidgetInterfaceKitEvents control, the event

    handler looks like the following:

    procedure TForm1.PhidgetInterfaceKit1SensorChange(ASender: TObject;

    Index, SensorValue: Integer);

    begin

    Edit1.Text := IntToStr(Index) + ': ' + IntToStr(SensorValue);end;

    http://www.phidgets.com/docs/General_Phidget_Programming#Event_Driven_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Exampleshttp://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Exampleshttp://www.phidgets.com/docs/General_Phidget_Programming#Event_Driven_Codehttp://www.phidgets.com/docs/Language_-_Delphi#Use_Our_Examples%23Use_Our_Examples
  • 7/29/2019 IMPORT TO ACTIVE -

    10/12

    With this method, the code inside PhidgetInterfaceKit1SensorChange will get

    executed every time the PhidgetInterfaceKit reports a change on one of its analog

    inputs. Some events such as Attach and Detach belong to the base Phidget object and

    thus are common to all types of Phidgets. Other events, like this sensor change one,

    are specific to the type of Phidget. Please refer to the COM API manual for a full list

    of events and their general usage.

    Some values can be directly read and set on the Phidget. These functions can be used

    inside a polling loop as an alternative to event driven programming. Simply use the

    CallString such as SensorValue[Index] or OutputState[Index] for

    PhidgetInterfaceKits:

    PhidgetInterfaceKit1.OutputState[0] := true;

    Step Four: Close and Delete

    Remember that the Open call reserves the Phidget for sole use by your program.Close removes this lock. You can call Close any time outside of the Phidget's own

    event handlers to end the connection.

    Enabling Logging

    Often its a good idea to enable logging during development for debugging purposes.

    This log, depending on the level set, will record certain events and errors from

    Phidgets. In Delphi, this is accomplished by calling EnableLogging(logLevel,

    filename) on the Phidget object.

    PhidgetInterfaceKit1.EnableLogging(6, 'testlog.txt');

    Similarly, you can call DisableLogging() at the end of your program to shut it off.

    Should you need to contact Phidgets for support, including this log is very helpful for

    revealing the cause of the problem. Please see the Programming Manual for a general

    discussion on Phidget logging and the levels provided.

    More How-To's

    The General Phidget Programmingpage gives more information about:

    Using Multiple Phidgets (or a Phidget other than the Interface Kit)

    Catching exceptions and errors and using logging

    Event catching versus direct polling

    And more....

    Common Problems and Solutions/Workarounds

    Embarcadero XE2: The Phidget Manager creates a runtime fault

    http://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programming#Using_Multiple_Phidgetshttp://www.phidgets.com/docs/General_Phidget_Programming#Creating_a_Software_Objecthttp://www.phidgets.com/docs/General_Phidget_Programming#Exceptions_and_Errorshttp://www.phidgets.com/docs/General_Phidget_Programming#Logginghttp://www.phidgets.com/docs/General_Phidget_Programming#Event_Driven_Codehttp://www.phidgets.com/docs/General_Phidget_Programming#Logic_Codehttp://www.phidgets.com/docs/General_Phidget_Programminghttp://www.phidgets.com/docs/General_Phidget_Programming#Using_Multiple_Phidgetshttp://www.phidgets.com/docs/General_Phidget_Programming#Creating_a_Software_Objecthttp://www.phidgets.com/docs/General_Phidget_Programming#Exceptions_and_Errorshttp://www.phidgets.com/docs/General_Phidget_Programming#Logginghttp://www.phidgets.com/docs/General_Phidget_Programming#Event_Driven_Codehttp://www.phidgets.com/docs/General_Phidget_Programming#Logic_Code
  • 7/29/2019 IMPORT TO ACTIVE -

    11/12

    In Delphi XE2, you cannot use the Phidget Manager as an object directly. If you need

    to open multiple Phidgets of the same device type, use the serial number to

    distinguish between them.

    Embarcadero XE2 under Windows in Oracle VirtualBox: System

    Crash

    Embarcadero Delphi does notwork under Windows running as a guest on Oracle's

    VirtualBox. Adding an ActiveX object on such a system will crash the system and

    appear to destroy it, although a hard power cycle will recover the system. VMWare

    does not suffer from this problem, and of course native Windows 7 works fine.

    Retrieved from "http://www.phidgets.com/wiki/index.php?title=Language_-

    _Delphi&oldid=23144"

    Personal tools

    Namespaces

    Variants

    Views

    Actions

    Search

    Go Search

    Navigation

    Main page

    Software Overview

    Operating Systems

    Languages

    Primers

    Application Guides

    Troubleshooting Contact Us

    Toolbox

    What links here

    Printable version

    Download as PDF

    This page was last modified on 2 April 2013, at 11:35.

    This page has been accessed 5,146 times.

    http://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&oldid=23144http://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&oldid=23144http://www.phidgets.com/docs/Main_Pagehttp://www.phidgets.com/docs/Software_Overviewhttp://www.phidgets.com/docs/Software_Overview#Operating_System_Supporthttp://www.phidgets.com/docs/Software_Overview#Language_Supporthttp://www.phidgets.com/docs/Category:Primerhttp://www.phidgets.com/docs/Category:Application_Guideshttp://www.phidgets.com/docs/General_Troubleshootinghttp://www.phidgets.com/docs/Contact_Ushttp://www.phidgets.com/docs/Special:WhatLinksHere/Language_-_Delphihttp://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&printable=yeshttp://www.phidgets.com/wiki/index.php?title=Special:PdfPrint&page=Language_-_Delphihttp://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&oldid=23144http://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&oldid=23144http://www.phidgets.com/docs/Main_Pagehttp://www.phidgets.com/docs/Software_Overviewhttp://www.phidgets.com/docs/Software_Overview#Operating_System_Supporthttp://www.phidgets.com/docs/Software_Overview#Language_Supporthttp://www.phidgets.com/docs/Category:Primerhttp://www.phidgets.com/docs/Category:Application_Guideshttp://www.phidgets.com/docs/General_Troubleshootinghttp://www.phidgets.com/docs/Contact_Ushttp://www.phidgets.com/docs/Special:WhatLinksHere/Language_-_Delphihttp://www.phidgets.com/wiki/index.php?title=Language_-_Delphi&printable=yeshttp://www.phidgets.com/wiki/index.php?title=Special:PdfPrint&page=Language_-_Delphi
  • 7/29/2019 IMPORT TO ACTIVE -

    12/12

    This work by Phidgets Inc., except where otherwise noted, is licensed under a

    Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported

    License (Click the image on the right for more).

    Policies

    Licenses Contact Us

    http://www.phidgets.com/docs/Policieshttp://www.phidgets.com/documentation/Licenses/Software_Licenses.pdfhttp://www.phidgets.com/docs/Contact_Ushttp://www.facebook.com/pages/Phidgets-Inc/349015308506335http://www.phidgets.com/docs/Policieshttp://www.phidgets.com/documentation/Licenses/Software_Licenses.pdfhttp://www.phidgets.com/docs/Contact_Us