Go to Post You mean nobody else has picked up on the hint about next year's game being called "Whack the Billfred"? - EricH [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 20-01-2011, 10:26
mike1010100 mike1010100 is offline
Registered User
FRC #1307 (RoboSaints)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2008
Location: Hampton, New Hampshire
Posts: 26
mike1010100 is an unknown quantity at this point
Simulated Robot?

I was wondering if there was a way to simulate code and get readouts of joystick inputs ect. without connecting to the cRIO. IE a simulated robot, because when i go to run code it is asking for a response from the cRIO and I was wondering if there was a way around that. Mainly because I just want to see if my code will actually do what it is supposed to do. If you do know please post IN DETAIL as I am not 100% attune with LabView yet.

Many Thanks,
Newman
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2011, 10:59
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: Simulated Robot?

As you might expect, there are many levels at which you can simulate.

If you are wanting to run your VI and see if the basic logic is correct, you can do that sort of thing pretty easily at the subVI level. If you want WPILib to work, even just the joysticks, that is not something that is available ... yet. It would be cool though.

To test a subVI, you can go to the bottom left of a window, right click on the target string next to the scrollbar, and choose to execute on the My Computer target instead. This should open a duplicate of the VI that will run locally. For simple subVIs, you can then type in numbers, run, and view the outputs. You can set breakpoints, single step, execution hilight, etc. More complicated VIs may be broken due to missing VIs, which you can disable and insert your own constants or calculated values instead. This will not simulate the entire robot, but will let you run leaf level code.

You can take this a bit further by dragging your code in the project window up to the My Computer target. Again, the WPILib and other components aren't implemented for the PC, so you will have breakage or empty values returned, but it is useful for some things. Don't forget to drag the VIs back to the cRIO target, and be sure not to confuse anyone by leaving them in both places.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2011, 11:21
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: Simulated Robot?

We do this frequently to test logic. I will save a copy of the vi with PC at the end of the name, as in LineFollerPC.vi, and make changes by replacing the WPILib vi's with indicators/controls as needed. If you do as Greg suggested and drag it up the My Computer target, it will run ok.
__________________
Jon Mittelman

Senior Judge Advisor New England & Israel 2014-2015
Infinite Loop Mentor 2011-2015
TechnoTicks Mentor 2000-2011
Championship Chairman's Award 2009 Team236 TechnoTicks
Judge 2010-2015 Championships
Senior Judge Advisor New England District Championship 2014-2015
Judge Advisor Tel Aviv Regional 2007-2015
Judge Advisor Pine Tree Regional 2013
Maine Regional Planning Committee
New England District Planning Committee
Lead Inspector Microsoft Tel Aviv Regional 2006-2008
Judge & Lead Inspector GM/Technion Tel Aviv Regional 2006
Judge UTC Hartford Regional 2006
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2011, 11:35
mike1010100 mike1010100 is offline
Registered User
FRC #1307 (RoboSaints)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2008
Location: Hampton, New Hampshire
Posts: 26
mike1010100 is an unknown quantity at this point
Re: Simulated Robot?

what do you mean by the "my computer target" sorry for the stupid question but something just isnt clicking thanks

-Newman
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2011, 13:26
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: Simulated Robot?

The LabVIEW project window has top-level entities called targets. A target is a computer or microcontroller that you write code for. The wizard-built projects for FRC have two targets, My Computer, that is of type PC, and a cRIO, that is of type PPC cRIO.

A VI can belong to one or more targets, and depending on where in the project you click to open it, you are selecting where you want it to execute.

Greg McKaskle
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 21:13.

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