Go to Post Now if MTV had an episode of "Made" where the school's top jock wanted to drive a FIRST's teams robot to victory...now that would be a good one. - Koko Ed [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-01-2009, 16:02
Robostang 548's Avatar
Robostang 548 Robostang 548 is offline
I can program the future...
AKA: Don
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Northville Mi
Posts: 69
Robostang 548 is on a distinguished road
Send a message via AIM to Robostang 548 Send a message via MSN to Robostang 548 Send a message via Yahoo to Robostang 548
Mixed Mode Question

My team was hoping to take advantage of both LabVIEW and C++ this year in the form of a mixed mode. We used the tutorial here:

http://zone.ni.com/devzone/cda/tut/p/id/5694

and mastered developing shared libraries and writing wrapper functions for our C++ code.

We wanted to program our user mode in LabVIEW and use the assistance of C++ for our autonomous. We planned for our autonomous, to let LabVIEW clean up the signals from our sensors and handle the vision processing, then give these values to a call library function node containing some object oriented autonomous code we had planned for our bot. Because the call library function node is a one call per loop sort of operation, we struggled to come up with an idea for how to keep our non-primitive data types (c++ objects used in the code to represent the field and other robots on it) in memory after the call library function node finished.

At first we had the idea to let the C++ code run continuously and have it communicate through pointers. We had already had great success experimenting with using pointers and the call library function node in the past. We planned on putting the call library function node outside the LabVIEW autonomous loop with pointers to variables as the parameters. The c library function would store these pointers and start an infinite loop of reading the data LabVIEW is giving us from these pointers, executing the c++ code we wrote, and writing values for motors to other pointers provided to us as parameters of the initial call library function call. When we attempted this though, we ran into some difficulties. Calling a c function that is an infinite loop seemed to make the LabVIEW code freeze. Upon execution we would receive a message saying that the connection to the CRIO has been lost. We reconfigured the call library function node and got it working, however, there was no data coming back to our front panel or any other indication that the C++ test code was working (multiplying two pointers and storing them in another pointer. This code did work when there was no infinite loop.) and pressing the stop button in LabVIEW wouldn't shutdown the program.

Does anyone know any way we can make this approach work or any way of keeping our objects used in the c++ code in memory after the call library function node is finished? Is there a way we can instantiate our objects inside the shared library so that the objects are already there and will stay there even after the function called has used them?
__________________

Team 548:
Attending National Championship, Genesee District, Detroit District 2, West Michigan District, Michigan Championship?


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hybrid Mode Question ebowla Programming 1 18-02-2008 15:48
Hybrid Mode Rule Question CollmandosGrl Rules/Strategy 1 20-01-2008 07:36
Hybrid mode question. ks_mumupsi Rules/Strategy 13 14-01-2008 22:43
Question about autonomous mode itsme Programming 12 12-01-2007 13:20
autonomus mode question? holyrollers Rules/Strategy 1 05-02-2006 16:56


All times are GMT -5. The time now is 19:31.

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