Go to Post We don't require innovation; we simply encourage it. - Tristan Lall [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 14-02-2010, 21:15
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Smile Buttons on Joystick

Just a quick simple question -
Is the code attatched done correctly? The false area in both of the case structures are completely blank.

I want it so that Button One will accuate solenoid and basically kick. Then, I want Button Two to bring the kicker back in when it is pressed.

When this code is running, the Joystick on the Driver Station Diagnostics tab lights blue. Does this mean that the code is reading the buttons or just that it will light blue no matter what button is pressed.

Right now, the code is not working and doesn't seem to be controlling the solenoids at all.

Also, our compressor doesn't seem to be the problem. I placed the compressor code within Periodic Tasks and it does work.
Attached Thumbnails
Click image for larger version

Name:	2010 Joystic Buttons (kicker) Screenshot.PNG
Views:	128
Size:	14.1 KB
ID:	8672  
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2010, 21:31
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

Also - this is the way I opened the solenoids in the Begin.
Attached Thumbnails
Click image for larger version

Name:	2010 Begin Solenoid Screenshot.PNG
Views:	65
Size:	2.3 KB
ID:	8674  
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2010, 21:33
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Buttons on Joystick

Are you using a double solenoid or two single solenoids?

One issue with the code is that the solenoids cannot work in opposition to each other. If you turn one on, then at the same time you should be turning the other off.
They have to be changed to False at some point.

Also, the compressor code doesn't go in periodic tasks, but whatever you've done is obviously not hurting. The compressor is started in Begin and then left alone.

The Open looks fine.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2010, 22:16
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

We are using a double solenoid to control our kicker.

And, I tried to leave the compressor in just the open and finish but it didn't seem to do anything. Once I placed it into Periodic Tasks, the compressor started...compressing. Also, another school reccomended it so I hope it isn't that that is messing with the solenoids.

Hm, I changed it so that the solenoids turn off when another is turned on but it didn't seem to make a difference...

Could it be a solenoid wiring issue? I've run the Solenoid with Compressor example from LabView - the compressor works. When I click the Solenoid button on the Front Panel, a LED on the CRIO module in slot 8 lights up. However, nothing actually...happens to the solenoids.

Last edited by helenajoy : 14-02-2010 at 22:29.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2010, 22:59
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

Hmm,

I just highlighted execution as I was running the code.
The Teleop seems to be in the init loop. Isn't it supposed to be in Execute? Or is this normal? =/
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2010, 08:40
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,752
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: Buttons on Joystick

Hilight execution runs the code about 10,000,000 times slower than normal, so you may notice things that are normally just a blip. The init code runs once, then the normal execute runs for each packet. Finally, before going to another state, the Finalize state (whatever it is called) is called once.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 15-02-2010, 09:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Buttons on Joystick

When your code is working correctly, you should see two of the LEDs on the cRIO module in slot 8 working. One should light while the other is off and vice versa. You probably need to set the initial state in Begin.vi as well, but they default to Off, so they'll begin as both LEDs off.

If those lights are working, then move on to checking the wiring.
One solenoid side of your double is wired to Solenoid Breakout pin(s) 1 and the other side to pin(s) 2.


The compressor probably isn't messing up the solenoids.
Normally, in Begin.vi, we do an Open Compressor, then a Start Compressor, then the Refnum. The Start is actually a periodic task all it's own and continues to run the entire time your code is active.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #8   Spotlight this post!  
Unread 15-02-2010, 17:25
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

We have managed to get the Solenoid with Compressor example working.

We've also gotten the solenoid to accuate but we are having difficulties making the second solenoid do the release.

Also - in the Begin, we've noticed a strange discrepency. In this year's template, we need to use the Solenoid VI that has the number sign and an arrow, yes? When we double click on that VI and view the front panel, we notice that some of the settings such as Solenoid Channel or Refnum name change.

We have two solenoids opening in begin and it seems that...when we double click one of the Solenoid VIs with the number sign/arrow we open the same front panel that we would get if we double clicked the other Solenoid VI with the number sign/arrow. They don't seem to be two independent things even though the Block Diagram in Begin seems to distinguish them seperately.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-02-2010, 23:02
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Buttons on Joystick

Sorry, I've taken so long. I had a nice dinner and a productive night in the shop.

The Solenoid Refnum vi is actually the same vi no matter how many times you see it pasted onto the block diagram. So it's really only getting called once at a time.
It is just making an entry for solenoids in a registry of all open devices. What you initially see in the various fields are just the default values. When the code actually executes those default values get overridden by the inputs you gave to the Open, e.g., the name you chose and the particular solenoid pin number, etc.

There is an option under File -> VI Properties that allows you to make a vi reentrant. That means every time you paste it into the code you get a different unique copy of it. Then those reentrant copies do run independently of each other. We use that for when we have to preserve unique data stored inside the vi between calls and don't want it being called in another place and replacing the data we've preserved in the vi. For instance, if you make a vi that ramps up the speed of a motor and you want to use it for both the drive motors and for an arm motor. You'd be calling it every time you came back into Teleop, but you wouldn't want the last arm motor speed to get mixed up with the last drive motor speed when you ramp up one more step.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 16-02-2010 at 08:22.
Reply With Quote
  #10   Spotlight this post!  
Unread 16-02-2010, 15:39
pm 2389 pm 2389 is offline
Registered User
FRC #2389
 
Join Date: Feb 2010
Location: Drumright
Posts: 10
pm 2389 is an unknown quantity at this point
Re: Buttons on Joystick

is there any way to control a motor with a button using labview.
Reply With Quote
  #11   Spotlight this post!  
Unread 16-02-2010, 20:10
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Smile Re: Buttons on Joystick

Both solenoids work (when tested one at a time) on the Solenoid with Compressor example code perfectly.

In our Teleop, we have coded it in such a way that pressing Button One should accuate the solenoid. We have also changed the code so that the Button's T/F value is directly wired into a Solenoid set rather than using a case structure. However, we have had no success with that.

We also are not seeing the proper LED lighting on the 9472 module. But the Solenoid breakout indicator does light up.

(The compressor works beatifully though! )

So, we definitely know that it is not the solenoid wiring because the examples work just fine...But our code looks okay as well. Our programming is definitely at a loss right now. Any and all suggestions will be greatly appreciated. Thanks!

Edit - some added information:

We have placed a Solenoid Set in the Begin VI and have set the value to True. When we do this, both of our Solenoids (accuate and retract) work and the appropriate LEDs light up on the 9472 module. The strange thing is - the 7/8 LEDs are lit up both on our Driver Station Dashboard and on the 9472 module even though we haven't coded anything in these two areas.

Last edited by helenajoy : 16-02-2010 at 22:19.
Reply With Quote
  #12   Spotlight this post!  
Unread 16-02-2010, 23:33
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

Okay, so we no longer thing that solenoids are the problem. Like I said, the solenoids work in the example. Also, our solenoids work in our Autonomous Independent VI.

We are thinking that are problem is with the Teleop VI. When we run the Joystick Input example, we get a reading for all three of our joysticks. We also added code to the Joystick Input Example to indicate when buttons are being pressed. We got a green light whenever we pressed the buttons.

We added an Joystick button indicator within our Teleop and tested it. When we pressed a button on the joystick and viewed the Teleop Front Panel, the indicator does not turn green.
Reply With Quote
  #13   Spotlight this post!  
Unread 16-02-2010, 23:49
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Buttons on Joystick

If it's Teleop and not Auto, then I think you're right to look at the joysticks.
Double check the USB selections for your joysticks and the names given each of them. Even an extra space will make the name unique and not reference the joystick correctly.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #14   Spotlight this post!  
Unread 17-02-2010, 20:30
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Buttons on Joystick

We have just checked the joysticks as well. We have tested them and have made sure that they are in the proper USBs. And we have made sure that the names are exactly the same. When we run our Teleop, we get a Watchdog Not Fed message. We are not sure where in the code we need to feed the Watchdog or what we are doing wrong that is starving the Watchdog.

Last edited by helenajoy : 17-02-2010 at 20:41.
Reply With Quote
  #15   Spotlight this post!  
Unread 17-02-2010, 22:23
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Talking Re: Buttons on Joystick

Yay! We've finally figured out our problem!

We figured out that it was actually electronic problems with the camera that were holding us up. Since it wasn't wired properly, the Watchdog stopped our code.

Thanks, everybody!
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
Joystick Buttons? grosh NI LabVIEW 7 16-02-2009 16:59
Joystick buttons Team_2547 NI LabVIEW 1 24-01-2009 19:42
Joystick Buttons KRibordy C/C++ 6 24-01-2009 10:06
Programing joystick buttons Shivang1923 Programming 8 09-02-2008 16:21
Buttons to Pins on Joystick yarb65 Electrical 1 24-08-2007 20:39


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

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