Implementing a quadTree in labVIEW

I am trying to use a quadTree to efficiently store a 2-D map of data but have been having trouble figuring out how to go about it. I have written an implementation for a quadTree in Java and have been having some issues with the logistics for a labVIEW version. Has anyone else gotten something like this to work? I think it might be possible is I create a generic bundle for the quad nodes but I am unsure how to create it if the node would store its 4 children nodes inside of it. I am also a bit confused about how to deal with an empty node and how or if LabVIEW is able to deal with the concept of a "null" node. Thank you very much for your help.

The "nodes" i am refering to are the individual elements in the tree so in the case of a quad tree each "node" would store some data as well have space for 4 references to "nodes" ie the nodes children. I have used clustering before and I thought it might be a good place to start I am just unsure how to create a new insance of a cluster, the "node", dynamicaly so I would not have to create a set number of "nodes" before the program starts. How the quadTree works in say java, is that if a new piece of data is added to a node that already has data, the node will split itself into 4 equal sized children and store the data which creates new nodes as the program is running. 
With that in mind, I am looking to implement this quadTree functionality in labVIEW to store data about a 2-D environment efficiently with the ability to say find all objects inside a given search area. The data I want to store about each point will be minimul, probably just a char or single number, but the bounds of the 2-D environment will be defined at runtime. The data structure will be holding a lot of points, on the order of at least several hundered points, and also needs to be able to scale with out being bogged down to much. 
Thanks again for the informantion. I have done a good amount of LabVIEW programming just not when dealing with creating advanced data structures. 

Similar Messages

  • Implementi​ng Formula in LabView

    I seem to have a rather odd problem. I just can't figure out why isn't a certain calculation (refractive index) working properly.
    Background info: I measured a high purity silicon plate using an instrument (THz-TDS), suffice it to say that the formulae for calculating refractive index from my raw data is very well established and published. But when I implement this formulae in Labview and run it, I don't get the expected result for
    silicon (the published refractive index for high purity silicon is around 3.45), instead I get values around 1.
    Any ideas or explanations on what I'm doing wrong are appreciated.
    Attached files:
    3 VI's where one is the Main. On the Main VI just load the two *.dat files provided and type 0.00198 for sample (silicon) thickness and it should run.
    Attached is also the formulae in *.jpeg format.
    and a *.doc showing the correct ref. index graph for silicon. Unfortunately I don't have the matlab code that this was originally done from.
    Thanks again
    Kas
    Attachments:
    To Post.zip ‏67 KB

    I actually tried that but with no luck.
    There is one thing I'm curious.
    there is a line code in MatLab called: phas1=unwrap(angle(z_face1),pi).
    Is that the same this as "theta" from the polar form of FFT? 
    I made few phone calls and managed to get the MatLab code that calculated ref. index. Attached is the code.
    He didn't seem to have implemented the formulae as he should've. But he claimed he had various other samples measured and got the correct answer with this routine.
    Again, I tried implementing the same routine but no luck.
    is it possible to convert this MatLab into LabView code in a more efficient manner. I might have made a mistake translating from one language to another.
    Thanks again
    Kas
    Attachments:
    MatLab Code.txt ‏2 KB

  • Best way to implement this code in labview

    Hi
    What is the best way to implement this code in labview programming.
    I have an analogue input which triggers a boolean light when it reaches a certain voltage. but at the same time i would like it to enable two other outputs one for a set period of time and the other stay on until another statement becomes true.
    For example
    case 1:
    Set output high
    Delay(2000ms)
    Set output low
    Case 2:
    Set output high
    If statement 2 is true
    then set out put low
    if not then repeat until statement is true
    Thanks for your help

    Hi David,
    The code you posted will work, although note that the front panel becomes 'unresponsive' - as changes in the controls are only read once per iteration.  The wait function is an example of an execution timing VI, however if we want to do software timing (like a 2 hour wait) - we should use software timing VIs.
    Check out the following example (note we can stop execution during run-time):
    Regards,
    Peter D
    Attachments:
    SoftwareTiming.vi ‏26 KB

  • How to implement this code in labview?

    How do implement this pseudo code in labview? Please keep in mind "a" and "c" in the code below ARE VARIABLES
    for i =0 to i=maxvalue
           if i <= a 
               output = output2
           else if i > a AND i<=c
               output = output2
           else if i < c 
               output = output3
           else i = d
               output = output4
    I understance i can use a case structures and modify the label, but i do not know how to make the label dependent on a variable value. 
    Thanks 

    Try an array of boudaries and use threshold array. See this old example:
    Now just iterate over an array of values using a FOR loop.
    LabVIEW Champion . Do more with less code and in less time .

  • How to implement wafer mapping using LabVIEW?

    Hello LabVIEW Masters!
    I am having an incoming project which includes controlling and gathering information from a PROBER. One of the difficulties I am having now is how to implement a WAFER MAP using LabVIEW. According to my customer requirements, the wafer element ranges from 6k to 23k. I guess doing all the element (one die = one led ctl/indicator) will be a hell of a task, especially on how to effectively manipulate each elements. Does anyone have better idea on how to this?
    Please, I badly need your help.. 
    Thanks and Regards,
    Dennis DG
    Solved!
    Go to Solution.

    Hi Dennis,
    Is it okay if you send to me the working VI also?
    No, it's not ok. I made that program for my customer...
    As I am not too familiar in using intensity graph.
    That's no reason to hand over programs for free...
    My customer also request me that if the cursor hover on the wafer map, he wants the x,y corrdinates to be displayed.
    I also have such a feature. Did you notice the little yellow cursor near the center of the wafer? One could easily change that to use a MouseMove event instead...
    He also wants to select some elements in the wafer map and come up with the coordinate values to do some testing.
    That's related to the cursor thing...
    Some points:
    - You have a customer that pays you. Why should I offer work for free?
    - You can send me contact dates of your customer, I will make him an offer...
    - When you take an job to provide software you should be able to code the software...
    - The VI(s) are now some years old. I didn't code so well back those days and don't want to hand out those VIs as they are right now.
    - I included some "license management" deep inside that program, I would have to remove this and spend time on testing afterwards...
    - The VIs are based on the PROBER output format used by the customer. All the file handling has to be changed for/by you...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to implement logical equation as LabView?

    Hi,
    I have this bit test logic I need to implement as a Labview code.
    Should I use formula node or either something similar to this already in Labview?
    "((var & (1<<bit)) != 0)"  where 'var' may be 8, 16, or 32bit, 'bit' is a number 0 - 31 representing
    a bit number. 0 is the least significant bit.
    Thank you,
    Do
    Solved!
    Go to Solution.

    Rotate, And, Not equal to zero
    Message Edited by Ravens Fan on 08-10-2009 09:36 PM
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Implement active filter in LabVIEW using Orcad

    Hello. My problem is as follows:
    I have to generate a filtered signal using LabVIEW and NI-5411(Arbitrary Waveform Generator)(A sinus sweep from 10KHz to 100KHz in LabVIEW --> filter it in LabVIEW --> AWG NI-5411). The filter to use is an active filter designed with Orcad. I had thought of two choices: integrating somehow Orcad in LabVIEW or using a mathematical expression via a Formula Node to characterize that filter. The question would be how should I do it and how do I implement it.Just started working with NI5411, so any help would be really valuable. Thanks.

    Nlquist, I am attaching a passive filter in this post. But please see that it is a very rough simulation, I have not yet finalised it. I have done using signal processing and butterworth filter  In this attached simulation, I have made a noisy sine wave and filtered it using Butterworth filter. Perhaps now you could be able to answer ny doubt in a better way. I am also attaching a pdf  on reading which, I was able to simulate the passive filter ..I have checked the wikipedia page which you are referring but it contains no information how to simulate it in labview. It just contain theory of active and passsive filter. Tell me any method -simple or difficult but please help me with this active analog filter
    Attachments:
    filter labview good.pdf ‏451 KB
    low pass and high pass filter.vi ‏83 KB

  • Implementing Differential Equations using Labview fpga modules on PXI-7811R

    Dear,
        I am working on   implementing dynamic systems modeled ordinary  differential equations on PXI-7811R FPGA using labview FPGA. Is there any body who can help me how to implement differential equation on PXI devices uding Labview FPGA, please? Is there any integrator in Labview FPGA, module. I used Discrete Integerator in LAbview FPGA  module in Maths palette, but i hesistated if it really works . I really appreciate your help,
                                        Gammee

    Thank you for posting on the discussion forum.
    You can solve differential equations using LabVIEW FPGA but you may run into some significant difficulties in doing so. If you are not tied to using FPGA, you could try using LabVIEW real-time, which may make things much easier. But if you would like to stick with FPGA, see the link below for a list of examples that may be helpful:
    http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/ssnav:ipn/q/differential%20e...
    Below is a link that you can review to better understand the functionality of the discrete integrator should you choose to go that route:
    http://zone.ni.com/reference/en-XX/help/371599B-01/lvfpga/discrete_normalized_integrator/
    I hope that helps.
    Best,
    Rachel
    Rachel D.
    Applications Engineer
    National Instruments

  • Implementing Serial Communication in LabVIEW FPGA on the Xilinx SPARTAN-3E Board

    je travaille sur la carte spartan 3E et Labview avec le module FPGA.
    je veux implémenter une communication serie RS232 entre spartan 3E et PC à l'aide de deux port DB9 (DTE et DCE) sur spartan 3E de tel sorte que j'envoie un cartére sur DTE et je recoie sur l'autre port DCE.
    merci pour votre support.

    Hi Yassagem,
    It looks like you posted something very similar on this forum. I went ahead and responded on that forum post. In the future, please make sure not to duplicate forum posts.
    Best,
    tannerite
    Tannerite
    National Instruments

  • How to implement autotuning pid in labview in flow control process????

    I tried the same way as Example available in LabVIEW..... that is general auto PID simulator... But that didn't worked out for me.....

    The 'General Auto PID Simulator.vi' example uses the technique "PID Relay" feedback where it tries to calculate the PID values based on the relay feedback, but using the PID also in the loop:
    (http://zone.ni.com/reference/en-XX/help/370401H-01/lvpidmain/pidrelay_alg/)
    This technique works, but it requires initial PID parameters that will make the relay setpoint stable and it is able to obtain the results you are expecting.
    Now, for flow control, you can try the most classic techniques. Please use other shipping examples that start with "autotuning" and in special this:
    C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\control\PID\Autotuning PID Online.vi
    In this VI, you can choose other techniques like open-loop step response, closed-loop step response and the original 'relay feedback' where it doesn't have a PID inside the estimation loop.
    Anyway, here you have more information about those techniques http://zone.ni.com/reference/en-XX/help/370401H-01/TOC4.htm.
    One more thing: keep in mind that depending on the plant parameters, a PID could not be suited for your application and a more complex controller need to be developed.
    Hope this can help you...
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • Looking for VCDIFF (RFC 3284) algorithm implemented in LabVIEW

    Hello forum,
    I am looking to see if anyone knows of a publicly available implementation of the VCDIFF binary differencing algorithm in native LabVIEW (G) ? 
    Here is a link to a paper on the RFC 3284 standard for those interested: http://tools.ietf.org/html/rfc3284
    There are a number of open source implementations in C/C++, but I would like to locate one in LabVIEW if possible.
    Regards!

    Implementing binary algorithmes in LabVIEW and especially compression algorithmes, while possibe is not a very smart idea. Aside from possible perfomance problems when you start to shuffle around on bit level, there is also the issue about how to proof the correctness of your implementation. Those open source C/C++ solutions have been used, peer reviewed and what else many times and all that has uncovered various flaws and bugs during the process.There is only a very small adience that will go and use your LabVIEW algorithme and even a much smaller one who is able to do any significant form of peer review.
    So all in all you are likely to end up with a somewhat to almost working implementation that nobody is going to use, for the gain of bragging that you did it in LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • LABVIEW HMAC-SHA1 implementation

    Hello all,
    We have need of an HMAC-SHA1 implementation in Labview. Can anyone help?
    Thanks,
    Josh

    Hello Josh,
    We have a Community example that uses HMAC-SHA1 that might help you get started.  
    SHA-1 Cryptographic Hash Function
    Searching the Community Code Exchange might be a good place to find additional code that has implemented HMAC-SHA1 in LabVIEW.
    Regards,
    M. Whitaker
    ni.com/support

  • How can I convert an ac waveform to dc in Labview?

    I started out with an AC waveform, and I rectified it. I think that the next step is to add a capacitor. Is this correct? If so, how can I implement a capacitor in Labview? If not, what should I be doing?

    westerman111 wrote:
    If so, how can I implement a capacitor in Labview?
    With some funky math.
    I don't understand what you are trying to do.  Are you trying to build a circuit?  Did you aquire a waveform and are now trying to perform some measurement on it?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I increase the speed of LabView computing?

    Dear all,
    I have a problem which I didn`t thought to face.
    My problem is the folowing. I have Implemented some applications in Labview but with my great surprise the program is incredibly slow!
    One of these was just a simple try to produce sinusoidal signal. I simply made a While loop where the sine of the "i" iteration number was calculated and then
    sent to a NI- 6559 DAQ through an USB port and the DAQmx Assistant.
    Well this simple program runs at 300 Hz Maximum. A similar program in C can without problems reach 20000 Hz!
    Now I am asking if Labview is the wrong choice for more than 100 Hz applications and if it is not convenient to shift directly on C language.
    Namely I want to let you know that the apllications I need require a loop speed of at least 800Hz.
    Really I cannot understand why the system is so slow. It cannot be otherwise Labview should be unusable for the large part of the applications.
    Can you suggest me what I am doing wrong, or maximum speed reachable on a normal 3 Ghz Pentium, 1 Gb RAM?
    Best regards
    Principiant
    Solved!
    Go to Solution.

    Hi Principiant,
    I tried to reproduce your LV VI, which calculates the sine from the loop counter and get a cycle time of 0,125 microseconds, calculating the sine of every degree (0 .. 359). This means 45 us / cycle, which is 22222 Hz.
    So it is likely that the communication with Your USB- device is the bottleneck. Is this device capable of buffered output? This would be preferable, it puts a block of data (pattern) into a FIFO and the device sends it to the DAC on its own.
    greets, Dave
    Message Edited by daveTW on 01-23-2008 10:09 AM
    Greets, Dave
    Attachments:
    Example_FP.png ‏14 KB

  • I2C interface (Sensor Data Acquisition) LabVIEW

    Hi all!
    Hope you are doing great!
    Well I have a question which is more about asking all you for an idea!
    The Situation:
    I have a circuit board which has an On-Off Valve, Digital pressure sensors (manufacturer AMD) and Humidity/Temperature Sensors (make- IST Hygrosens). On the board all the sensors communicate as I2C slave devices and all the data from the sensors is read into an I2C --> USB adapter chip which further connects to the PC via normal USB cable.
    Additional to this board, There is a Relay circuit with a simple 1-pole relay which controls an on-off valve on the above Circuit board. This valve is controlled totally separate via a coaxial cable from the relay directly to the Valve. But the relay board has a I2C interface and it also acts as a slave device. The relay board has the same I2C --> USB adapter chip.
    Both the Relay board and Sensor board connect via USB to the PC which I suppose is the Master device.
    The software code written for this arrangement and Sensor data acquisition is too old and there are a lot of problems coming. I have almost given up troubleshooting..
    I now want to translate this automation system onto LabVIEW. I searched the NI website where there is a DAC card called - USB8451 which supports I2C interface... I am a beginner in LabVIEW and cant really make sense out of how should I go about implementing this system on LabVIEW..
    If you guys can please help me out to atleast start (like what all hardware I would need etc..), to have a clear picture, it would be great help!!
    Looking forward to your inputs and Thank you so much in advance!
    Cheers!
    Pramit

    NI provides a LabVIEW API for the USB8451.  If you use the USB8451, you would use the provided API to write a program that controls the USB8451 and you would do all of the I2C communication in your program.  This would mean using functions / SubVI's to connect to the USB8451 and then perform I2C operations through it.
    If you use USB already on your device, then you would probably use NI-VISA as the driver and have to get / write your own API to talk to the specific device.  The manufacturer may have a LabVIEW (or other) API available for talking to the device that you could get.  If not, then you would have to understand the details of how to communicate with the device and then write an API using NI-VISA serial functions.  This would mean making NI-VISA be the assigned driver for the device and then using VISA Serial functions / SubVI's to send the messages and receive the responses.

Maybe you are looking for