03-05-2013 02:34 AM
Hi,
I want to inspect I2C traffic. In my traffic are 5 different packets. I want to detect them and if all are detected I want to leave the VI with a TRUE. If not, I want a timeout and a FALSE as return.
Everything works, except the evaluation. Basically my VI should do the following:
Inspect DATA
{
If Condition 1 found, set bit 1
If Condition 2 found, set bit 2
If Condition 3 found, set bit 3
If Condition 4 found, set bit 4
If Condition 5 found, set bit 5
++ repetitions
}
If bit1 AND bit2 AND bit3 AND bit4 AND bit5: return TRUE
If repetitions > 100: return FALSE
repeat
My problem is: How can I set a bit and keep it set? Let's say, I find Condition 1 and set it. In the next iteration I find condition 2 and set bit 2. But, in the same iteration, Condition 1 is not to be found and so bit 1 is cleared again. So I never achieve, that all bits are set.
I hope I could make myself clear and would be happy about any solutions. I am on labview base, so no access to events.
kind regards,
Christian
Solved! Go to Solution.
03-05-2013 02:44 AM
Hi Exle,
how do you forward data from one iteration of a loop to the next?
The buzzword here is "shift register"!
So you would store your conditions with
IF (condition1 is found) OR (condition1-flag) THEN (set condition1-flag to TRUE)
03-05-2013 06:49 AM
Hi,
thanks, it's working. But it is really complicated compared to a simple "if (condition) bit0 = 1".
What are kudos for?
Christian
03-05-2013 06:55 AM - edited 03-05-2013 06:59 AM