Go to Post The best way to win an award is to not try to win an award. - MrTechCenter [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: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-01-2011, 18:38
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: PID need someone to look it over.

that part may be wrong because i do not know what that input does exactly but i was hoping that it would give me an exact time value instead of the vi calculating its own runtime
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2011, 21:10
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: PID need someone to look it over.

If you want a few pointers on more readable diagrams -- so that you can read your code more easily and others can too, I'll throw some out there.

When you have a choice between a case structure and the ternary assignment, also called the Select node, use the Select.

When you have a positive and negative constant that you are just selecting between, consider using one constant and multiply by either one or negative one. When you need to change the constant, you are far less likely to wind up with a partial update.

Whenever possible, combine the Booleans into a number and switch on that to minimize duplication of constants and code.

My monitor is 1920x1200 and I still need to scroll quite a bit to see your diagram. White space is cool, but if you need to scroll, limit the scrolling to one dimension. Even better, use subVIs to avoid scrolling altogether.

I can't follow the logic enough to be able to answer your question about the PID.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2011, 22:15
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: PID need someone to look it over.

I think my problem is not knowing what i can use to simplify things more (also i find it easier to use stacked cases than use arrays). And what are ternary assignments?
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2011, 06:45
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: PID need someone to look it over.

Ternary assignment in C/C++ looks like

y= a<0.3 ? 0 : a;

which is equivalent to

if(a < 0.3)
y= 0;
else
y= a;

In LV it looks like the attached image.

Greg McKaskle
Attached Images
 
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:20.

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