Go to Post what the HECK are you guys using there?!?!?! - dodar [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 13-02-2010, 23:13
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: Toggle through button?

Okay, so the setup for LabView will be the same as in Java, you need to variables. In LabView, variables are just read/write calls to indicators and controls. Create two indicators or controls on the front panel (one boolean, one numeric). Then go to the block diagram, right-click, and go to the Structures pallet. There will be a gray box near the bottom that says "LOCAL". Click this and place it on the block diagram. It will have a question mark and a pin on the left. Click the question mark, and it will show a list of indicators and controls that currently exist in that VI. Select your boolean or numeric. To change the variable to read instead of write, right-click on the variable, and select "Change to Read". This will allow you to input and output data from the controls and indicators in your VI more than once.

However, since LabView is by nature a parallel language, we need a way of doing the increment and setting the last seen variable separately. To do this, you can use either a Flat Sequence Structure or a Stacked Sequence Structure (both in the structures pallet). A Flat Sequence structure looks like a film reel, and each frame is executed one after another, from left to right. To add a frame, right click on the right edge of the structure and select "Add Frame After". In the first frame, you need to have an AND operator (boolean pallet), a NOT operator on the lastSeen variable to negate its value (also boolean pallet), a Quotient and Remainder VI (numeric pallet, I think), and a case statement. The Quotient and Remainder VI works just like the "%" modulus symbol in the Java example, you plug in "number + 1" into X and "3" into Y, and the remainder appears on the top right corner (R, for "remainder). Wire that to your "number" variable.

In the next frame, you need to set "lastSeen" (or whatever you called your boolean variable) to the joystick button value.

That should be it, let me know if you want me to explain anything further.
 


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
Labview toggle switch GunfighterJ NI LabVIEW 8 13-02-2011 18:03
can you use a single button as a toggle? woogit General Forum 1 15-02-2008 14:21
toggle switch Windward Programming 31 27-01-2006 22:38
Code: Toggle on Tap Dave Scheck Programming 0 11-02-2005 18:07
Toggle? f22flyboy Programming 5 03-11-2002 08:03


All times are GMT -5. The time now is 21:29.

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