|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: LabView and Ultrasonic Rangefinder
Ah, I see.
Yes, I am using the MB1010. I was just taking a look at the included example code about 10 minutes ago, and saw that there are major differences between what this years KOP had and what they are using.. EDIT - When you say look at the examples for the MB1010, do you mean the code they've got on their website or somewhere within LabView's various examples ? Last edited by DominickC : 15-01-2012 at 18:30. |
|
#2
|
|||
|
|||
|
Re: LabView and Ultrasonic Rangefinder
Ah, I see the examples within LabView's set of examples! Now, what are the pro's and con's for using analog versus digital?
|
|
#3
|
|||
|
|||
|
Re: LabView and Ultrasonic Rangefinder
And if I wanted to import the example code into the example teleop.vi, could I just copy/paste the code in, and put it within a while loop which becomes true when a button on the joystick is pressed? (thus ranging once and displaying one distance in the dashboard)?
|
|
#4
|
|||||
|
|||||
|
Re: LabView and Ultrasonic Rangefinder
Quote:
Quote:
In general, applying the examples to a robot project is a matter of putting everything to the left of the example's while loop into Begin, putting everything inside the while loop into Teleop (or Periodic Tasks), and everything after the loop into Finish. Use a RefNum Registry Set in Begin to save the reference for later retrieval with a RefNum Registry Get. For some of the examples, you might want to look up the documentation for the "Data Operations" item on front panel controls, specifically the "Make Current Value Default" command. The analog example actually has some things inside the while loop that probably belong in Begin. The digital example is much more straightforward to put into a robot project. |
|
#5
|
||||||
|
||||||
|
Re: LabView and Ultrasonic Rangefinder
Quote:
The major recommendation I would make is that instead of reading the data from the sensor the build dashboard data vi as shown, I would read the data where you want it (either teleop or periodic tasks) and save it in a global variable, and then read the global variable in the build dashboard data vi. |
|
#6
|
||||
|
||||
|
Re: LabView and Ultrasonic Rangefinder
Also, Tutorial 7 from the LabVIEW Getting Started Window shows how to send data to the dashboard. See Part 2 of that tutorial.
|
|
#7
|
|||
|
|||
|
Re: LabView and Ultrasonic Rangefinder
Thank you all for your help and references!
I read and tried to follow the tutorial from NI step by step, but left more confused than when I began. Then, I went through tutorial 7 from LabView's Getting Started Window. Now I feel that I have a grasp on what's going on. I'll give it a crack and post my results. |
|
#8
|
|||
|
|||
|
Re: LabView and Ultrasonic Rangefinder
Great news! I was able to properly code in the rangefinder!
Now, one final question. I read somewhere that there should only be one Set High(/Low) User Data Priority per vi? If this is so, how would I integrate the Gyro, Accelerometer, Rangefinder, and Potentiometer in with each other ? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|