Two Digital inputs phidget1063

Supporting Labview 2012 and up
Post Reply
Cyril06
Fresh meat
Posts: 3
Joined: Tue Aug 18, 2020 5:48 am
Contact:

Two Digital inputs phidget1063

Post by Cyril06 »

Hello everyone,

I am trying to use a phidget1063 steppermotor card and I want to pilot the stepper motor with two switches (connected to digital input).
Individually stepper motor and switch works well.
But I don't know how to read two digital inputs in the same labview programm.
For that I need to read and change the channel value entered in "DigitalInputStart". But this value is fixed during the initilization step and does not change after.
How to deal in the same time with two digital inputs from the same 1063 card and labview , if anyone have an example, thanks?
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Two Digital inputs phidget1063

Post by mparadis »

You should be able to hover over the "Channel" connection for the digital inputs and right-click and select "Create" -> "Constant". Type "0" for one of them and "1" for the other.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Two Digital inputs phidget1063

Post by jdecoux »

To tack on a bit more information, you can use the Channel parameter of the Device Info cluster. There are two ways to do this:

In both cases right click the Device Info input on the DigitalInputStart vi (in the top-left corner).

Either choose Create->Control to have the values accessible from the control panel, or choose
Create->Constant to set the values from the block diagram.

In both cases, set the Channel property of the cluster to 0 and 1, for inputs 0 and 1 respectively, or to whichever inputs you are using.
Cyril06
Fresh meat
Posts: 3
Joined: Tue Aug 18, 2020 5:48 am
Contact:

Re: Two Digital inputs phidget1063

Post by Cyril06 »

yes I have tried to play with the channel from the "device info cluster";
But, once the initialization is done (device recognized, etc) the programm will not check anymore if the value of the channel parameter in the cluster have been changed. I can change it (create control) but it will not read it as it is not in my loop.
I am quite new to labview, is there another way, like "events" to deal will more than one digital input on the phidget.

I put the modified phidget example I would use to test how to read channel 0 or 1

Thanks again
DgitalInput event county test.pdf
(11.95 KiB) Downloaded 918 times
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Two Digital inputs phidget1063

Post by jdecoux »

You are correct, once opened the channel is set and cannot be changed until the device is closed.

In order to access the second channel, you need to open a second DigitalInput object.
Multi Channel Block Diagram.PNG
Multi Channel Front Panel.PNG
Cyril06
Fresh meat
Posts: 3
Joined: Tue Aug 18, 2020 5:48 am
Contact:

Re: Two Digital inputs phidget1063

Post by Cyril06 »

It works, thanks a lot!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests