Go to Post If your robot doesn't work, it doesn't matter, because the robot is really meaningless, in the long run. What is the important thing, the reason we're all in FIRST then? To better our understanding of Science and Technology, and hopefully make the world a better place. - Ian W. [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 29-01-2011, 17:57
Triapod Triapod is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2005
Location: NJ
Posts: 28
Triapod is an unknown quantity at this point
Playing with LabVIEW

Reticently got LabVIEW working at home and have been playing around with it since I rarely worked outside the WPI library -- aside from the basics. So i opened up some examples and mashed them together in order to learn.

On one of them, I created this under the plant PID example: State machine that waits for 2 osculations above the set-point (it misses sometimes), then it's supposed to create an array of errors and then take the maximum, and if that value is within the set tolerance, and it was all done in less than the settling time asked (delay messes timing too), a boolean labeled tuned would go on and the settling time would be recorded.

The problem is the array part: http://i53.tinypic.com/10xadco.jpg
I'm probably doing something wrong here but is there a way to get arrays to update in real-time. Also, is there a way to program: return true or false based on whether a bolean statement has remained true or false for a certain period of time.
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2011, 19: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: Playing with LabVIEW

To have it update with each loop iteration, move that code inside the loop.

More generally, when a LV wire crosses a diagram boundary, the outside wire will not be updated until the inner diagram and structure complete. For the loop, this means that the array that leaves the loop is not updated until the loop finishes.

For the Boolean state changes, there are probably many ways to do this. I think my approach would be to compare each new value to the previous using a shift register or feedback node. When they are not the same, store the time or loop iteration of the transition. To see how long since the last change, compute using the current info and the value at the transition.

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:16.

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