Go to Post We only ask that, when able, you too help other teams as we have helped you. It is this mentality of passing it forward that makes teams and FIRST great. - E. Wood [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 Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 28-08-2011, 21:56
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: How to use eeprom in labview

Quote:
Originally Posted by windtakers View Post
I've been reading the forums, and from what I've read eeprom it is use to store data and play it back for the robot to use during autonomous. But what I don't understand is how to program that into labview. If anyone can help me, or if i have my info totally wrong please let me know.
Well, EEPROM is a relatively general term meaning
Quote:
Originally Posted by Wikipedia
Electrically Erasable Programmable Read-Only Memory and is a type of non-volatile memory used in computers and other electronic devices to store small amounts of data that must be saved when power is removed, e.g., calibration tables or device configuration.
Now, for a robot application, it can be useful to write things to the cRIO's memory for use later (like autonomous data, logs, other configuration files, etc), and many teams do this. From my experience, the best way to do this would be to use some native LabVIEW VIs to write files containing whatever data you want to store to the cRIO. In the Programming Pallate, go the the File I/O subpalate. From there, there are various ways to do that. You can use the open/write/close VIs and write a string to a file. You can use the Write Spreadsheet String to File VI to write something spreadsheet-like (like a CSV File, or you can go to the Configuration File subpalate to write an INI File. Of course, you can use the corresponding Read VIs to read from the file as well.

Hopefully, this answered what you were asking; your question was a little unclear (but I did my best). If it was, there's some information about getting started with file operations in LabVIEW on their Developer Zone. Anything else, feel free to ask me.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #2   Spotlight this post!  
Unread 29-08-2011, 14:12
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

Thank you for the amazing advice, but what do i put for the file path?
Reply With Quote
  #3   Spotlight this post!  
Unread 29-08-2011, 14:36
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: How to use eeprom in labview

Quote:
Originally Posted by windtakers View Post
Thank you for the amazing advice, but what do i put for the file path?
The filepath should be the input terminal on the upper left in all three methods discussed above. Also, I don't know how the cRIO's filesystem is structured off the top of my head, so just make sure this is a valid file path to somewhere on the cRIO. If you need to check this, there's an FTP server built in, and you can browse the the directory structure from there. You can log on with a blank username & password using a FTP client (like Filezilla or Cyberduck), or I can give you a VI to do it through LabVIEW.

I also made a quick VI demonstrating the different ways to read/write from files. Note that isn't not intended to be functional, just to show how the different VIs interact with one another. LabVIEW can be like that new fancy gadget: really complicated at first sight, but once you get to know its nuances, it's a dream come true. If you need anything else, don't hesitate to ask.
Attached Files
File Type: vi File IO.vi (11.4 KB, 43 views)
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #4   Spotlight this post!  
Unread 30-08-2011, 14:10
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

I have another question. if i want to record the joystick movements,X and Y, how would i get that data into the write text file, or is it better to use a spreadsheet. If so how would i get the data into the spread sheet. also i'm planning on having the data be written in the periodic tasks.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-08-2011, 15:28
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: How to use eeprom in labview

Quote:
Originally Posted by windtakers View Post
I have another question. if i want to record the joystick movements,X and Y, how would i get that data into the write text file, or is it better to use a spreadsheet. If so how would i get the data into the spread sheet. also i'm planning on having the data be written in the periodic tasks.
In this case, I (personally) would use the Write to Spreadsheet File VI, if only because this type of data can be put into an array nicely and it's less work on the coding end (However, you can use any of the other methods and still have it work, but this would be the best/simplest).

To do that, start by putting a Joystick Get inside a loop in Periodic Tasks and unbundle the "axes" output. Then, use a Build Array (in the array palate) to make an array of the X and Y axes. You will also want to have some kind of time identifier in the array as well. Off the top of my head, the best way to do this would be to use FPGA Time VI (found in WPI Robotics Library -> Utilities). Then, you can wire this array to the 1D array input on the Write to Spreadsheet File VI (make sure it's set to append the file, not to replace it; it's a boolean input). Also, make sure there's some sort of timing on your while loop, as to not waste resources by writing files as fast as possible (maybe every 250 ms would be a good time).

Although it would probably be easier for me to just give you a VI for this, I'm not going to. One of the funny things about programming is that you actually learn best by writing things yourself. So, try to write this on your own, and if you need help, I'll help you through it.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #6   Spotlight this post!  
Unread 31-08-2011, 22:23
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

Is it possible to just use a regular tick counter or do i have to use the robot time vi. Because isn't the whole point of putting time into the spread sheet so that the motors know how long to run on a specific speed in Autonomous? Also here is a picture of my periodic tasks.
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	90
Size:	27.9 KB
ID:	10902  

Last edited by windtakers : 31-08-2011 at 22:29.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-09-2011, 06:57
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: How to use eeprom in labview

Inside the loop, the code compares the millisecond tick time to 1500. The millisecond tick is relative to when the robot booted, or when the app started, and keeps going up until it wraps. More than likely, the code should take the time when the button latched, subtract from the current time, and compare to 1500.

Also, personally, I'd take the time, X, and Y, and write them to a single file rather than having the data spread amongst two with duplicated times. This also extends if you add a manipulator or another degree of freedom to the robot or even sensor values that record the response of the robot.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 01-09-2011, 11:32
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

The Thing I'm having trouble with is the tick counter. Because i only want the joysticks to be recorded for 15sec, but because the tick counter starts at the robot boot up and not when the case is true the tick counter is already over 15sec even before i get to actually wanting to record the joysticks.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-09-2011, 11:44
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: How to use eeprom in labview

It goes something like this, although this example is for a different purpose you should be handling the time in a similar fashion:

__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #10   Spotlight this post!  
Unread 01-09-2011, 14:19
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

this is awesome, and by the way i use your team website for labview help all the time. can't believe i didn't see this one. I think I have the timed task all done now. when I extract the data in autonomous that was saved into the spreadsheet i know that i need to tell the motors how long to run on a certain speed, but i don't know how to do that. Also this is a picture of my updated periodic tasks.
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	36
Size:	25.3 KB
ID:	10906  

Last edited by windtakers : 01-09-2011 at 17:32.
Reply With Quote
  #11   Spotlight this post!  
Unread 02-09-2011, 13:34
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: How to use eeprom in labview

To play it back you can run a While loop inside the Autonomous vi
  • Set initial conditions, e.g., pseudo-joystick values = zero
  • Feed initial pseudo-joystick values into motor set speed
  • While forever loop (with an appropriate delay)
    • Read one playback line
    • In an inside loop (with an appropriate delay)
      • Keep checking until elapsed time >= recorded Robot Time (make sure the times are measured the same)
      • When the condition is true, pass the new pseudo-joystick values out, exit the inside loop
    • Feed pseudo-joystick values into motor set speed
    • Make allowances to set speed to zero after the last playback line is read as a safety measure (that'll also help handle partial/incomplete playback files)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 02-09-2011 at 16:29.
Reply With Quote
  #12   Spotlight this post!  
Unread 02-09-2011, 19:29
windtakers windtakers is offline
Registered User
AKA: Blake Dansfield
FRC #3620 (Average Joes)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: michigan
Posts: 33
windtakers is an unknown quantity at this point
Re: How to use eeprom in labview

Here is a picture of my autonomous. Can you tell me if it's programed right.
Attached Thumbnails
Click image for larger version

Name:	Untitled2.png
Views:	68
Size:	22.8 KB
ID:	10907  
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:46.

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