07-16-2005 05:30 PM
07-16-2005 06:01 PM
07-16-2005 09:01 PM
07-17-2005 12:06 AM
That is the problem it is not a course in labview. I wish it was so we did have direction as well as a variety of examples. It is a course but NOT in labview, there is no manual and very little instruction...it was pretty much given as here it is, now do the work, only VERY basic explainations which do not relate nor help what was asked to do. This is why I am stuck.
If someone could provide at least some guidance It would be appretiated. I am completly left in the cold on these.
07-17-2005 02:53 AM
You're right. Both programs should only take a couple of minutes.
If you are going to need to do more stuff with LV, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
If this will be your only contact with LV, we can probably help you.
As for your specific question:
#1 can be handled by placing 2 numeric controls (DBL) on the front panel and wiring them into a divide VI. 2 and 3 can be taken care of using correctly placed case structures and comparison functions.
The second one will need a couple of other functions (randon, wait, square root). In general, the functions you will need can be found in the following palletes: Structures, Numeric, Comparison, Time & Dialog. Now all you need is to find them and put them together correctly. If you click Ctrl+H (or the yellow question mark on the top right corner), you will get a floating window which will give you a short description of each function.
Like Altenbach said, this is fairly simple and is very good as a beginners exercise, so I also suggest you try it yourself.
07-17-2005 12:07 PM
07-17-2005 01:18 PM - edited 07-17-2005 01:18 PM
@bobl7777 wrote:
Before I begin, I do not understand the difference between a dbl, sgl, i16 indicator etc.
Obviously, you don't have any experience in any other programming language, so this makes it a bit more complicated for you. Datatypes are a very important programming concept, so here's a tiny primer to get you going:
There are two main ways to represent numbers in a computer: (1) Integer and (2) floating point.
Integers are always whole numbers and are great for e.g. counting. How high you can count depends how many bits are reserved for each number. In LabVIEW, you can integers with 8, 16, or 32 bits, depending how high you need to count beforre running out of bits. If you assume that all numbers are positive, you can use all bits, but if you also want negative intergers you have to sacrifice one of the bits to represent the sign. We have U8, U16, U32 (unsigned) and I8, I15, I32 (signed). The most versatile is I32, which allows whole numbers from -2147483648 to 2147483647. Ignore all the others for now. Additions, subtractions and multiplications never have rounding errors, but you might overflow.
One limitation of integer data types is the fact that they cannot represent fractional numbers or very large or small numbers. Floating point types limit the resolution but use some bits for the exponent. Depending how much precision you need, you can use SGL (32 bits), DBL (64 bits), or EXT(bits depend on the platform). SGL is pretty useless because it only gives you about 6 decimal digits of precision. DBL gives you about 15 decimal digits, better than most handheld calculators. EXT is not worth the extra memory footprint. Stick with DBL! 🙂
You need to make divisions or take the square root, thus you need to use DBL for your math. The "n: for the wait in problem 2 should however be an integer.
(There are many other data types: strings, complex numbers, etc. Have a look at Application Note 154 for details).
For the comparison, there is a comparison pallette where you have e.g. "equal" "greater than", etc. Wire two inputs and you get the answer of the comparison out. The answer is yet another datatype, a boolean shown as green wire. This is the most simple type and it can only have two states, TRUE or FALSE (no MAYBE, UNDECIDED, or anything else ;)). This you can wire to a case structure and you ge a true case and a false case where you can place the appropriate operations as needed.
LabVIEW include an example browser (help...find examples). I suggest to look at a few simple examples to get a feeling how things are done. Good luck and have fun! 🙂
Message Edited by altenbach on 07-17-2005 11:19 AM
07-22-2005 12:09 AM
Ok...So I was never able to get the baseball program to work. I turned in what I had. I wasn't sure how to set it up. What I did setup, it would not work
I got the second one working though. So how would someone do the first one? Professor will only be available one more time to collect the last homework. The wonders of spending over 1200.00 and having a professor underteach and get paid for it. It woudl have been nice to see how it actually worked.
Is there anyone that can create the darn thing for me to see how it is suppost to work. I have one last problem to do which is due next week, not sure how that will get done either since the professor won't be available for two weeks when the summer class ends.
Once again, this is not a llabview class, it's a measurments class which I'm not sure why the 3 weeks this program was introduced has any bearing on the class. Learning this program should be something that is like taking a C++ class or something. It seems one thing that I have learned about universities is that professors seem to care less about actually teaching, they are more interested in their own projects and studies.
Thanks,
Bob
07-22-2005 01:48 AM
@bobl7777 wrote:
Is there anyone that can create the darn thing for me to see how it is suppost to work.
Well, here's a literal translation of the problem (LabVIEW 7.0).
You could get fancy with event structures, etc. but this should give you an idea on how to this. Please study it! 🙂
In principle, you don't even need the while loop. Then you would need to run the VI after each entry manually.
07-22-2005 10:48 AM
I hate to point this out, but the constant value of 300 should be just 0.3. A batting average of 300 is 300 of 1000, or 30%, or 0.3.
I kind of like the program. It's a good class exercise.
Hope that this helps,
Bob