Go to Post Like a typical sport or game played, students and other teams should want to beat the team on the field and not anywhere else - rcmolloy [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 03-03-2013, 23:32
chris.boyle's Avatar
chris.boyle chris.boyle is offline
Programming Mentor
FRC #0068 (Truck Town Thunder)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Truck Town Thunder (Brandon)
Posts: 36
chris.boyle is on a distinguished road
Detecting connection to FMS

Is it possible to determine if we are connected to the FMS or running locally? I am trying to help a team control their off-board compressor.

R80 - Compressed air on the ROBOT must be provided by one and only one compressor. Compressor specifications may not exceed nominal 12VDC, 1.05 cfm flow rate. Off-board compressors must be controlled and powered by the ROBOT.

My thought is that if we can determine if (at startup) we are connected to the FMS, then any code related to the compressor would not be run (Open & Control Loop), thus avoid generating and reference errors during a match. I have searched the WPI palettes and only find the alliance color and position.

They have implemented a manual approach to this problem for now, check for the existence of a file in begin.vi and use that to run the compressor code. This method requires a file to be copied to the cRIO, then reboot it, let it fill the air tanks, then delete it from the cRIO, reboot it again, before placing the robot on the field.

To many possibilities for mistakes and causing errors during a match.
__________________
2014 Chairman's Award--Michigan State Championship
2014 Chairman's Award--Waterford District
2014 Winner--Great Lakes Bay District
2013 Chairman's Award--Kettering District
2012 Championship Division Finalists--Thanks 330 and 639
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2013, 00:15
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Detecting connection to FMS

The Compressor Open VI has no way of knowing whether the relay and Digital Input are plugged in. You will see no errors from WPILib when they are unplugged that do not appear when they are plugged in. I highly recommend not adding unnecessary complexity to the code.

When the Pressure Switch is not plugged in the Compressor Relay will never be turned on.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-03-2013, 02:38
nekojess nekojess is offline
Controls Surgeon and Diagnostician
AKA: Jessica C
no team
 
Join Date: Mar 2013
Rookie Year: 2001
Location: Michigan
Posts: 15
nekojess is an unknown quantity at this point
Re: Detecting connection to FMS

You can detect attachment to the FMS by checking the RawControlByte output of the driver station Get Mode vi. It's called in Robot Main and the control byte is discarded. It'd probably be most efficient to have it set to a global variable in Robot Main, rather than calling Get Mode just for the control byte.

The Get Mode vi itself uses the 1st, 4th, and 5th bits in order to determine the current mode, and outputs the appropriate enum value.

The relevant bits of the RawControlByte are as follows:
Code:
 Bit | Contents
-----+----------
   0 | 
   1 | Test Mode
   2 |
   3 | FMS Attached
   4 | Telop(0) / Autonomous(1)
   5 | Enabled
   6 | Emergency Stopped(0) / Okay(1)
   7 |
I've tested all of those except for FMS Attached, but I'm extremely confident it'll work properly. Also, WPIlib (C++ at least) has supposed definitions for the other bits... but it also has Test Mode called cRIOChkSum, so I don't think it's really up to date... Nothing actually uses FMS Attached and the other ones anywhere, except for the firmware.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-03-2013, 17:32
nekojess nekojess is offline
Controls Surgeon and Diagnostician
AKA: Jessica C
no team
 
Join Date: Mar 2013
Rookie Year: 2001
Location: Michigan
Posts: 15
nekojess is an unknown quantity at this point
Re: Detecting connection to FMS

I pulled it together into a vi which outputs a named cluster with the bits you want. It should work. Haven't tested it yet.

Driver Station Control Data.vi

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 08:57.

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