giogio Posted August 14, 2008 Posted August 14, 2008 I get some suggest from the forum, the example script give me some errors and doesn't work. I try to make a new script, this is ok but i don't get all I need. i don't understand why this script doesn't work property: expandcollapse popup; ;create the phidget rfid object $oPhidget = ObjCreate("phidget21COM.phidgetrfid") ;open the rfid $oPhidget.Open(56734) sleep(1000) ;check to make sure the rfid kit is attached to the system. If NOT $oPhidget.IsAttached Then ;if the interface kit is not attached then display a message box and exit MsgBOx(0, "Error", "The Phidget Interface Kit is not Attached! Please attach it and try again!") Exit Else ;check to make sure the rfid kit is attached to the system. MsgBox(0, "Test", "Device Type " & $oPhidget.DeviceType() _ & @CRLF & "Serial Number "& $oPhidget.serialnumber _ & @CRLF & "Output num. "& $oPhidget.OutputCount) EndIf ; I get all the requested information from phidget ;_______________________________________________ ;From this point the phidget doesn't work, the results are leds and antenna off ;_______________________________________________ $oPhidget.LEDOn = True; this turns OFF the onboard LED sleep(1000) $oPhidget.AntennaOn = True; this turns on antenna sleep(1000) $oPhidget.OutputState(1) = True; turns Onthe post LED sleep(1000) $oPhidget.OutputState(0) = True; turns On the 5V lead sleep(1000) if $oPhidget.LEDOn = False _ and $oPhidget.OutputState(1) = False _ and $oPhidget.OutputState(0) = False _ Then MsgBOx(0, "Error", "No Led on") EndIf if $oPhidget.AntennaOn = False Then MsgBOx(0, "Error", "Antenna off") EndIf $oPhidget.Close() Exit PLEASE HELP ME By Franco
weaponx Posted August 14, 2008 Posted August 14, 2008 You are not providing enough information for an audience that most likely doesn't own one of these devices.Product home pageCOM API Manual- Which device are you trying to interface with?- Did you install their framework?- Do you have .NET Framework 2.0 installed?
giogio Posted August 14, 2008 Author Posted August 14, 2008 - Which device are you trying to interface with? Rfid Reader - Did you install their framework? Yes last update - Do you have .NET Framework 2.0 installed? Yes Sp1 (italian) I test the Hw using their example and it work fine. ________________________________________________________________ I made a new script for the LcdText module and it work fine, i share it; expandcollapse popup;create the phidget object $oPhidget = ObjCreate("phidget21COM.PhidgetTextLCD") ;open the Phidget system $oPhidget.Open() sleep(1000) ;check to make sure the Text Lcd is attached to the system. If NOT $oPhidget.IsAttached Then ;if the Text Lcd is not attached then display a message box and exit MsgBOx(0, "Error", "The Phidget Text Lcd is not Attached! Please attach it and try again!") Exit Else ;get Hw info from the attached system. MsgBox(0, "Test", "Device Type " & $oPhidget.DeviceType() _ & @CRLF & "Serial Number "& $oPhidget.serialnumber _ & @CRLF & "Row num. "& $oPhidget.RowCount) endif ;Set Contrast $oPhidget.Contrast = "120" $ContrastVal= $oPhidget.Contrast MsgBOx(0, "More info", "Contrast Value: " & $ContrastVal) ;Set BackLight $oPhidget.BackLight = "True" $BackLightVal= $oPhidget.BackLight MsgBOx(0, "More info", "BackLight Value: " & $BackLightVal) ;Write on line 1 and 2 $oPhidget.DisplayString(0)="Write on line 1" $oPhidget.DisplayString(1)="Write on line 2" ;clear after 3 sec. line 1 and 2 sleep(3000) $oPhidget.DisplayString(0)="" $oPhidget.DisplayString(1)="" $oPhidget.Close() Exit
PsaltyDS Posted August 14, 2008 Posted August 14, 2008 ;From this point the phidget doesn't work, the results are leds and antenna off ;_______________________________________________ $oPhidget.LEDOn = True; this turns OFF the onboard LED sleep(1000) $oPhidget.AntennaOn = True ; this turns on antenna sleep(1000) $oPhidget.OutputState(1) = True; turns Onthe post LED sleep(1000) $oPhidget.OutputState(0) = True; turns On the 5V lead sleep(1000) if $oPhidget.LEDOn = False _ and $oPhidget.OutputState(1) = False _ and $oPhidget.OutputState(0) = False _ Then MsgBOx(0, "Error", "No Led on") EndIf if $oPhidget.AntennaOn = False Then MsgBOx(0, "Error", "Antenna off") EndIf PLEASE HELP ME By Franco There is something amiss in your syntax. .AntennaOn is a "[get/set]" property, meaning you can read the state or set it. At one point you do "$oPhidget.AntennaOn = True" to set the state, but then you later do "if $oPhidget.AntennaOn = False Then" to check the state. I believe that second should read "if ($oPhidget.AntennaOn) = False Then" so that the "= False" does not perform the operation to turn the antenna off. P.S. You said: "...the example script give me some errors and doesn't work." You went on to describe what didn't work, but never posted the errors. If this is not solved, post the errors. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
giogio Posted August 14, 2008 Author Posted August 14, 2008 I solved, the True and False must be quoted, "True" "False" Many thanks for your attention. Franco
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now