Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Programing a Digital Input on the DS in Labview (http://www.chiefdelphi.com/forums/showthread.php?t=70390)

popo308 06-12-2008 19:47

Programing a Digital Input on the DS in Labview
 
I have been searching the forums on CD for quite some time now with now luck to my question... In labview how to you program a simple digital switch on your DS (wired into the extra digital and analog inputs on the right side) to just run a motor at "x" amount of speed until the push button is released?

I may have just simply overlooked the function in labview but i can't seem to find it...

Can anyone help me out with this? Is there a demo video online explaining how to do this?

Thanks!

Mark McLeod 06-12-2008 20:19

Re: Programing a Digital Input on the DS in Labview
 
The functions are found in the Block Diagram Functions under WPI Robotics Library -> Driver Station
Or do a search in Functions for
GetDigInput
GetAlgInput

popo308 06-12-2008 20:49

Re: Programing a Digital Input on the DS in Labview
 
Quote:

Originally Posted by Mark McLeod (Post 780294)
The functions are found in the Block Diagram Functions under WPI Robotics Library -> Driver Station
Or do a search in Functions for
GetDigInput
GetAlgInput

Ok thanks!

I don't see how i missed that...

Although I can't seem to figure out how to set what digital input I am looking at?

I see the pin where is says "Driver Station Digital Input (1-8)" but what goes there? a constant? or do i need to wire that to a different block?


Thanks!

BrentJ 06-12-2008 22:01

Re: Programing a Digital Input on the DS in Labview
 
Quote:

Originally Posted by popo308 (Post 780319)
Ok thanks!

I don't see how i missed that...

Although I can't seem to figure out how to set what digital input I am looking at?

I see the pin where is says "Driver Station Digital Input (1-8)" but what goes there? a constant? or do i need to wire that to a different block?


Thanks!

Off the top of my head I think it should be a constant just like you used for motors etc. In this case it would probably just be the pin number you want instead of a port and pin.

whitetiger0990 07-12-2008 03:09

Re: Programing a Digital Input on the DS in Labview
 
1 Attachment(s)
Quote:

Originally Posted by popo308 (Post 780319)
I see the pin where is says "Driver Station Digital Input (1-8)" but what goes there? a constant? or do i need to wire that to a different block?

The DS Get Digital Input VI outputs a boolean array of length 8. You can wire it to an Index Array to get the individual values. The attached picture should output the first 2 digital inputs, and the last one (remember an array of n elements goes from 0 to n-1), as boolean indicators on the VI front panel.

Doug G 15-12-2008 22:49

Re: Programing a Digital Input on the DS in Labview
 
Boy I have some catching up to do here. First of all, what is the difference between the Joystick.Get.Vi and the Joystick. GetRaw.Vi? They seem to be pretty much the same. What I'm trying to learn is how to use a Joystick button to control the state of a motor; ie. hold down a button and the motor goes forward. I've got the motor control figured out, I'm just lost on how to get it wired to the Joysitck Vi. Any guidance would be much appreciated :)

rwood359 16-12-2008 06:11

Re: Programing a Digital Input on the DS in Labview
 
Quote:

Originally Posted by Doug G (Post 784286)
Boy I have some catching up to do here. First of all, what is the difference between the Joystick.Get.Vi and the Joystick. GetRaw.Vi? They seem to be pretty much the same. What I'm trying to learn is how to use a Joystick button to control the state of a motor; ie. hold down a button and the motor goes forward. I've got the motor control figured out, I'm just lost on how to get it wired to the Joysitck Vi. Any guidance would be much appreciated :)

Basically the difference is integer vs floating point. Get Raw returns an 8 bit integer of range -128 to 127. Get returns a 32 bit floating point of range -1 to 1.
Are you trying to use the Relay VIs to control the motor?


All times are GMT -5. The time now is 08:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi