09-17-2009 02:57 PM
Hello All.
I am having a bit of a problem placing the a cursor on X where Y = Variable (Changes depending on user inputs)
I am doing this right now by looping through Data and see if current Y = desired Y location. I feel that this way is too slow and without wait period takes too much memory.
It works fine with my simulated data but I don't think it will work well with a large number of samples.
Can anyone tell me how to tell a cursor to go to where Y = myVariable?
Attached is my current VI with simulated data.
Thanks
I was not able to attached the simulated data files
Solved! Go to Solution.
09-17-2009 03:01 PM
Just to clarify.
I know how to use the property node to do this on FREE cursors but I cant get free cursors to go to my signal location.
Single plot cursors automatically follow my signal but I wish the single plot cursor would automatically move X to where it intersects Y at my desired location.
I hope this makes sense.
09-17-2009 03:08 PM
Hi JCollado,
Sorry i was unable to open your file as i am using lv 8.6.
But if i have understood you correctly the following should be helpful.
just create cursor (single plot).
regards,
Shrek
09-17-2009 03:12 PM
09-17-2009 04:14 PM
Your question is quite ambiguous, because there could be many locations that match the criterium. Only if the data is monotonically increasing or decreasing, there will be one unique solution.
Without seing some data, it's difficult to tell what you actually want. Typically, a "threshold array" on the array data will give you the first positions where the y corresponds to the input.
Anyway, your code is way too complicated for what it's doing. You can probably eliminate 80% of the property nodes. Many can be combined into one and used for read and write at the same time. You might also learn about shift registers.
Can you attach a datafile and tell us what location you want the cursor to go?
09-17-2009 04:25 PM
Your current code hurt my brain, but if you want to do something quick and dirty I would subtract the target Y from the data, take the absolute value and search for the minimum. Use the index of the minimum to set the cursor. You may get craziness with multiple values, but I would cross one bridge at a time.
I would use an event structure and free cursor myself. Trigger an event on the cursor release, and use the Y-value as the target.
09-18-2009 07:10 AM
Ok all thanks for your replies.
Sorry about my bad coding. This is my first VI and I don't really have a good grasp on labview yet. I will look into shift registers too since I may not understand their power well yet.
Attached is my VI with constant arrays for data simulation that way you can see what is doing now. I want to do the same thing without using so much resources. The real data will have many more data points.
09-18-2009 12:14 PM
09-18-2009 12:25 PM
Thank you altenbach
This only looks a million times better!
I can can only hope to get better and be able to make more sense of everything.
Most of my programming skills are only vb.net database programming.
Thanks all