OCCRA [more] FRC Kickoff : 23d 15h 36m ...
Haha, I applaud your efforts to read into the actions of the GDC, but I feel like trying to do so is like shooting at a target, in the dark, at a mile away, with a sawed off shotgun. - ttldomination [more]
 Chief Delphi HELP!!! BOOLEAN VARIABLES IN LABVIEW
 CD-Events CD-Media CD-Spy FRC-Spy
The Chief Delphi Forums are sponsored by Innovation First International, Inc.

#1
02-07-2009, 01:10 PM
 PRAWG Registered User FRC #1403 Join Date: Feb 2009 Location: Montgomery, N.J Posts: 1
HELP!!! BOOLEAN VARIABLES IN LABVIEW

Hey guys, I'm having some trouble getting limit switches working in our robot. We are using 3 Limit Switches for different positions on the Lazy Susan. We have planned out the code in notepad as follows,

Code:
```//ls1 = limit switch 1
//ls2 = limit switch 2
//ls3 = limit switch 3
// 1= go left
//-1 = go right

boolean left = 0
boolean top = 0
boolean right = 0

if (ls1 = 1) then
left = 1
end if

if (ls2 = 1) then
top = 1
end if

if (ls3 = 1) then
right = 1
end if

//button 4
if (left = 1 && top = 1 && right = 0) then
speed = 1
if(left = T) then
top = 0;
speed = 1until ls1 = 1
end if

if (left = 1 && top = 0 && right = 0) then
speed = 1
speed = 1 until ls1 = 1
end if

if (left = 1 && top = 1 && right = 1) then
speed = 1 until ls1 = 1
end if

if (ls1 = 1 and left = 1) then
speed = 0
end if

/button 5

if (left = 1 && top = 0 && right = 0) then
speed = - 1 until ls3 = 1
end if

if (left = 1 && top = 1 && right = 0) then
speed = - 1 until ls3 = 1
end if

if (left = 1 && top = 1 && right = 1 && ls3 = 1) then
speed = 0
end if

/button 3

if (left = 1 && top = 0 && right = 0) then
speed = 1 until ls2 = 1
end if

if (left = 1 && top = 1 && right = 0) then
speed = -1 until ls3 = 1
end if

if (left = 1 && top = 1 && right = 1) then
speed = - 1 until ls3 = 1
end if

if(ls2 = 1) then
speed = 0
end if```
We need help initiating a boolean variable(or array), but we cant find it in LabView. help us pl0x.

Last edited by PRAWG : 02-07-2009 at 01:13 PM.
#2
02-07-2009, 01:25 PM
 psy_wombats Registered User AKA: A. King FRC #0467 (Duct Tape Bandits) Team Role: Programmer Join Date: Jan 2007 Rookie Year: 2007 Location: Shrewsbury MA Posts: 95
Re: HELP!!! BOOLEAN VARIABLES IN LABVIEW

You can create a booolean variable by right-clicking on the front panel of the VI and selecting Modern and then navigating to the Boolean palette. There should be options there. An indicator/controller will appear on the backpanel.

To init the boolean, you can wire a constant to it, and then reference the boolean by local variables, (created by right-click on the object > create > local variable). The initial value will only be used when the indicator hasn't been accessed by a local variable and updated.
#3
02-07-2009, 06:44 PM
 Alan Anderson Software Architect FRC #0045 (TechnoKats) Team Role: Mentor Join Date: Feb 2004 Rookie Year: 2004 Location: Kokomo, Indiana Posts: 7,171
Re: HELP!!! BOOLEAN VARIABLES IN LABVIEW

For the most part, in LabVIEW, what would be variables in C are just wires between things. I don't think you need to do anything special. Just read the state of your limit switch. Its output will be a boolean value that you can wire up to the rest of your functions.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum         FIRST E-Mail Blast Archive     Rumor Mill     Career     Robot Showcase     Moderated Discussion Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         WindRiver C++         Java         MATLAB & Simulink         Python     intelitek easyC/REC information         easyC v2 for Vex         easyC for FRC         REC/Learnmate         WPILib         easyC PRO     Control System         IFI Control System         FRC Control System         Sensors         USB Chicklet     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Pro ENGINEER / Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics     National Instruments LabVIEW and Data Acquisition         LabView and Data Acquisition Competition     Awards         Chairman's Award     Rules/Strategy         Scouting         You Make The Call     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     FIRST in Michigan     Mid-Atlantic Robotics     Off-Season Events         Chief Delphi Invitational     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A         OCCRA Programming Other     Unsung FIRST Heroes     Chit-Chat         Games/Trivia             Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         Western Region Robotics Forum         Robot Chicks Union (RCU)         Southern California Regional Robotics Forum         FIRST Interactive Rural SupporT         FIRST Scouting Network         The Grand FIRST Team         FloridaFIRST         FIRSTwiki         Ultimate Robot Challenge         Team San Diego         Dream FIRST         The Blue Alliance             Video Archives     FIRST Historians     FIRST-A-Holic's Anonymous Mailbox     FIRST In the News...     FIRST Lego League         Lego Mindstorm Discussion     FIRST Tech Challenge     VEX         VEX Robotics Competition         VEX IQ     Televised Robotics     Math and Science         NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion Old Forum Archives     1999     2000     2001

 Similar Threads Thread Thread Starter Forum Replies Last Post Making global variables in LabVIEW. Joshamuffin National Instruments LabVIEW and Data Acquisition 1 01-19-2009 01:35 PM [FTC]: Variables in labview wilsonmw04 FIRST Tech Challenge 2 11-23-2008 08:57 AM Labview dashboard and multiple variables Joe Ross LabView and Data Acquisition 2 03-15-2006 09:55 PM Help figuring out controller variables fwxer Programming 1 01-31-2005 02:28 AM Need help with Variables ? David Bryan Programming 5 02-23-2004 07:42 AM

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

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

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top