Go to Post 4's company, 5's a crowd, and 6 is someone off-sides. - HyPhire111 [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 10-03-2016, 16:03
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Compressor Programming in LabView

We need help programming our compressor to be able to launch things. We want it to be able press a button, make the piston shoot forward, and then release the button and the piston retracts.

If any one can help us we would be quite happy! Please and Thank You!
Reply With Quote
  #2   Spotlight this post!  
Unread 10-03-2016, 17:16
josephno1's Avatar
josephno1 josephno1 is offline
Registered User
FRC #3647
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: murica
Posts: 21
josephno1 is an unknown quantity at this point
Re: Compressor Programming in LabView

Sorry I have never used LabView.

We did something really similar in java. Here is our code

Code:
package org.usfirst.frc.team3647.subsystems;

import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Timer;
//import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Solenoid;

import org.usfirst.frc.team3647.robot.*;

public class Piston {
	public static Talon rShooter = new Talon(1);

	public static void BallShooterPiston(){
		

		Solenoid pistonOut = new Solenoid(7); // creates a Solenoid object in
												// slot 7, channel 4.

		Solenoid pistonIn = new Solenoid(0);

		if (LogitechJoystick.leftBumper) // this shoots the ball out

		{
			Robot.shootTest1 = true;
			if (Robot.shootTest1 = !Robot.shootTest) {
				rShooter.set(-1);
				// lShooter.set(1);

				Timer.delay(2);

				pistonOut.set(true); // Pushes the piston out
				pistonIn.set(false);

				Timer.delay(2);

				pistonIn.set(true); // Pulls the piston in
				pistonOut.set(false);
				Robot.shootTest = true;
				rShooter.set(0);

			}

		}
		
		if (LogitechJoystick.rightBumper2) // this shoots the ball out

		{
			Robot.shootTest1 = true;
			if (Robot.shootTest1 = !Robot.shootTest) {
				rShooter.set(-0.5);
				// lShooter.set(1);

				Timer.delay(2);

				pistonOut.set(true); // Pushes the piston out
				pistonIn.set(false);

				Timer.delay(2);

				pistonIn.set(true); // Pulls the piston in
				pistonOut.set(false);
				Robot.shootTest = true;
				rShooter.set(0);

			}

		}
		
		if(LogitechJoystick.rightBumper){
			
			rShooter.set(.25);
		}

		else {
			rShooter.set(0);
			Robot.shootTest1 = false;
			Robot.shootTest = false;
			// lShooter.set(0);
		}

	}
}
__________________
Go Team 3647 Millennium Falcons!
Reply With Quote
  #3   Spotlight this post!  
Unread 10-03-2016, 18:08
Matt-T-FRC Matt-T-FRC is offline
Electrical Engineering Student
AKA: Matt Tisovic
FRC #6181 (Northwest State Cryptic Cyborgs)
Team Role: Electrical
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Northwest Ohio
Posts: 30
Matt-T-FRC is an unknown quantity at this point
Re: Compressor Programming in LabView

Just Drag and drop these code sniplets into your Begin and telop vis and remember to close the reference in the Finish vi. Also make sure that the correct solenoid channel is used and that the shooting solenoid is on the right button.

Are these Single Solenoids or Double Solenoids?
Attached Thumbnails
Click image for larger version

Name:	6056 Solenoid Begin.png
Views:	49
Size:	15.9 KB
ID:	20326  Click image for larger version

Name:	6056 Solenoid Telop.png
Views:	38
Size:	19.8 KB
ID:	20327  Click image for larger version

Name:	6056 Solenoid Finish.png
Views:	29
Size:	10.6 KB
ID:	20328  
Reply With Quote
  #4   Spotlight this post!  
Unread 11-03-2016, 13:52
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Re: Compressor Programming in LabView

And I quote from my teacher "It is for sure a double solenoid."
Reply With Quote
  #5   Spotlight this post!  
Unread 11-03-2016, 14:24
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Re: Compressor Programming in LabView

we got the PCM to enable and the compressor light was green. we also got these errors
ERROR 91 Variant To Data in WPI_SolenoidRefNum Registry Get.vi->Teleop.vi->Robot Main.viLabVIEW: The data type of the variant is not compatible with the data type wired to the type input.

ERROR -44007 FRC: The RefNum you are trying to Get does not exist in this RefNum Registry. WPI_SolenoidRefNum Registry Get.vi

ERROR -44007 FRC: The RefNum you are trying to Get does not exist in this RefNum Registry. Teleop.vi
Reply With Quote
  #6   Spotlight this post!  
Unread 11-03-2016, 14:31
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Re: Compressor Programming in LabView

images of the program
Attached Thumbnails
Click image for larger version

Name:	tele.PNG
Views:	28
Size:	5.5 KB
ID:	20330  Click image for larger version

Name:	Capture.PNG
Views:	13
Size:	3.8 KB
ID:	20331  Click image for larger version

Name:	finish.PNG
Views:	7
Size:	1.5 KB
ID:	20332  
Reply With Quote
  #7   Spotlight this post!  
Unread 11-03-2016, 21:58
Matt-T-FRC Matt-T-FRC is offline
Electrical Engineering Student
AKA: Matt Tisovic
FRC #6181 (Northwest State Cryptic Cyborgs)
Team Role: Electrical
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Northwest Ohio
Posts: 30
Matt-T-FRC is an unknown quantity at this point
Re: Compressor Programming in LabView

Quote:
Originally Posted by snotsdelta View Post
we got the PCM to enable and the compressor light was green. we also got these errors
ERROR 91 Variant To Data in WPI_SolenoidRefNum Registry Get.vi->Teleop.vi->Robot Main.viLabVIEW: The data type of the variant is not compatible with the data type wired to the type input.

ERROR -44007 FRC: The RefNum you are trying to Get does not exist in this RefNum Registry. WPI_SolenoidRefNum Registry Get.vi

ERROR -44007 FRC: The RefNum you are trying to Get does not exist in this RefNum Registry. Teleop.vi
Alright, to solve the -44007 errors, make sure that your using the same refnum registry name in begin, Teleop and finish. In begin and finish you have Shooter Solenoid, but in Teleop you have Shooteer Solenoid.

To solve the 91 error, in the begin vi, set the solenoid to a double instead of a single solenoid from the drop down menu. Next, set the forward and reverse channels that the solenoid is wired to. After that, in the teleop.vi, change the On to a Forward and the Off to Reverse. I also attached a revised select function to drag and drop into the teleop.vi if you would like to do it that way.

That will fix both of those errors. Also, do you have a picture of how this solenoid is wired?
Attached Thumbnails
Click image for larger version

Name:	6056 Solenoid.png
Views:	9
Size:	8.4 KB
ID:	20333  
Reply With Quote
  #8   Spotlight this post!  
Unread 14-03-2016, 15:52
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Re: Compressor Programming in LabView

We got the piston working, thank you by the way for that! Next question is will the air compressor shut down automatically?
Now here is the picture you asked for earlier.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	17
Size:	873.4 KB
ID:	20343  

Last edited by snotsdelta : 14-03-2016 at 16:00. Reason: Misspelling.
Reply With Quote
  #9   Spotlight this post!  
Unread 14-03-2016, 22:51
Matt-T-FRC Matt-T-FRC is offline
Electrical Engineering Student
AKA: Matt Tisovic
FRC #6181 (Northwest State Cryptic Cyborgs)
Team Role: Electrical
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Northwest Ohio
Posts: 30
Matt-T-FRC is an unknown quantity at this point
Re: Compressor Programming in LabView

Quote:
Originally Posted by snotsdelta View Post
We got the piston working, thank you by the way for that! Next question is will the air compressor shut down automatically?
Now here is the picture you asked for earlier.
Your Welcome and thank you for the picture. Everything appears to be wired correctly, so the compressor will shut off automatically once the pressure switch reaches ~120 PSI.
Reply With Quote
  #10   Spotlight this post!  
Unread 15-03-2016, 16:06
snotsdelta snotsdelta is offline
Registered User
FRC #6056
 
Join Date: Mar 2016
Location: Rothsay
Posts: 18
snotsdelta will become famous soon enoughsnotsdelta will become famous soon enough
Re: Compressor Programming in LabView

It is all working, but we are still getting a refnum error. My teacher is just curious as why that would be.
Reply With Quote
  #11   Spotlight this post!  
Unread 15-03-2016, 16:16
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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: Compressor Programming in LabView

A Refnum error is usually going to be a typo in a name or a reference to an old device that's no longer being used.
Since everything works, hopefully it'll be a name in an unimportant or redundant section of code.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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


All times are GMT -5. The time now is 20:26.

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