Go to Post Seating is limited. Be sure to apply deodorant and brush your teeth. - Wayne TenBrink [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 07-02-2010, 19:40
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
problems with using switches for autonomous

For our team autonomous, we decided to use switches for autonomous. We connected the Cypress board and the breadboard to wire up the switches. The value from the switches are being displayed on the driver station(classmate) but somehow, the program is not reading the value. The only value that it reads is 0. Even when we flip the switches, the value on the laptop does not change. (However, the value on the driver station is changing without any problems.)
Could anyone please help us on this problem?
Thank you!

EDIT*
The values from the switches are being read by the Classmate Driver Station, but not on the programming laptop (separate from the Classmate). It shows change on the Classmate Driver Station, but not on the programming laptop.

Last edited by ssica_jj : 07-02-2010 at 22:56.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-02-2010, 21:22
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: problems with using switches for autonomous

The value is being displayed, but it isn't being read? It's changing, but it isn't changing? I don't understand what you're saying.
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2010, 21:24
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 5,988
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: problems with using switches for autonomous

Why not put the switches on the robot, connected to the digital IO on the digital sidecar?
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2010, 21:27
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: problems with using switches for autonomous

the values(boolean) is being displayed on the driver station, under the I/O tab, but not in the program on LabVIEW when you run it. It changes between 1 and 0 on the display on the driver station but not in the program.

I don't know how you would go about putting the switches on the robot. We have always put the switches with the driver station. We would like to keep it this way, however, we are willing to try another way if it is not possible to program the switches with the driver station.

Last edited by ssica_jj : 07-02-2010 at 21:31.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2010, 22:13
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: problems with using switches for autonomous

How are you determining that the value is not being read in LabVIEW? If you show us your code, we might see something that's not doing what you think it is.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2010, 22:32
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: problems with using switches for autonomous

We ran the RobotMain.vi in the project containing the code. We connect the laptop to the router which is connected to the driver station.

Attached is a screen shot of our code.
Attached Thumbnails
Click image for larger version

Name:	switchcode.jpg
Views:	106
Size:	94.4 KB
ID:	8548  
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2010, 22:47
Acshi Acshi is offline
Registered User
FRC #2924
 
Join Date: Jan 2009
Location: WA
Posts: 12
Acshi is an unknown quantity at this point
Re: problems with using switches for autonomous

Might it will only work during disabled mode and once it moves into autonomous mode the correct reading are overridden with incorrect ones? That might make sense since, you only have to read once and they might want to insure no active data is going to the bot in autonomous mode...
Reply With Quote
  #8   Spotlight this post!  
Unread 07-02-2010, 22:51
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: problems with using switches for autonomous

Even though it is in the Disabled.vi, it should be reading it, however it doesn't read whether it is enabled or disabled.
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2010, 23:53
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: problems with using switches for autonomous

Quote:
Originally Posted by ssica_jj View Post
Attached is a screen shot of our code.
You still haven't said how you are determining that the value isn't being read. Are you probing any of the wires to find out whether the data from the Driver Station digital inputs is making it out of the Get Dig In?

I don't know why you're storing a string of text "1" and "0" characters in something called "Program Num", I am having a hard time understanding why you are doing a Concatenate instead of using the Append T/F String vi to do the appending it is designed for, and I have no idea why you put a Get Dig In there three times. Can you describe what that code is supposed to be doing?
Reply With Quote
  #10   Spotlight this post!  
Unread 08-02-2010, 23:04
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: problems with using switches for autonomous

Quote:
Originally Posted by Alan Anderson View Post
You still haven't said how you are determining that the value isn't being read. Are you probing any of the wires to find out whether the data from the Driver Station digital inputs is making it out of the Get Dig In?
When we ran the code, to check the values, we turned on the 'highlight execution' and saw that the only value being read is 0.

Quote:
Originally Posted by Alan Anderson View Post
I dont know why you're storing a string of text "1" and "0" characters in something called "Program Num", I am having a hard time understanding why you are doing a Concatenate instead of using the Append T/F String vi to do the appending it is designed for, and I have no idea why you put a Get Dig In there three times. Can you describe what that code is supposed to be doing?
There are 3 Get Dig In because we are using 3 switches. We are converting the value into string then concatenating them in order to create different combination for the case selector in autonomous. That way, we can have multiple autonomous modes and switch between them between matches without re-downloading the code each time. We are using the Append T/F String.vi to convert the digital input value into string.
Attached Thumbnails
Click image for larger version

Name:	2010disabled_wlabel.jpg
Views:	44
Size:	141.2 KB
ID:	8573  Click image for larger version

Name:	2009 atuo.jpg
Views:	45
Size:	145.3 KB
ID:	8574  
Reply With Quote
  #11   Spotlight this post!  
Unread 09-02-2010, 07:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: problems with using switches for autonomous

Quote:
Originally Posted by ssica_jj View Post
When we ran the code, to check the values, we turned on the 'highlight execution' and saw that the only value being read is 0.
Try putting an indicator or a probe on the output of Get Dig In and running the code at speed.

Quote:
There are 3 Get Dig In because we are using 3 switches.
Get Dig In returns all eight switches at the same time. You only need to use it once, and you can get multiple elements from its output with a single Index Array. See the attached code fragment. [edit]...which apparently didn't get attached properly, and which I do not have a copy of at the moment. I'll try to correct that later today.[/edit]

Quote:
We are using the Append T/F String.vi to convert the digital input value into string.
I understand that, but you're ignoring the "Append" part of it. You can build the string as you go instead of keeping the characters separate and combining them in a separate step.

Last edited by Alan Anderson : 09-02-2010 at 12:18.
Reply With Quote
  #12   Spotlight this post!  
Unread 09-02-2010, 10:05
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: problems with using switches for autonomous

Are you using compatibility i/o or extended i/o?

Alan, you forgot the code fragment.
Reply With Quote
  #13   Spotlight this post!  
Unread 09-02-2010, 16:56
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: problems with using switches for autonomous

Quote:
Originally Posted by Joe Ross View Post
Alan, you forgot the code fragment.
I thought it was there when I wrote the post this morning. Here it is (again).
Attached Thumbnails
Click image for larger version

Name:	Autonomous Select.jpg
Views:	52
Size:	41.7 KB
ID:	8583  
Reply With Quote
  #14   Spotlight this post!  
Unread 09-02-2010, 23:12
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Smile Re: problems with using switches for autonomous

Quote:
Originally Posted by Alan Anderson View Post
I thought it was there when I wrote the post this morning. Here it is (again).
We tried what you suggested. It works! Thank you for your help! We really appreciate it.
Reply With Quote
  #15   Spotlight this post!  
Unread 12-03-2010, 11:31
randalcr's Avatar
randalcr randalcr is offline
Programming Mentor
AKA: Chance Randall
FRC #0476 (Wildcats)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ponca City
Posts: 82
randalcr is an unknown quantity at this point
Re: problems with using switches for autonomous

Quote:
Originally Posted by ssica_jj View Post
We ran the RobotMain.vi in the project containing the code. We connect the laptop to the router which is connected to the driver station.

Attached is a screen shot of our code.
we have our auton. working in the same way you guys do except on ours we have the boolean output of the "get Dig. in" block going to a block that gets the ID of the switch and goes directly into a case structure. inside the case we have different "pages" that have different auton. programs. the DIG. In is what controls the program.
__________________
-Time is the best teacher...unfortunately it kills all of its students. --Robin Williams
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
Programming toggle switches to DS for different autonomous routines? grosh NI LabVIEW 9 30-03-2009 20:42
Problems with using 330's goal tracking code windell747 NI LabVIEW 11 16-02-2009 13:02
Using Limit Switches with the Arm iwin2000 Programming 3 18-02-2008 03:52
Problems with transmission using Inventor 8 Drew Hopman Inventor 4 10-01-2005 19:07
laser radar with BS2p using RS232 problems... chei_UCF19 Programming 6 26-02-2004 15:21


All times are GMT -5. The time now is 11:58.

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