Hi all
First post, so be gentle with me :)
I have been using Perl for many years with too much trouble, but I have only recently had to deal with Win32::OLE.
I am trying to control a Phidget USB Display board via Perl ( http://www.phidgets.com/products.php?category=15&product_id=1203 )
So far, no problems opening the device via OLE, and obtain the board serial number, set the backlight and cursor blink.
use Win32::OLE; $phidget = Win32::OLE->new("Phidget21COM.PhidgetTextLCD"); $phidget->Invoke("Open", -1); (check/wait loop here for "IsAttached") $serial = $phidget->{SerialNumber}; $phidget->{"Backlight"} = 1; $phidget->{"CursorBlink"} = 0;
but, when I try to set the text in the LCD display, I am having really issues trying to work out the VB to Perl equivalent of this:
TextLCD.DisplayString(0) = "hello"
where "TextLCD" is the "$phidget" OLE object I have opened. I have tried just about everything I can think of, and must be missing something really obvious:
#does nothing $phidget->Invoke('DisplayString', (1,"hello")); $phidget->Invoke('DisplayString', (2,"goodbye")); #again, does nothing $phidget->{"DisplayString"} = (1,"hello"); $phidget->{"DisplayString"} = (2,"goodbye"); #still does nothing $phidget->DisplayString(1, "hello"); $phidget->DisplayString(2, "goodbye"); #This still does nothing $phidget->{DisplayString}[0] = "hello";
If it runs, it does nothing. If it doesnt run, it spits out:
Win32::OLE(0.1707) error 0x8002000e: "Invalid number of parameters" in PROPERTYPUT "DisplayString" at phidget-test.pl line 30
Is there anyone here at the Monastery who can enlighten me to my glaring mistake?
In reply to Win32::OLE / Perl / Phidget Display code by SteveL
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |