Sign in to follow this  
Followers 0
atzoref

phidgets ObjectCreate problem

3 posts in this topic

Hi,

I have this code for connection with Phidgets Device:

;Phidget initialization code goes here
  Global $oPhid1,
$oPhidEvents
  $oPhid1 =
ObjCreate("Phidget21COM.PhidgetInterfacekit")
  $oPhid1.Open()

 
  $oPhid1.WaitForAttachment(3000)
  If NOT $oPhid1.IsAttached
Then
     MsgBox(0, "Error", "Phidget Device not
attached")
  GUICtrlSetState($cbWithoutMux, $GUI_CHECKED)
 
;Exit
  EndIf

 
  $oPhidEvents = ObjEvent($oPhid1, "phid1_")

It works good for me on 2 computer (Win 7_64, Win XP_32)

But for some reason the AutoIt crush on other computer with Win 7_64.

C:\Users\user\Desktop\ManagerTester\includes\ConnectionControllerFunctions.au3 (78) : ==> Variable must be of type "Object".:

$oPhid1.Open()

$oPhid1^ ERROR

It get error on this command:

$oPhid1.Open()

Because probably it doesn;t make an object on this line:

$oPhid1 = ObjCreate("Phidget21COM.PhidgetInterfacekit")

Why it may happens just on this PC?

Thanks

Share this post


Link to post
Share on other sites



I assume the required software isn't installed on this machine.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Google is your best friend :)

I found the solution here:

It was finally something with the " Phidget21COM.dll " which for some reason wasn't registered on the PC.

So for using the COM interface, Before you can use the COM interface to Phidget21COM it needs to be "registered" This is maybe should be done automatically when you install the Phidget drivers but I done it manually.

To register the COM interface:

1. Open a command prompt (As administrator)

2. Change directory (using CD) to the directory that contains Phidget21COM.dll in the program files

3. Type "regsvr32.exe Phidget21COM.dll" and press enter

And then the problem doesn't happen and he success to run the ObjCreate.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0