Sample project to connect MOT2002

Supporting Visual Studio on Windows
Post Reply
Peter Webb
Fresh meat
Posts: 3
Joined: Wed Jan 31, 2024 9:47 pm
Contact:

Sample project to connect MOT2002

Post by Peter Webb »

Trying to connect to MOT2002 thru HUB00001, C# in VS2022

* In the Phidget control panel, works perfectly (using Voltage Input Mode and setting to generic voltage input or as MOT2002, or using Digital Input Mode) -> no problem with hardware
* Have HUM1001 and LUX100 connected to the same hub, those work perfectly with their sample programs -> no problem with libraries
* But using sample programs VoltageInput or DigitalInput I get "Attached: Nothing" -> problem!

Any help appreciated!
User avatar
Patrick
Lead Developer
Posts: 616
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Sample project to connect MOT2002

Post by Patrick »

The MOT2002 is an analog sensor, so you will need to set isHubPort to true before calling open in order to use the Voltage Input mode of the hub port.

On the MOT2002 product page, you can use the code sample generator to generate a sample project.

-Patrick
Peter Webb
Fresh meat
Posts: 3
Joined: Wed Jan 31, 2024 9:47 pm
Contact:

Re: Sample project to connect MOT2002

Post by Peter Webb »

Thanks.

I tried something like this with no success. Will try again in a few days (away from my workbench for now), and post code if I can't make it work.

BTW, the MOT2002 page does not let you build a sample project, it directs you to the hub, where you have to work out the specifics for the device - which I failed at!
jdecoux
Labview Developer
Posts: 163
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Sample project to connect MOT2002

Post by jdecoux »

There is a Code Samples tab on the MOT2002 page that allows you to select a programming language and the Hub you are connecting to, which will give you code specific to your use-case to get started.

https://www.phidgets.com/products.php?p ... de_Samples
Peter Webb
Fresh meat
Posts: 3
Joined: Wed Jan 31, 2024 9:47 pm
Contact:

Re: Sample project to connect MOT2002

Post by Peter Webb »

I see the code samples page now.

Tried that, success, I see motion!

Thanks, looking forward to getting it working in my application.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 36 guests