|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
Re: Simulated Robot?
what do you mean by the "my computer target" sorry for the stupid question but something just isnt clicking thanks
-Newman |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|