Go to Post WAIT WAIT, I GOT IT!!!! What if.... it's just a picture of a fish. - Libby K [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 05-02-2009, 17:07
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Boolean Logic Using Binary

I've seen a lot of posts asking how to turn motors using joystick buttons and limit switches and the like. So here's something I cooked up that I thought I'd share.

It's a vi that takes an array of booleans, converts it to 1's and 0's, then outputs the decimal value as if it was a binary number. What this allows you to do is build an array of booleans from joystick buttons and limit switches, wire it to the vi, then wire the decimal value into a case structure. Now you can add cases for different combinations of booleans and do different things for those cases.

An example: Say you want three joystick buttons to control a motor, one for forward, one for backward, and one for stop. Build these into an array, wire it into the vi, and wire the output into a case structure. Now add cases for 4, 2, 1, and 0, with 0 being default. 4 corresponds to the first button on and the others off, 2 corresponds to the second button on and the others off, 1 corresponds to the third button on and the others off, and 0 is what you want to do for all the cases you're not considering.

This might not make sense, but download the vi and try it, see what case is selected when you press different buttons. I hope this vi can help some people, as well as clean up some block diagram.

Thanks for reading and good luck!
Attached Files
File Type: vi Convert Binary.vi (9.5 KB, 31 views)
__________________
Twitter Profile

Last edited by Luke Pike : 05-02-2009 at 23:11.
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
Toggling boolean using 2 limit switches Quarkster NI LabVIEW 2 02-02-2009 22:43
Boolean searches Brandon Martus Announcements 8 10-05-2006 09:16
boolean problems Andrew Blair 3D Animation and Competition 6 26-07-2005 19:44
boolean atmaturen Programming 8 28-12-2004 12:49
Boolean statement blindguyinanorg Programming 2 15-02-2004 07:31


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

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