Go to Post It is usually the simple things that get you. - Andy Brockway [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 20-11-2014, 09:24
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,756
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: Swerve VI based on the 2011 paper & excel by Ether

Quote:
Originally Posted by jman4747 View Post
Also do formula nodes execute faster than the equivalent code on the block diagram?
They will generally be the same, however some operation such as arrays may actually take longer in the formula.

The formula and the nodes both feed into the same compiler, but with different front ends. By comparison, FPGA VIs start with the same front end and finish with different back ends.

The front end may need to parse text in order to identify types and operations. Or for nodes, it simply visits the nodes since this is already determined in the editor. The generator will then produce intermediate code for the representations, and then it will send the intermediate code through the LLVM back end.

I did a quick measure averaging random numbers and saw that the scalars were almost the same. The formula for accessing elements of four different arrays and storing in a fifth was about 50% more expensive in the formula node. I personally wouldn't read too much into that, since I was using the indexing tunnels on the LV diagram, so that probably gave the diagram simpler code to generate.

Generally, I try to write code that is the most understandable. I measure performance quite often, but I try to achieve it by using the proper algorithms, understanding what the major operations are in the algorithm, then make minimal edits or data structure changes in order to gain performance. Sometimes the more understandable code is a formula, sometimes not.

Greg McKaskle
  #17   Spotlight this post!  
Unread 20-11-2014, 09:44
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,113
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: Swerve VI based on the 2011 paper & excel by Ether

Quote:
Originally Posted by jman4747 View Post
The sequencing changes (going to all wires) didn't change any output values which is why I was confused.
Now that I look more carefully at what you're doing, I see you are running this in a loop. After two (or three, in your original code) iterations, all the values are guaranteed to have settled down. But if you were watching closely, or logging values each time through the loop, you might have noticed a glitch in the output whenever you changed input values.

I thought this was a subVI that you were calling in an actual robot program. If that had been the case, the glitchy output values could have shown up as undesired operation of the robot.
Closed Thread


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 02:50.

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