cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help with Loops

SOLVED
Silver_Shaper
Active Participant
Solved!

Need Help with Loops

Message contains an attachment

Hello all,

 

I am a beginner in Labview. So need help in Loops. Please check it out the attached vi and suggest me the procedure which i followed is efficient or not. If not correct me. 

 

Waiting for reply

---
Silver_Shaper | CLD
11 REPLIES 11
altenbach
Knight of NI

Re: Need Help with Loops

Have you ever wondered what would happen if you would replace the "equal TRUE" with a plain wire? Smiley Surprised

Thoric
Trusted Enthusiast

Re: Need Help with Loops

Message contains an image

For arrays, use the primitives to convert the booleans to (0,1)s then sum the array. I've modified your first loop to what I've described in the attached snapshot, you can do this for all your loops:

 

quicker.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Thoric
Trusted Enthusiast

Re: Need Help with Loops

altenback - you could always use the function depicted in my icon instead Smiley Very Happy

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Silver_Shaper
Active Participant

Re: Need Help with Loops

Thronic You Rocks.... Thanks for the fast reply

---
Silver_Shaper | CLD
Silver_Shaper
Active Participant

Re: Need Help with Loops

Thronic You Rocks.... Thanks for the fast reply

---
Silver_Shaper | CLD
altenbach
Knight of NI

Re: Need Help with Loops

Message contains a hyperlink

Not so fast. Except for the first loop, a simple "or array elements" would be all you need. Smiley Wink

altenbach
Knight of NI
Solution

Re: Need Help with Loops

Message contains an image Message contains an attachment

According to the diagram comment, the array sizes are all 16, so here's all you need: Smiley Very Happy

 

 

 

(Hmm, the snipped clips the booleans in the diagram constant, just ignore that)

 

"AND array elements" checks if all a true (top wire)

"OR array elements" checks if at least one is true. (all others)

Silver_Shaper
Active Participant

Re: Need Help with Loops

Message contains an attachment

Please check it out.

---
Silver_Shaper | CLD
Highlighted
Thoric
Trusted Enthusiast

Re: Need Help with Loops

  • Again, for each little case structure that adds 1 to the value, replace the case structure with an Add primitive, convert each conditional boolean to a (0,1) and wire it to the second terminal of the Add.
  • Move your "Shift Reg Input" and "Shift Reg Output" terminals outside the error case structure, wiring them directly for the error case, to ensure the data is not lost in the event of an error at the error in terminal
Thoric (CLA, CLED, CTD and LabVIEW Champion)