08-01-2013 02:40 AM
Hello all!
I got a problem with my labview project, that I'm asked to make comparsion with
2 output values, both of which are inside its while loop.
To clarify this question, I have 2 data inputs, they are read in 2 while loops respectively once a time.
Now I need to extract these read values outside the while loop to make comparison. However simply
wiring the 2 outputs out to a comparison function doesn't work. From the the highlight execution function
I can see that the data never gets out from the loop!
So I'd ask if anyone got any idea, thanks!
Chao
Solved! Go to Solution.
08-01-2013 02:49 AM - edited 08-01-2013 02:50 AM
There is something called 'Messaging Techniques' to pass data among prallel loops, different parts of a code, different VIs...
You can use either Queue or LV2g and there are many other ways to transfer the data... Local variable could be easiest but not recommended as can cause RACE condition.
@jcraffael wrote:
I can see that the data never gets out from the loop!
While loop (or any other structure) will output data only after it completes execution and not in between.
08-01-2013 03:18 AM
Hey thanks a lot for your reply! But a question in detail: for the queue method, should I put a certain queue function (enqueue element function or obtain queue function) between the comparison and the output shift register of the loop? Would this realize that the local data in the while loop are compared once a time outside the loop?
thanks
Chao
08-01-2013 03:30 AM
@jcraffael wrote:
should I put a certain queue function (enqueue element function or obtain queue function)
Yes, to use queue functionality definitely you need to place those function nodes in your code.
@jcraffael wrote:
between the comparison and the output shift register of the loop?
Without seeing your code, can't say where to place the functions in your code.
Why don't you share your code and someone here will help you better.
08-01-2013 03:53 AM
08-01-2013 03:59 AM
08-01-2013 04:00 AM
God I really have no idea how to show u the code here! I could describe.
I just used the UDP read vi from labview example. i put two same blocks of UDP read while loops together just want to compare the
2 UDP data from 2 ports. I put a comparison outside the 2 loops and simply wired the 2 ouputs to it.
So I want to know if i should firstly wire the 2 outputs from 2 while loops firstly to 2 queue functions repectively and then to the comparison
08-01-2013 04:07 AM
You can directly attach VIs to the post (section "Attachments", simply browse for the file(s)).
There was a bug in the forums which might still be present: Selecting "Preview" before actually posting removed all attachements from the post.
So maybe, you want to try again.
Norbert
08-01-2013 04:15 AM
ok let me try
08-01-2013 06:49 AM
Cant see any comparision happening in your code...!!