01-27-2016 04:32 AM
The VI i have attached is used to draw region of interests. once the cross hair is set at the position the ROI is to start, then click start recording to record the cordinates you drag the cross hair through, runnin for 100 iterations.
Draw is the VI where you draw, Sketch single is what shows each ROI, Sketch multple shows all the ROI.
What i would like to do is to record each recording session as an indexed array, so that the ROI's can be viewed later, separately.
Thanks in advance 🙂
01-27-2016 05:08 AM
If I understand correctly, a solution could be to create a custom datatype that is a cluster containing a numeric control and an array of coordinates. Then you could build an array of these clusters using the numeric controls as indeces. This array would have all your recorded ROIs.
Hope this helps,
Norbert
01-27-2016 05:26 AM
Hi Nobert,
I didn't quite get that, how do I go about creating an indexed array of cluster in the first place?
-Amit
01-27-2016 05:56 AM
Hey Amit,
This is what I meant:
Kind Regards,
Norbert
01-27-2016 09:32 AM
with what u showed, the ROI's are created within the case, and the shift registers provided to index with the while din't actually work out. I modified a lil to get that done, but now it just works continuous and not allowing me to set a start point for the next ROI like i had in the previous. Also trying to view the indexed ROI separately with index array function but the graph is not taking the output from the function as input
01-27-2016 09:58 AM
Give this a try. I added a name to your array of clusters at the shift register initialization. This allowed me to unbundle by name after the index that you care about. That unbundled array can now be plotted.
I also added a Stop Recording button, separate from the Stop button. This allows you to stop recording, but not stop the application. You still want to stop the application if the user is already recording, so I added a local variable there for the Stop button.
If you plan on improving upon this software more and adding things to it, I suggest you redo it with a better architecture. What you have now is dangerous and hard/impossible to scale.
The Simple State Machine template that ships with LabVIEW is really the best way for new developers to get familiar with LabVIEW while utilizing a semi-scalable architecture.
Here's a broad example of how a state machine works:
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-28-2016 07:37 AM
Thank you James for insisting on using the state machine way of programming.
This is my first attempt to it, and as far as I look at it, it looks much less complicated. But again I'm having trouble when it comes to viewing my indexed cursor plots. Please spend a few minutes more on this and help me out. Thanks in advance 🙂 .
1.Easy draw with cursor index is the one that I built to have multiple ROI
2.Easy_draw-C_indexed-plot_view is the one that i tried to view indexed cursor plot
01-28-2016 08:18 AM
Another possiblity is to use a Variant Attribute. Take your array of ROI points and store them as an attribute in a variant. This gives you the benefit of being able to set and get using a string name not just an index. Users like being able to name things how they want. I made a wrapper called Variant Repository to demonstrate XNodes. XNodes are experimenta, undocumented and in most cases should be avoided. Because of that I also made a non-Xnode version that works on the same idea using polymorphic VIs.
https://lavag.org/topic/18479-cr-variant-repository/#entry113363
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-28-2016 12:06 PM - edited 01-28-2016 12:11 PM
Thanks Hoovah
But I could not digest things about xnodes. Went way over my head 😞 . My bad.
I downloaded the zip file with the xnode vis but had no clue what to do with them, I went throught the crash course on xnodes that u have linked in ur post aswell.
Isn't there an easier way to just create a 2D array with the cursor index and the cursor position array from within the event so that when the next button is clicked, the array is updated with the current cursor index and the plot against it? Then using indexed array, we can easily plot the required cursor plot.
Writing to an excel sheet would also suffice, if that's an easy way of makin a 2d array with the two parameters (cursor index, cursor position array)
Please help me.
01-28-2016 12:33 PM
@amithkuttan wrote:
Isn't there an easier way to just create a 2D array with the cursor index and the cursor position array from within the event so that when the next button is clicked, the array is updated with the current cursor index and the plot against it? Then using indexed array, we can easily plot the required cursor plot.
Oh absolutely, sorry if it wasn't clear I was not suggesting you use XNodes AT ALL. I was suggesting you use the non-Xnode version of my Variant Repository which was the link I posted. It just uses Variant Attributes to write and read values in a table that uses keys and values.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord