LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop Help...I think

Solved!
Go to solution
Highlighted

All,

 

I have a fairly simple VI that grabs the units of measure (send a "A") from a MARK-10 test stand and MARK-10 force gauge. I'm struggling with how, or where, I should place my While Loop. What I would like the VI to do is if the units of measure are not correct, change the units (send a "U") and retry the comparison.

 

Thanks in advance.

0 Kudos
Message 1 of 5
(1,239 Views)
Solution
Accepted by topic author BadAzzS10

Like this?

Snippet.png

Edward Motts
Certified LabVIEW Associate Developer
0 Kudos
Message 2 of 5
(1,221 Views)

That looks like it would do what you want it to do. I have two observations that may improve your design.

1. Is it guaranteed that the unit will be two bytes long at the beginning at index 7? I would recommend using the match pattern vi and if the substring is not found the offset past match will be -1.

2. The close port probably should be outside of the loop and shift registers are good too unless you want to loose any previous error details.

-Nate
0 Kudos
Message 3 of 5
(1,215 Views)

N8D11,

 

I agree that the close port should be outside the loop--you wouldn't want to close that port on the first iteration.  My mistake.

 

Ed

Edward Motts
Certified LabVIEW Associate Developer
0 Kudos
Message 4 of 5
(1,199 Views)

That did it. Thanks!

0 Kudos
Message 5 of 5
(1,170 Views)