Phidgets LabVIEW Manual

download Phidgets LabVIEW Manual

of 368

Transcript of Phidgets LabVIEW Manual

  • 8/13/2019 Phidgets LabVIEW Manual

    1/367

    2011 Phidgets Inc.

    Labview Manual

  • 8/13/2019 Phidgets LabVIEW Manual

    2/367

    All rights res erved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechan ical, including photocopying, recording, taping, or information storage and retrieval systems - without thewritten permission of the publisher.

    Products that are referred to in this docum ent may be either trademarks and /or registered trademarks of therespective owners . The publis her and the author make no claim to thes e trademarks.

    While every precaution has been taken in the preparation of this docum ent, the publisher and the author ass ume noresponsibility for errors or omiss ions , or for damages resulting from the use of information contained in thisdocument or from the use of programs and source code that may accompany it. In no event shall the publis her andthe author be liable for any loss of profit or any other commercial damage caused or alleged to have been causeddirectly or indirectly by this document.

    Printed: April 2011 in Canada

    Labview Manual

    2011 Phidgets Inc.

  • 8/13/2019 Phidgets LabVIEW Manual

    3/367

    2011 Phidgets Inc.

    Content

    Table of ContentsPart 1 Welcome to Phidgets 11

    Part 2 Introduction 12................................................................................................................................... 131 Understanding Phidge ts

    ................................................................................................................................... 142 Platform Support

    Part 3 Programming Concept 15................................................................................................................................... 161 Getting Started

    ................................................................................................................................... 192 Event Handler

    ................................................................................................................................... 223 Multiple Devices

    Part 4 Phidgets Common 23................................................................................................................................... 241 ErrorHandler

    ................................................................................................................................... 252 PhidgetClose

    ................................................................................................................................... 263 PhidgetDelete

    ................................................................................................................................... 274 PhidgetEventCloseOnError

    ................................................................................................................................... 285 PhidgetEventCreateOnError

    ................................................................................................................................... 296 PhidgetEventExeOnError

    ................................................................................................................................... 307 PhidgetGetDeviceClass

    ................................................................................................................................... 318 PhidgetGetDeviceID

    ................................................................................................................................... 329 PhidgetGetDeviceLabel

    ................................................................................................................................... 3310 PhidgetGetDeviceName

    ................................................................................................................................... 3411 PhidgetGetDeviceType

    ................................................................................................................................... 3512 PhidgetGetDeviceVersion

    ................................................................................................................................... 3613 PhidgetGetServerStatus

    ................................................................................................................................... 3714 PhidgetLibraryVersion

    ................................................................................................................................... 3815 PhidgetOpen

    ................................................................................................................................... 3916 PhidgetOpenRemote

    ................................................................................................................................... 4017 PhidgetOpenRemoteIP

    ................................................................................................................................... 4118 PhidgetServerAddress

    ................................................................................................................................... 4219 PhidgetServiceID

    ................................................................................................................................... 4320 PhidgetSetDeviceLabel

    ................................................................................................................................... 4421 SubVIs.......................................................................................................................................................... 45 _AttachCHK.......................................................................................................................................................... 46 _ChkError.......................................................................................................................................................... 47 _Close.......................................................................................................................................................... 48 _Dele te.......................................................................................................................................................... 49 _Open.......................................................................................................................................................... 50 _OpenRemote

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    4/367

    2011 Phidgets Inc.

    Content

    .......................................................................................................................................................... 51 _OpenRemoteIP

    .......................................................................................................................................................... 52 _SerialRetur n

    .......................................................................................................................................................... 53 _WaitAttach

    .......................................................................................................................................................... 54EventCloseIntDouble

    .......................................................................................................................................................... 55EventCloseIntInt

    .......................................................................................................................................................... 56EventExeIntDouble

    .......................................................................................................................................................... 57EventExeIntInt

    Part 5 Specific Modules 58................................................................................................................................... 591 Phidget Accelerometer

    .......................................................................................................................................................... 60AcceAxisCount

    .......................................................................................................................................................... 61AcceCreate

    .......................................................................................................................................................... 62AcceEventClose

    .......................................................................................................................................................... 63AcceEventCreate

    .......................................................................................................................................................... 64AcceEventExe

    .......................................................................................................................................................... 65AcceGetData

    .......................................................................................................................................................... 66AcceGetMax

    .......................................................................................................................................................... 67AcceGetMin

    .......................................................................................................................................................... 68AcceGetTrigger

    .......................................................................................................................................................... 69AcceOpen

    .......................................................................................................................................................... 70AcceSetTrigger

    ................................................................................................................................... 712 Phidget Advanced Servo.......................................................................................................................................................... 73AdvServoCount.......................................................................................................................................................... 74AdvServoCreate.......................................................................................................................................................... 75AdvServoEventClose.......................................................................................................................................................... 76AdvServoEventCreateCrtChange.......................................................................................................................................................... 77AdvServoEventCreatePosChange.......................................................................................................................................................... 78AdvServoEventCreateVelChange.......................................................................................................................................................... 79AdvServoEventExe.......................................................................................................................................................... 80AdvServoGetAcce

    .......................................................................................................................................................... 81AdvServoGetAcceMax

    .......................................................................................................................................................... 82AdvServoGetAcceMin

    .......................................................................................................................................................... 83AdvServoGetCurrent

    .......................................................................................................................................................... 84AdvServoGetEngaged

    .......................................................................................................................................................... 85AdvServoGetPos

    .......................................................................................................................................................... 86AdvServoGetPosMax

    .......................................................................................................................................................... 87AdvServoGetPosMin

    .......................................................................................................................................................... 88AdvServoGetRampingState

    .......................................................................................................................................................... 89AdvServoGetServoType

    .......................................................................................................................................................... 90AdvServoGetVel

    .......................................................................................................................................................... 91AdvServoGetVellmt

    .......................................................................................................................................................... 92AdvServoGetVelmax

    .......................................................................................................................................................... 93AdvServoGetVelmin

    .......................................................................................................................................................... 94AdvServoOpen

    .......................................................................................................................................................... 95AdvServoSetAcce

    .......................................................................................................................................................... 96AdvServoSetEngaged

    .......................................................................................................................................................... 97AdvServoSetPos

    .......................................................................................................................................................... 98AdvServoSetPosMax

    .......................................................................................................................................................... 99AdvServoSetPosMin.......................................................................................................................................................... 100AdvServoSetRampingState.......................................................................................................................................................... 101AdvServoSetServoParameters.......................................................................................................................................................... 102AdvServoSetServoType.......................................................................................................................................................... 103AdvServoSetVellmt

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    5/367

    2011 Phidgets Inc.

    Content

    .......................................................................................................................................................... 104AdvServoStoppedState

    ................................................................................................................................... 1053 Phidget Encoder

    .......................................................................................................................................................... 106EncoderCreate

    .......................................................................................................................................................... 107EncoderEventCloseInput

    .......................................................................................................................................................... 108EncoderEventClosePosition

    .......................................................................................................................................................... 109EncoderEventCreateInput

    .......................................................................................................................................................... 110EncoderEventCreatePosition

    .......................................................................................................................................................... 111EncoderEventExeInput

    .......................................................................................................................................................... 112EncoderEventExePosition

    .......................................................................................................................................................... 113EncoderGetCount

    .......................................................................................................................................................... 114EncoderGetEnabledState

    .......................................................................................................................................................... 115EncoderGetIndexPosition

    .......................................................................................................................................................... 116EncoderGetInputCount

    .......................................................................................................................................................... 117EncoderGetInputState

    .......................................................................................................................................................... 118EncoderGetPosition

    .......................................................................................................................................................... 119EncoderOpen

    .......................................................................................................................................................... 120EncoderSetEnabled

    .......................................................................................................................................................... 121EncoderSetPosition

    ................................................................................................................................... 1224 Phidget InterfaceKit.......................................................................................................................................................... 123IFCreate.......................................................................................................................................................... 124IFEventClose.......................................................................................................................................................... 125IFEventCreateInput.......................................................................................................................................................... 126IFEventCreateOutput.......................................................................................................................................................... 127IFEventCreateSensor.......................................................................................................................................................... 128IFEventExe.......................................................................................................................................................... 129IFGetDataRate.......................................................................................................................................................... 130IFGetDataRateMax.......................................................................................................................................................... 131IFGetDataRateMin.......................................................................................................................................................... 132IFGetInputCount.......................................................................................................................................................... 133IFGetInputState

    .......................................................................................................................................................... 134IFGetOutputCount.......................................................................................................................................................... 135IFGetOutputState

    .......................................................................................................................................................... 136IFGetRatio

    .......................................................................................................................................................... 137IFGetSensorCount

    .......................................................................................................................................................... 138IFGetSensorValue

    .......................................................................................................................................................... 139IFGetSensorValueRaw

    .......................................................................................................................................................... 140IFGetTrig

    .......................................................................................................................................................... 141IFOpen

    .......................................................................................................................................................... 142IFSetDataRate

    .......................................................................................................................................................... 143IFSetOutputState

    .......................................................................................................................................................... 144IFSetRatio

    .......................................................................................................................................................... 145IFSetTrig

    ................................................................................................................................... 1465 Phidget IR

    .......................................................................................................................................................... 147IRCreate

    .......................................................................................................................................................... 148IREventCloseOnCode

    .......................................................................................................................................................... 149IREventCloseOnLearn

    .......................................................................................................................................................... 150IREventClose OnRawData

    .......................................................................................................................................................... 151IREventCreateOnCode

    .......................................................................................................................................................... 152IREventCreateOnLearn

    .......................................................................................................................................................... 153IREventCr eate OnRawData

    .......................................................................................................................................................... 154IREventExeOnCode

    .......................................................................................................................................................... 155IREventExeOnLearn

    .......................................................................................................................................................... 156IREventExeOnRawData

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    6/367

    2011 Phidgets Inc.

    Content

    .......................................................................................................................................................... 157IRGetLastCode

    .......................................................................................................................................................... 158IRGetLastLearnedCode

    .......................................................................................................................................................... 159IRGetRawData

    .......................................................................................................................................................... 160IROpen

    .......................................................................................................................................................... 161IRTransmit

    .......................................................................................................................................................... 162IRTransmitRaw

    .......................................................................................................................................................... 163IRTransmitRepeat

    ................................................................................................................................... 1646 Phidge t LED.......................................................................................................................................................... 165LEDCount.......................................................................................................................................................... 166LEDCreate.......................................................................................................................................................... 167LEDGetBrightness.......................................................................................................................................................... 168LEDGetCurrentLimit.......................................................................................................................................................... 169LEDGetVoltage.......................................................................................................................................................... 170LEDOpen.......................................................................................................................................................... 171LEDSetBrightness.......................................................................................................................................................... 172LEDSetCurrentLimit.......................................................................................................................................................... 173LEDSetVoltage

    ................................................................................................................................... 1747 Phidge t Motor Control

    .......................................................................................................................................................... 175MCCreate

    .......................................................................................................................................................... 176MCEventCloseInput

    .......................................................................................................................................................... 177MCEventCloseVelocityCurrent

    .......................................................................................................................................................... 178MCEventCreateCurrent

    .......................................................................................................................................................... 179MCEventCreateInput

    .......................................................................................................................................................... 180MCEventCreateVelocity

    .......................................................................................................................................................... 181MCEventExeInput

    .......................................................................................................................................................... 182MCEventExeVelocityCurrent

    .......................................................................................................................................................... 183MCGetAcceleration

    .......................................................................................................................................................... 184MCGetAccelerationMax

    .......................................................................................................................................................... 185MCGetAccelerationMin

    .......................................................................................................................................................... 186MCGetCurrent

    .......................................................................................................................................................... 187MCGetInputCount.......................................................................................................................................................... 188MCGetInputState

    .......................................................................................................................................................... 189MCGetMotorCount

    .......................................................................................................................................................... 190MCGetVelocity

    .......................................................................................................................................................... 191MCOpen

    .......................................................................................................................................................... 192MCSetAcceleration

    .......................................................................................................................................................... 193MCSetVelocity

    ................................................................................................................................... 1948 Phidge t PH Sensor

    .......................................................................................................................................................... 195PHCreate

    .......................................................................................................................................................... 196PHEventClose

    .......................................................................................................................................................... 197PHEventCreate

    .......................................................................................................................................................... 198PHEventExe

    .......................................................................................................................................................... 199PHGetPH

    .......................................................................................................................................................... 200PHGetPHMax

    .......................................................................................................................................................... 201PHGetPHMin

    .......................................................................................................................................................... 202PHGetPHTrigger

    .......................................................................................................................................................... 203PHGetPotential

    .......................................................................................................................................................... 204PHGetPotentialMax

    .......................................................................................................................................................... 205PHGetPotentialMin

    .......................................................................................................................................................... 206PHOpen

    .......................................................................................................................................................... 207PHSetTemperature

    .......................................................................................................................................................... 208PHSetTrig

    ................................................................................................................................... 2099 Phidget RFID

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    7/367

    2011 Phidgets Inc.

    Content

    .......................................................................................................................................................... 210RFIDCreate

    .......................................................................................................................................................... 211RFIDEventClose

    .......................................................................................................................................................... 212RFIDEventCloseOutput

    .......................................................................................................................................................... 213RFIDEventCreateOutput

    .......................................................................................................................................................... 214RFIDEventCreateTag

    .......................................................................................................................................................... 215RFIDEventCreateTagLost

    .......................................................................................................................................................... 216RFIDEventExe

    .......................................................................................................................................................... 217RFIDEventExeOutput

    .......................................................................................................................................................... 218RFIDGetAntennaState

    .......................................................................................................................................................... 219RFIDGetLastTag

    .......................................................................................................................................................... 220RFIDGetLEDState

    .......................................................................................................................................................... 221RFIDGetOutputCount

    .......................................................................................................................................................... 222RFIDGetOutputState

    .......................................................................................................................................................... 223RFIDGetTagState

    .......................................................................................................................................................... 224RFIDOpen

    .......................................................................................................................................................... 225RFIDSetAntennaState

    .......................................................................................................................................................... 226RFIDSetLEDState

    .......................................................................................................................................................... 227RFIDSetOutputState

    ................................................................................................................................... 22810 Phidget Servo.......................................................................................................................................................... 229ServoCount.......................................................................................................................................................... 230ServoCreate.......................................................................................................................................................... 231ServoEventClose.......................................................................................................................................................... 232ServoEventCreate.......................................................................................................................................................... 233ServoEventExe.......................................................................................................................................................... 234ServoGetEngaged.......................................................................................................................................................... 235ServoGetPos.......................................................................................................................................................... 236ServoGetPosMax.......................................................................................................................................................... 237ServoGetPosMin.......................................................................................................................................................... 238ServoGetServoType.......................................................................................................................................................... 239ServoOpen.......................................................................................................................................................... 240ServoSetEngaged.......................................................................................................................................................... 241ServoSetPos.......................................................................................................................................................... 242ServoSetServoParameters.......................................................................................................................................................... 243ServoSetServoType

    ................................................................................................................................... 24411 Phidget Spatial.......................................................................................................................................................... 245SpatialCreate.......................................................................................................................................................... 246SpatialEventClose.......................................................................................................................................................... 247SpatialEventCreate.......................................................................................................................................................... 248SpatialEventExe.......................................................................................................................................................... 249SpatialGetAcce.......................................................................................................................................................... 250SpatialGetAcceAxisCount.......................................................................................................................................................... 251SpatialGetAcceMax.......................................................................................................................................................... 252SpatialGetAcceMin

    .......................................................................................................................................................... 253SpatialGetAngRate

    .......................................................................................................................................................... 254SpatialGetAngRateMax

    .......................................................................................................................................................... 255SpatialGetAngRateMin

    .......................................................................................................................................................... 256SpatialGetCompassAxisCount

    .......................................................................................................................................................... 257SpatialGetDataRate

    .......................................................................................................................................................... 258SpatialGetDataRateMax

    .......................................................................................................................................................... 259SpatialGetDataRateMin

    .......................................................................................................................................................... 260SpatialGetGyroAxisCount

    .......................................................................................................................................................... 261SpatialGetMagField

    .......................................................................................................................................................... 262SpatialGetMagFieldMax

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    8/367

    2011 Phidgets Inc.

    Content

    .......................................................................................................................................................... 263SpatialGetMagFieldMin

    .......................................................................................................................................................... 264SpatialOpen

    .......................................................................................................................................................... 265SpatialRese tCompassCorrectionParameter s

    .......................................................................................................................................................... 266SpatialSetCompassCorrectionParameters

    .......................................................................................................................................................... 267SpatialSetDataRate

    .......................................................................................................................................................... 268SpatialZeroGyro

    ................................................................................................................................... 26912 Phidget Stepper

    .......................................................................................................................................................... 271StepperCreate

    .......................................................................................................................................................... 272StepperEventCloseCurrentVelocity

    .......................................................................................................................................................... 273StepperEventCloseInput

    .......................................................................................................................................................... 274StepperEventClosePosition

    .......................................................................................................................................................... 275StepperEventClosePosition71

    .......................................................................................................................................................... 276StepperEventCreateCurrent

    .......................................................................................................................................................... 277StepperEventCreateInput

    .......................................................................................................................................................... 278StepperEventCreatePosition

    .......................................................................................................................................................... 279StepperEventCreatePosition71

    .......................................................................................................................................................... 280StepperEventCreateVelocity

    .......................................................................................................................................................... 281StepperEventExeCurrentVelocity

    .......................................................................................................................................................... 282StepperEventExeInput

    .......................................................................................................................................................... 283StepperEventExePosition

    .......................................................................................................................................................... 284StepperEventExePosition71

    .......................................................................................................................................................... 285StepperGetAcceleration

    .......................................................................................................................................................... 286StepperGetAccelerationMax

    .......................................................................................................................................................... 287StepperGetAccelerationMin

    .......................................................................................................................................................... 288StepperGetCurrent

    .......................................................................................................................................................... 289StepperGetCurrentLimit

    .......................................................................................................................................................... 290StepperGetCurrentMax

    .......................................................................................................................................................... 291StepperGetCurrentMin

    .......................................................................................................................................................... 292StepperGetCurrentPosition

    .......................................................................................................................................................... 293StepperGetCurrentPosition71

    .......................................................................................................................................................... 294StepperGetEngaged

    .......................................................................................................................................................... 295StepperGetPositionMax

    .......................................................................................................................................................... 296StepperGetPositionMax71

    .......................................................................................................................................................... 297StepperGetPositionMin

    .......................................................................................................................................................... 298StepperGetPositionMin71

    .......................................................................................................................................................... 299StepperGetTargetPosition

    .......................................................................................................................................................... 300StepperGetTargetPosition71

    .......................................................................................................................................................... 301StepperGetVelocity

    .......................................................................................................................................................... 302StepperGetVelocityLimit

    .......................................................................................................................................................... 303StepperGetVelocityMax

    .......................................................................................................................................................... 304StepperGetVelocityMin

    .......................................................................................................................................................... 305StepperInputCount

    .......................................................................................................................................................... 306StepperInputState

    .......................................................................................................................................................... 307StepperMotorCount

    .......................................................................................................................................................... 308StepperOpen

    .......................................................................................................................................................... 309StepperSetAcceleration

    .......................................................................................................................................................... 310StepperSetCurrentLimit

    .......................................................................................................................................................... 311StepperSetCurrentPosition

    .......................................................................................................................................................... 312StepperSetCurrentPosition71

    .......................................................................................................................................................... 313StepperSetEngaged

    .......................................................................................................................................................... 314StepperSetTargetPosition

    .......................................................................................................................................................... 315StepperSetTargetPosition71

    .......................................................................................................................................................... 316StepperSetVelocityLimit

    .......................................................................................................................................................... 317StepperStoppedState

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    9/367

    2011 Phidgets Inc.

    Content

    ................................................................................................................................... 31813 Phidget Temperature Sensor .......................................................................................................................................................... 319TempCreate.......................................................................................................................................................... 320TempEventClose.......................................................................................................................................................... 321TempEventCreate.......................................................................................................................................................... 322TempEventExe

    .......................................................................................................................................................... 323TempGetAmbient

    .......................................................................................................................................................... 324TempGetAmbientMax

    .......................................................................................................................................................... 325TempGetAmbientMin

    .......................................................................................................................................................... 326TempGetPotential

    .......................................................................................................................................................... 327TempGetPotentialMax

    .......................................................................................................................................................... 328TempGetPotentialMin

    .......................................................................................................................................................... 329TempGetTemperature

    .......................................................................................................................................................... 330TempGetTemperatureMax

    .......................................................................................................................................................... 331TempGetTemperatureMin

    .......................................................................................................................................................... 332TempGetThermocoupleType

    .......................................................................................................................................................... 333TempGetTrigger

    .......................................................................................................................................................... 334TempInputCount

    .......................................................................................................................................................... 335TempOpen

    .......................................................................................................................................................... 336TempSetThermocoupleType

    .......................................................................................................................................................... 337TempSetTrigger

    ................................................................................................................................... 33814 Phidget TextLCD.......................................................................................................................................................... 339TextCreate.......................................................................................................................................................... 340TextGetBacklightState.......................................................................................................................................................... 341TextGetBrightness.......................................................................................................................................................... 342TextGetColumnCount.......................................................................................................................................................... 343TextGetContrast.......................................................................................................................................................... 344TextGetCursorBlinkState.......................................................................................................................................................... 345TextGetCursorState.......................................................................................................................................................... 346TextGetRowCount.......................................................................................................................................................... 347TextOpen

    .......................................................................................................................................................... 348TextSetBacklightState.......................................................................................................................................................... 349TextSetBrightness

    .......................................................................................................................................................... 350TextSetCharacter

    .......................................................................................................................................................... 351TextSetContrast

    .......................................................................................................................................................... 352TextSetCursorBlinkState

    .......................................................................................................................................................... 353TextSetCursorState

    .......................................................................................................................................................... 354TextSetDisplayChar

    .......................................................................................................................................................... 355TextSetDisplayString

    ................................................................................................................................... 35615 Phidget TextLED

    ................................................................................................................................... 35716 Phidget Weight Sensor

    Part 6 Phidgets Constants 358

    ................................................................................................................................... 3591 ServoType

    ................................................................................................................................... 3602 ThermocoupleType

    ................................................................................................................................... 3613 CodeInfo

    ................................................................................................................................... 3624 IREncoding

    ................................................................................................................................... 3635 IRLength

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    10/367

    2011 Phidgets Inc.

    Content

    Index 364

  • 8/13/2019 Phidgets LabVIEW Manual

    11/367

    Welcome to Phidgets 11

    2011 Phidgets Inc.

    1 Welcome to Phidgets

    LabVIEW HelpNovember 2010, Version 0.1-021110

    This help system includes information about LabVIEW programming for each Phidget device. It containsprogramming concepts, step-by-step instructions, and reference information about VIs, functions andpalettes.

    To navigate this help system, use the Contents , Index , and Search tabs to the left of this windows.

    Phidgets are an easy to use set of building blocks for low cost sensing and control from your PC. Usingthe Universal Serial Bus (USB) as the basis for all Phidgets, the complexity is managed behind thiseasy to use and robust Application Program Interface (API) library.

    This help system may link to Portable Document Format (PDF) versions of documents. You must have Adobe Reader installed to view or search the PDF versions of these manuals.

    Note: (Mac OS X) Phidgets recommends that you use Safari 1.3.2 or later or Firefox 1.0.2or later to view the Help . (Linux) Phidgets recommends that you use Mozilla 1.2 or later or Firefox 1.0.2 or later to view the Help .

    For more information about this help, refer to the following topics:

    Introduction

    Programming Concept

    Phidgets Common

    Specific Modules

    Phidge ts Constant

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    12/367

    Introduction12

    2011 Phidgets Inc.

    2 Introduction

    Phidgets are an easy to use set of building blocks for low cost sensing and control from your PC. Usingthe Universal Serial Bus (USB) as the basis for all Phidgets, the complexity is managed behind this

    easy to use and robust Application Program Interface (API) library.

    This manual documents the Phidgets software programming model in National Instruments Labviewlanguage. The Programming Concept should be the first section to be read for someone beginning touse Phidgets. After the concepts described are understood, users can read Phidgets Common andSpecific Modules for function reference and device documentation in general. Note that these sectionsare light on function documentation - generally only containing specific reference information and basicfunction information.

    For a more detailed introduction, please refer to Understanding Phidgets and Platform Support .

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    13/367

    Introduction 13

    2011 Phidgets Inc.

    2.1 Understanding Phidgets

    Hardware Model

    All Phidgets are connected to the computer using USB. Most computers support up to 127 USB devices(or more), so it is easy to connect as many Phidgets as are required for almost any project. Phidgetscan be connected either directly to a computer or through Hubs, but there are some limitations.

    The maximum cable length for USB is 15 feet. This is a maximum distance between device andcomputer, even if there are one or more Hubs in between. There are cable extenders available on themarket, but these can be unreliable and are not endorsed by Phidgets Inc. Users should never try to runUSB over anything other then a certified USB cable, and should never try to run it longer than the spec.

    Phidgets run as USB 1.1 low speed or full speed devices, and are supported by both USB 1.1 and USB2.0 hosts.

    Software Model

    The Phidgets Labview library is written under the C library - phidget21, which implements the low-levelprotocols necessary to communicate with the Phidgets, and exports a unified interface to the softwareprogrammer. This also makes the Phidgets Labview library cross-platform.

    The Phidget Labview library contains only glue logic for interfacing with the C library, thus makingmaintenance much easier. It should be noted the library employs threading and events extensively. (SeeProgramming Concept for more information.)

  • 8/13/2019 Phidgets LabVIEW Manual

    14/367

    Introduction14

    2011 Phidgets Inc.

    2.2 Platform Support

    Operating System Support

    WindowsMicrosoft Windows 2000 and later are supported, including 64-bit editions. The Windows libraries areinstalled using an MSI installer that can be found on the Phidgets web site. This installs the C library,the .NET library, the COM library, the Java library, the Phidget Web Service and the Phidget ControlPanel.

    The Phidget Control Panel is represented by a Ph icon that runs in the system tray (usually on theright end of the Windows task bar). This program can be used to list and control any Phidgets attachedto the system, and to control the Web Service.

    Mac OS XMac OS X 10.3.9 and newer on Intel and PPC are supported. The Mac libraries are distributed in a .dmg

    and are installed using a standard Mac package installer. This installs the C library, the Kernel driver,the Java library, the Phidget Web Service and the Phidget Preference Pane.

    The Phidget Preference Pane is a preference pane which resides in System Preferences. This programcan be used to list and control any Phidgets attached to the system, and to control the Web Service.

    LinuxLinux version 2.4 is supported, including 64-bit editions, but 2.6.7 or newer is recommended. The Linuxlibraries are distributed as source. The source for the C library, with optional JNI (Java support)extensions and the source for the Phidget Web Service are available as a .tar.gz. The included Makefilemakes it easy to build and install the libraries on most Linux distribution.

    Other

    Other Operating System support is not currently available.

    Labview Version Support

    The Phidgets Labview library supports 32-bit Labview version 7.1.1 or higher. It also supports 64-bitLabview version 2009 or higher.

    Note: If you use Labview 64-bit, you need to install the Phidgets Labview 64-bit library.

  • 8/13/2019 Phidgets LabVIEW Manual

    15/367

  • 8/13/2019 Phidgets LabVIEW Manual

    16/367

  • 8/13/2019 Phidgets LabVIEW Manual

    17/367

    Programming Concept 17

    2011 Phidgets Inc.

    Open the diagram of the "Single control example.vi" under the "Accelerometer" folder.

    Phidgets can be programmed into 3 steps:

    Initialize the Phidget. This includes opening a Phidget hardware, creating a Phidget handler or setting up parameters of a Phidget.

    Users can also acquire other information in this step. For more details, please refer to the examplecalled "Remote Example.vi" under "TemperatureSensor" folder.

  • 8/13/2019 Phidgets LabVIEW Manual

    18/367

    Programming Concept18

    2011 Phidgets Inc.

    If users want to open Phidgets over the network, a PhidgetOpenRemote and AcceCreate functions willbe called instead of AcceOpen.

    Perform any execution related with the Phidget. This includes data acquisition, device control,event execution etc.

    Close the Phidget. This may include closing the device, releasing all the resources or freeing aPhidget handle and an error handler.

  • 8/13/2019 Phidgets LabVIEW Manual

    19/367

    Programming Concept 19

    2011 Phidgets Inc.

    3.2 Event Handler

    This demonstrates how to call a Phidgets event and how to use them.

    For illustration purposes, Phidget Spatial will be used.

    Note: For a more specific illustration on different phidgets, users can refer to differentexamples accordingly.

  • 8/13/2019 Phidgets LabVIEW Manual

    20/367

  • 8/13/2019 Phidgets LabVIEW Manual

    21/367

    Programming Concept 21

    2011 Phidgets Inc.

    Close the related event.

    Note: When execute an event, please make sure "create", "execute" and "close" the sameevent. For example, user wants to run an Event called A. He has to place "CreateEventA.vi","ExeEventA.vi" and "CloseEventA.vi" on the block diagram. He cannot place "CloseEventB.vi"instead of "CloseEventA.vi". However, for some Phidgets event, they share same VIs. (For more details, please refer to specific Phidgets.)

    Phidget Error Event:

    Another useful example will be "Temp On Error.vi" under "TemperatureSensor" folder.

    In this example, the error event is actually located in "Common Functions" folder. It will detectasynchronous errors from Phidgets.

    Note: Phidgets can also support multiple events. For an example, please refer to "Eventhandler example.vi" under the "InterfaceKit" folder.

  • 8/13/2019 Phidgets LabVIEW Manual

    22/367

    Programming Concept22

    2011 Phidgets Inc.

    3.3 Multiple Devices

    Phidgets Labview can control multiple phidgets. As long as the handlers are different, different phidgetscan run in parallel.

    For a more detailed illustration, please refer to the example of "Multiple control example (Parallel).vi" and"Multiple control example (Advanced).vi" under the "Accelerometer" folder.

    Note: Another example will be "TemperatureDisplay.vi" under "TextLCD" folder. This exampleshows how to combined use different phidgets.

  • 8/13/2019 Phidgets LabVIEW Manual

    23/367

  • 8/13/2019 Phidgets LabVIEW Manual

    24/367

  • 8/13/2019 Phidgets LabVIEW Manual

    25/367

    Phidgets Common 25

    2011 Phidgets Inc.

    4.2 PhidgetClose

    Description:

    Close a Phidget handle.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    26/367

    Phidgets Com mon26

    2011 Phidgets Inc.

    4.3 PhidgetDelete

    Description:

    Delete a Phidget handle.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    27/367

  • 8/13/2019 Phidgets LabVIEW Manual

    28/367

    Phidgets Com mon28

    2011 Phidgets Inc.

    4.5 PhidgetEventCreateOnError

    Description:

    Set up an error event handle.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Event # identification.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    29/367

    Phidgets Common 29

    2011 Phidgets Inc.

    4.6 PhidgetEventExeOnError

    Description:

    This is called when an asynchronous error occurs.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Event # identification.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Same as the Event Registration Refnum In.

    Returns the event status. (Executed is T; Not executed is F)

    The error code to get the description of.

    Contain the error description string.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    30/367

    Phidgets Com mon30

    2011 Phidgets Inc.

    4.7 PhidgetGetDeviceClass

    Description:

    Get the class of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device class constant.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    31/367

    Phidgets Common 31

    2011 Phidgets Inc.

    4.8 PhidgetGetDeviceID

    Description:

    Get the device ID of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device ID constant.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    32/367

    Phidgets Com mon32

    2011 Phidgets Inc.

    4.9 PhidgetGetDeviceLabel

    Description:

    Get the label of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device label.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    33/367

    Phidgets Common 33

    2011 Phidgets Inc.

    4.10 PhidgetGetDeviceName

    Description:

    Get the specific name of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device name.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    34/367

    Phidgets Com mon34

    2011 Phidgets Inc.

    4.11 PhidgetGetDeviceType

    Description:

    Get the type (class) of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device type.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    35/367

    Phidgets Common 35

    2011 Phidgets Inc.

    4.12 PhidgetGetDeviceVersion

    Description:

    Get the firmware version of a Phidget.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the device version.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    36/367

    Phidgets Com mon36

    2011 Phidgets Inc.

    4.13 PhidgetGetServerStatus

    Description:

    Get the connected to server status of a remotely opened Phidget. This will fail if the Phidget was openedlocally.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the server status. Possible values are 0 for unattached, 1 for attached andothers for undefined.

    The server status.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    37/367

    Phidgets Common 37

    2011 Phidgets Inc.

    4.14 PhidgetLibraryVersion

    Description:

    Get the library version. This contains a version number and a build date.

    Connector Pane:

    Controls and Indicators:

    Input

    Describes error conditions that occur before this node runs.

    Output

    Returns the library version.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    38/367

    Phidgets Com mon38

    2011 Phidgets Inc.

    4.15 PhidgetOpen

    Description:

    Open a Phidget locally.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Serial number. Specify -1 to open any.

    Time to wait for the attachment. Specify 0 to wait forever. (Default is 5000)

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the serial number.

    Returns the device status. (Attached is T; Not attached is F)

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    39/367

    Phidgets Common 39

    2011 Phidgets Inc.

    4.16 PhidgetOpenRemote

    Description:

    Open a Phidget remotely by ServerID. Note that this requires Bonjour (mDNS) to be running on both thehost and the server.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Serial number. Specify -1 to open any.

    Time to wait for the attachment. Specify 0 to wait forever. (Default is 5000)

    Server ID. Specify NULL to open any.

    Password. Can be NULL if the server is running without password.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the serial number.

    Returns the device status. (Attached is T; Not attached is F)

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    40/367

    Phidgets Com mon40

    2011 Phidgets Inc.

    4.17 PhidgetOpenRemoteIP

    Description:

    Open a Phidget remotely by address and port.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Serial number. Specify -1 to open any.

    Time to wait for the attachment. Specify 0 to wait forever. (Default is 5000)

    Address. This can be a hostname or IP address.

    Password. Can be NULL if the server is running without password.

    Port number. Default is 5001.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the serial number.

    Returns the device status. (Attached is T; Not attached is F)

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    41/367

    Phidgets Common 41

    2011 Phidgets Inc.

    4.18 PhidgetServerAddress

    Description:

    Get the address and port of a remotely opened Phidget. This will fail if the Phidget was opened locally.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the address.

    Returns the port number.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    42/367

    Phidgets Com mon42

    2011 Phidgets Inc.

    4.19 PhidgetServiceID

    Description:

    Get the server ID of a remotely opened Phidget. This will fail if the Phidget was opened locally.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Returns the server ID.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    43/367

    Phidgets Common 43

    2011 Phidgets Inc.

    4.20 PhidgetSetDeviceLabel

    Description:

    Set the label of a Phidget. Note that this is not supported on very old Phidgets, and not yet supported inWindows.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    The label to be set.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    44/367

    Phidgets Com mon44

    2011 Phidgets Inc.

    4.21 SubVIs

    This contains a set of advanced LabVIEW VIs that provide a firmware access to all phidgets. This shouldnot be direct accessed by users.

    _AttachCHK

    _ChkError

    _Close

    _Delete

    _Open

    _OpenRemote

    _OpenRemoteIP

    _SerialReturn

    _WaitAttach

    EventCloseIntDouble

    EventCloseIntInt

    EventExeIntDouble

    EventExeIntInt

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/13/2019 Phidgets LabVIEW Manual

    45/367

    Phidgets Common 45

    2011 Phidgets Inc.

    4.21.1 _AttachCHK

    Description:

    Get the attach state of a Phidget.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    The attach state (Boolean type).

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    46/367

    Phidgets Com mon46

    2011 Phidgets Inc.

    4.21.2 _ChkError

    Description:

    Check the error of a Phidget.

    Connector Pane:

    Controls and Indicators:

    Input

    Describes error conditions that occur before this node runs.

    The error code to get the description of.

    Output

    Same as the Device In.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    47/367

    Phidgets Common 47

    2011 Phidgets Inc.

    4.21.3 _Close

    Description:

    Close a Phidget device.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Same as the Device In.

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    48/367

    Phidgets Com mon48

    2011 Phidgets Inc.

    4.21.4 _Delete

    Description:

    Delete a Phidget handler.

    Connector Pane:

    Controls and Indicators:

    Input

    Device # identification.

    Describes error conditions that occur before this node runs.

    Output

    Contains error information.

  • 8/13/2019 Phidgets LabVIEW Manual

    49/367

  • 8/13/2019 Phidgets LabVIEW Manual

    50/367

    Phidgets Com mon50

    2011 Phidgets Inc.

    4.21.6 _OpenRemote

    Description:

    Open a Phidget remotely by ServerID. Note that this requires Bonjour (mDNS) to be running on both the

    host and the server.

    Connector Pane:

    Controls and Indicators:

    InputDevice # identification. This function will create a new device identification if it's 0 or invalid.

    Serial number. Specify -1 to open any.

    Serve