Go to Post This is a high-energy sporting event, not a piano recital. :) - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-06-2009, 22:05
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
LabVIEW Switches

Hey guys, I know how to do this in C++ but I have no clue how to in LabVIEW.

Attached to my driver station I have a switch with 3 possible values. I want to use this switch to control a motor speed, as 3 different values.

Orientation 1 = Off
Orientation 2 = .5
Orientation 3 = 1

However I don't know how to communicate this in my code... my team has this particular switch plugged into input 2 on the driver station, the victor for the motor I want to control is plugged into slot 1 on the first digital sidecar. Any help when it comes to this would be much appreciated.

Also, I can't really figure out much in LabVIEW and all my code seems really messy. I understand LabVIEW in general, but I can't seem to master the FRC components of it. If anyone has a link to (or better yet, has written) a tutorial on the topic, please let me know, some aspects of this are driving me insane.

Thanks!
Nick
Reply With Quote
  #2   Spotlight this post!  
Unread 06-06-2009, 23:36
timmmoore timmmoore is offline
Registered User
FRC #1899
 
Join Date: Mar 2008
Location: Bellevue
Posts: 18
timmmoore is on a distinguished road
Re: LabVIEW Switches

Its not obvious whether you are using 1 driver station analog or mutliple digital inputs.
For digital inputs you need the vi Drvr Stn/Get Dig In, this gives you an array of bools, one for each digital input, just use the array vis to access the particular input value you want.
For analog, you need the vi Drvr Stn/Get Alg In, this gives 4 outputs, 1 number for each analog input. If I remember correctly the value is 0-5 float. Just get the inputs you need an convert the range.
I dont have a tutorial but I have an example of each (read 2 digital inputs into a global array and control 2 servos from 2 analog inputs) if this doesn't get you going.
Reply With Quote
  #3   Spotlight this post!  
Unread 07-06-2009, 07:50
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabVIEW Switches

If you want to see working code, you might try the FRC examples. If you want a tutorial, you might want to try the LVMastery tip jar ones from Ben Zimmer.

There are also some good ones on ni.com/FIRST.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 07-06-2009, 20:48
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
Re: LabVIEW Switches

Thanks for the help guys, I have a couple codes written and I'll try building them on the spare cRIO this week. Thanks again for helping so quickly!

Nick
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Toggle Switches in Labview seanl Programming 1 16-02-2009 13:02
Using Limit Switches in LabVIEW VeedotJaydot NI LabVIEW 2 14-02-2009 16:01
Switches CronosPrime1 Electrical 6 26-01-2006 18:22
limit switches stephenthe1 Programming 28 11-05-2005 16:37
Switches... Code\\Pilot Programming 13 16-02-2004 13:23


All times are GMT -5. The time now is 10:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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