LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The Solution of An Example from A Labview 4.0 Book

I have a "LabVIEW for Everyone - Graphical Programming Made Even Easier" published in 1997 and am learning from it since I am a beginner.  There is an activity (6.7, calculator) on P.177 without instruction, and I cannot figure it out.  Does anyone know the answer for that (screen shot is appreciated)?  Thanks!

 

FYI, I am using LabVIEW 5.0 on Windows 98.

 

Bobby

0 Kudos
Message 1 of 9
(3,721 Views)
That's Gary Johnson's book right? In any case, I don't have a copy of the book anymore. What is the example trying to do?
Also please be aware that V5 is a very old version that lacks many many enhancements for doing things like interacting with user interfaces. I would be good if you could upgrade to at least V6.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(3,708 Views)

It's actually by Lisa Wells & Jeffrey Travis.  The problem is to use two digital controls and one digital indicator to make a calculator with a slide bar which contains A+B, A-B, A*B, and A/B options on it.  I got all the items on the front panel, but could not figure out how to hook up the back one.  I have attached a pic of the figure from the book.

 

I do have LabVIEW2010 but the hardware, so I have to stick with the grandpa one unless there is a free donation or huge dicount (say 90%off) for my advisor to agree the purchase.

 

Thanks for the help,

Bobby

0 Kudos
Message 3 of 9
(3,675 Views)

Bobby,

 

I do not understand your comment about the hardware with LV 2010.  For a program like the calculator you do not need any hardware.

 

Since you are trying to learn LV, I will give you some suggestions and let you work on it.

 

First, go through the on-line tutorials.  They are a good way to get started with LabVIEW.

 

Second, while programming, always keep the Context Help window visible.  It will tell you what you are looking at and how it works or give you a link to more detailed help. I know Context Help was in LV 5 and I think the links to detailed help were also.  I think LV 5 also had on of the last printed manuals (actually a set of books).  If you have those, they are full of extremely useful information.

 

Now, to the porblem you are working on.... The "back" panel is called a Block Diagram. The block diagram is the actual LV program.  The palettes contain all of the pre-defined functions which come with LV (and can give you access to the ones you write yourself).  The Numeric palette will give you all the functions you need to do the calcuations.  The Programming >> Structures palette ( I do not recall how it was labeled in LV5) will give you the parts you need to control and organize your program.

 

NI gives substantial discounts to educational institutions.  Check to see whether you qualify.

 

Lynn

0 Kudos
Message 4 of 9
(3,669 Views)

Lynn,

 

Thanks for the comments.  However, there is always someone in need w/o the ability to solve/improve/change the situation even though he or she really wants to do so.  I am qualified for the school discount, but even with that my advisor does NOT have enough funding for a proper DAQ.  The reason I have to use LabVIEW 5.0 is because I need to use it for engine control since I do not have any upper-level DAQ from NI (too much $$$).  My USB-6009 won't do the job.

 

The things I have are the leftovers from the last century, so there is no book for me as a reference besides the one I mentioned.  I have to look around and try to figure out stuff with new tutorials, such as 3-hr and 6-hr ones for v8 that I have gone through, or with old stuff which some people from NI even have hard time to figure out,  I am not a computer guy, so any kind of programming is Latin to me.  Nevertheless, I still want to and have to learn it asap so that I have gone thru many tutorials.  Again, it is really hard for me to understand by self-teaching, yet NI's programs aren't practically cheap.  

 

As for the context help or so, LabVIEW 5.0 does have it, but there is no explanation for the specific icon as the slide bar in my pic.  That's why I came here to ask for help.

 

Bobby

0 Kudos
Message 5 of 9
(3,664 Views)

As the text says, it is a slide control. You should be able to easily find it on the controls palette. Since you have a new version of LabVIEW, you can also easily use that help to get details on it. You want to use text labels for it and I know for a fact that there is an explanation of that in the newer help. There may even be an explanation of that in the 5.0 help.

 

Once you have made the text labels, I would suggest you change the datatype of it to an integer. Then you can wire it directly to a case statement.

0 Kudos
Message 6 of 9
(3,641 Views)

Hi Dennis,

 

I know how to pull out all the icons, but I cannot figure out how to build the block diagram.  I will try the method you mentioned to change the datatype.  Thanks.

 

Bobby

0 Kudos
Message 7 of 9
(3,631 Views)

Bobby,

 

I am curious about the engine control.  How are you controlling that with LV 5? What kind of old DAQ device do you have?  What computer OS works with the devices? What kind of engine? Do you have any documentation on the engine and its controller?

 

Some very good programmers started out as chemists or mechanical engineers and never took a computer science class.  At the most basic level programming is simply telling that extremely logical device, the computer, what to do.  All you need to do is to think logically and tell the computer exactly what you want it to do.

 

You do need to learn the language (LabVIEW in this case) and the tools it provides. It sounds like you are trying to take useful steps in that direction.

 

Plan or design your programs.  Even little ones like the calculator.  Make a list of tasks the program must perform.  For each task define what inputs it needs and what outputs it produces.  Then describe the algorithm, formula, or procedure it will use to generate the desired outputs from the given inputs.  Last, you write the code to implement your design.

 

A method like this will work for programs like the calculator and can be expanded to very large, complex measurement and control systems.

 

Try some things.  When you get stuck, post what you have along with a description of what does not work.  The more specific your descriptions, the better the help you will get.

 

We are here to help you learn.  Most of us are volunteers so you may not always get an immediate response.

 

Lynn

0 Kudos
Message 8 of 9
(3,630 Views)

Lynn,

 

The person who built the VI long time ago used LV5 to acquire TDC, crank angle degree (CAD), in-cylinder pressure, intake pressure, and O2% signals, and to control injection timing and spark timing with AT-MIO-16E-2 and PC-TIO-10.  The OS is windows 98 and there is no engine controller since it is a single cylinder research engine.  The VI is the controller, but there is no documentation from the designer.  For now I could just run it, but the system is too old (I am still using 3.5" disks!!!) and my advisor wants to modify the program to do expand the control capability.  

 

I understand the learning process for a no-cs background person, but it has been difficult to me personally even though everyone I have spoken to said the same thing.  Besides, my situation does not allow me to sit down and concentrate on the program.  It's more like you do not know how many letters there are in Russian but you have to write an essay or thesis in it.  Not only is the software a troule, but the hardware part is also a puzzle to me.  Anyways, I really appreciate all the efforts from everyone on this website, and I will try my best to figure it out.

 

Thanks a lot,

Bobby

0 Kudos
Message 9 of 9
(3,620 Views)