Go to Post When I got home from work my facebook wall had exploded with people chanting the names of dead scientists. Did someone say culture change? :cool: - Ian Curtis [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 14-05-2013, 15:09
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
where did the behind-the-scenes code go?

in order to get a better understanding of how exactly things work on the robot, and to just do some off season research, I tried opening Motor Set Value, and then opening the only subvi that looked promising, DC Motor, only to find nothing of value in there. Can somebody tell me where all the code went?
Reply With Quote
  #2   Spotlight this post!  
Unread 15-05-2013, 21: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: where did the behind-the-scenes code go?

Motor Set Output contains two implementations, CAN and PWM. The PWM scales the input according to the motor controller ranges and calls PWM set value. That VI calls DigitalModule Set PWM which calls DIO Write PWM which calls the purple node where the value is poked into a register on the FPGA.

If you are not seeing code like this, it could be that you opened and are viewing the simulated motor code. The bottom left of the VI window will tell you either My Computer or RT Compact RIO. You can right click there to change the target if needed.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 15-05-2013, 22:29
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: where did the behind-the-scenes code go?

These attachments show the differences between the two versions.

Did you start with a Blank vi (PC target) and add Motor Set to it before drilling down?
(left picture is what you'd see with the PC as a target)

The right picture is what you'll get opening Motor Set in an FRC framework project (defaulting to cRIO as a target).
Attached Thumbnails
Click image for larger version

Name:	SetMotor-wrong.jpg
Views:	33
Size:	18.2 KB
ID:	14827  Click image for larger version

Name:	SetMotor-right.jpg
Views:	31
Size:	18.2 KB
ID:	14828  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 15-05-2013 at 22:32.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-05-2013, 22:51
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: where did the behind-the-scenes code go?

Quote:
Originally Posted by Mark McLeod View Post
Did you start with a Blank vi (PC target) and add Motor Set to it before drilling down?
This is the problem. I would have never guessed that what appears to be just a subvi would actually have the code change depending on if you are in a cRio project or not.

Thanks!
Reply With Quote
  #5   Spotlight this post!  
Unread 18-05-2013, 12:58
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: where did the behind-the-scenes code go?

LabVIEW supports many types of platforms.

It is necessary to compile your VI code for each platform, and it is often useful to swap out vi.lib subVIs that are written differently, perhaps taking advantage of OS or architectural specializations. Other languages do this too. C runtime libraries are standardized at their interface, but pre-built for platform details.

In this case, since the Wintel platform doesn't have an FPGA and can't really be the robot, we used it as a simulate-flag. If the code is PC, it links to the simulator.

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 20:54.

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