Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   where did the behind-the-scenes code go? (http://www.chiefdelphi.com/forums/showthread.php?t=116874)

tilky 14-05-2013 15:09

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?

Greg McKaskle 15-05-2013 21:45

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

Mark McLeod 15-05-2013 22:29

Re: where did the behind-the-scenes code go?
 
2 Attachment(s)
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).

tilky 15-05-2013 22:51

Re: where did the behind-the-scenes code go?
 
Quote:

Originally Posted by Mark McLeod (Post 1275236)
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!

Greg McKaskle 18-05-2013 12:58

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


All times are GMT -5. The time now is 09:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi