06-01-2017 08:49 AM
Hi
I am working on a project of sand plant in which image is acquired from the plant and is matched to the one in the computer using vision in labview.
I am not able to transfer the data from one while loop to other. I have attached the image below in which i want to transfer the data from "Data read 1" block to "vi to display" block in other while loop . How can i do that?
06-01-2017 09:03 AM - edited 06-01-2017 09:07 AM
Please, if you are going to attach a screenshot of your code, don't use your phone to take a picture. There are screen capture programs that are much better suited for such a task. Even better is to create a snippet so that your code can be embedded into the picture. A quick Google search will reveal how to do it.
For your question, a user generated event would work if you want to send the data into the loop with the event structure. Also a queue will allow you to send data throughout your code. If you have Labview 2016 or higher, there is a new feature for sharing data between loops, although I'm not familiar with it, nor do I even remember what it's called.
06-01-2017 09:05 AM
Hello,
it is difficult to read your picture (bad quality).
Thus, one can see that you have several loops in your program.
Which one you would like to communicate to which one?
Marking them for example as Loop 1, 2, 3… would bring more precision.
I would suggest you to upload your VI for more assistance.
06-01-2017 10:58 AM
aputman wrote: If you have Labview 2016 or higher, there is a new feature for sharing data between loops, although I'm not familiar with it, nor do I even remember what it's called.
Channels. I can see where they will be useful, I just have not ran into the situation yet since the release of LabVIEW 2016. So I will bow out as far as any advice on them.
06-03-2017 06:34 PM
@crossrulz, I'm only familiar with one person ever using them myself. In this case, I think user events or queues would be the best suggestion. Channel wires give 4 selections as to what they are on both the reader and writer which could cause issues in knowing what to select. Although this brings up a good question, do you want to:
1. Just see the most recent value? - Local variable/Notifier
2. Trigger the comparison upon receipt of the new image? Notifier (depending on rate)/User Event
3. Track many images from the device with the PC? Queue
The recommendation depends on which loop communicates with which and also the desired behaviour. Side note: there should be a button on your keyboard called "Print Screen" for actually showing us your screen, it's also best practice to note numbers to each loop (usually also a description). You could then say, loop 1 should communicate with loop 2 and we can correspond that to the notes - subdiagram labels would be best.
At this stage, I would recommend if you have an active license, go to your NI profile -> Online Training and look at Core 2, lesson 2 onwards. Lesson 2 is communicating between different loops, it discusses both queues and notifiers. Although not generally user events, that's Core 3 and only available to LabVIEW Full or higher users with an active license.
Best regards,
Ed