LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Greater Than 10 check

Solved!
Go to solution
Highlighted

I'm trying to solve a basic question in Essick's 'Hands On Introduction to LabView' If the iteration value is > 10, then the round LED lights. I've used all the suggested icons in the questions. Still, the VI doesn't work. I'm quite new to LabView and still familiarizing myself. 

Download All
0 Kudos
Message 1 of 8
(1,107 Views)
Highlighted

Please do a Save for Previous Version and save back to LV 2017.

LV 2018 just came out a month ago and not all of us have installed it yet.

0 Kudos
Message 2 of 8
(1,102 Views)
Highlighted
Solution
Accepted by topic author dbhadra

Hi dbhadra,

 

I took a look at the VI you uploaded and there are a couple of problems.

 

Firstly, let me remind you that when working with loops, only the things inside the loop will be updated on each iteration. Since your boolean indicator is outside of the loop, it won't be updated with each iteration!

 

Further, check where the values you're setting go - the "Highlight Execution" mode (little lightbulb on the toolbar of the Block Diagram, near the left) is helpful for this.

 

As a final consideration, when you use a Select node with "True" and "False" constants wired to the True and False sides, what will the output be? If this isn't straightforward to answer, write out a "truth table" with inputs (i.e. the selector value) and outputs (the right side of the Select node) and see if you can consider a simpler method.

 

There are some (unfortunately crucial) flaws in your program as it stands, but hopefully with the Highlight Execution turned on you can see what's going on and make progress.

 

Spoiler
Someone left that particular book on my desk a couple of weeks ago and I wasn't in awe of the table of contents - its ordering is a little odd in my opinion and the preference for Express functions and the Mathscript node before Case Structures seems a bit off for a graphical programming language...

RavensFan (and others) : I've uploaded below a backsaved version for 2013 in case you or others want to further comment.


GCentral
Message 3 of 8
(1,062 Views)
Highlighted

@dbhadra wrote:

 If the iteration value is > 10, then the round LED lights.


+ The LED should be inside the loop, or it will get the last value only when the loop stops.

+ You're doing a >= (greater or equal) compare, not a > (greater).

+ The selector "If true, return true, if false return false is completely redundant.  In c, "bool ? true : false" is the same as "bool".

+ You'd need to turn highlighting on, or put a wait in the loop to see the effect.

Message 4 of 8
(1,053 Views)
Highlighted

Hi Wiebe,

 

I think actually the way it was (not) wired (I didn't check the 2013 version I saved and uploaded, but I assume it was the same) the LED will never change value.

 

On the subject of last iterations or when the loop stops, it also won't do that with the current setup...

snippet.png

 

(Uploaded as a snippet for ease of reading for other readers)


GCentral
0 Kudos
Message 5 of 8
(1,042 Views)
Highlighted

Thanks for backsaving that Christian.

 

When I see someone who hasn't grasped the basic concepts of LabVIEW yet, that is when I post this link.

I would recommend you learn more about LabVIEW from here. How to Learn LV

 

Going through the online tutorials will teach a lot more than a book that highlights Express VI's.

0 Kudos
Message 6 of 8
(1,036 Views)
Highlighted

dbhadra,

 

Although I know nothing about your situation with regards to online training access or the reason you have this book, I'd take a random guess in the dark and suggest you might be a student with the book assigned to a course you're taking.

 

If your institution has the Academic Site License (ASL) and therefore access to the online training (via My Account (not forum, but NI Account)), it's definitely worth taking a look through.

 

For me, when I started I'd already been using C++ for some short time, so a few concepts felt a bit slow when being introduced (always a risk with video lectures/courses) but it's a great source of information in a structured manner, delivered in a way that prioritizes modern LabVIEW practices. The book you're using isn't particularly old - I think the copy I had marked a copyright statement for 2013, which surprised me, but I'd definitely suggest Core 1+2 over that book.

 

I suspect that in your case, if I'm correct about you being a student, you don't have a choice in the book, but I'd still recommend the online courses in addition to the book that you're working through. If you don't have access to the online training, the link that Bill (RavensFan) posted is a good substitute (and if you dislike videos, it's possibly better).

 

 


GCentral
0 Kudos
Message 7 of 8
(1,019 Views)
Highlighted

@cbutcher wrote:

Hi Wiebe,

 

I think actually the way it was (not) wired (I didn't check the 2013 version I saved and uploaded, but I assume it was the same) the LED will never change value.

 

On the subject of last iterations or when the loop stops, it also won't do that with the current setup...


Yes, it was not a comprehensive list.

0 Kudos
Message 8 of 8
(1,008 Views)