LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert number to letter for grade

Hi everoyne, I need to make a simple program grading the score. But the formula node doesn't work...I think I need to find a way to convert the numbers to the letters...

 

Here's what I did so far.

0 Kudos
Message 1 of 7
(4,470 Views)

Thanks for taking a stab at it before coming to the forums. That really gives us a better idea of what you're trying to accomplish and shows you're trying. Smiley Happy

 

It looks like you need to take some tutorials on LabVIEW in general. You're mixing up datatypes, which are the basic, underlying functionality of the code. How would you store a value of "A" in to a numerical output "y"? You could make this work if you used numeric values output and then converted to alphabet values yourself, but that's really a rube goldberg way to do this.

 

You also reaaaally don't need the formula node. Just use the built-in LabVIEW comparison nodes to get your solution. There is a node called Greater Than or Equal, and a Select node that will output a value based on the boolean input. You could also use a Case Structure instead of Select, since it looks like you'll have more than one scenario.

 

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 7
(4,459 Views)

Thanks for your prompt response...

 

I know that I need to understand the basic function....I am working on it...

 

The case structure and fomular node are required to construct the grade VI...

That's way I am struggling to built the grade vi under the condition...

 

The y="A"  seems like doesn't work...I need to find out another way to put the letter output...

0 Kudos
Message 3 of 7
(4,449 Views)

So you're saying your requirement is to make this code using a formula node? That's kinda bypassing the functionality of LabVIEW by going through a text-based solution... And it's a roundabout solution because you can't work with strings.

 

Like I said above, you can't output "A", a string, to a numerical output. All formula node inputs and outputs are double precision numerics. You could output 1, 2, 3, 4, 5, ... if you want and then convert the value to the corresponding letter after the formula node.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 7
(4,426 Views)

@hanlsok77 wrote:

 

The case structure and fomular node are required to construct the grade VI...


If there are specific requirements it is important to list them all. Nobody here want's to deal with a problem that is poorly defined. Please show us the entire problem description verbatim!

 

  • What kind of course is this?
  • LabVIEW has a front panel, so why would you need three (!) popup windows?? None are needed!
  • What is the calibration curve that relates the score to the grade?
  • Your formula node requirements are just silly. Tell this to your teacher! (It's like asking to build a car using only wooden sticks and a tub of glue. :D)
  • If this is really a LabVIEW course, you should NOT start out learning about the formula node. That should come much later (or never!). I have written several large programs that are used all over the world and none of them contain even a single formula node. The formula node distracts from much more important topics such as dataflow.

Also remember that your teacher also reads these forum posts, so come here to learn, not plagiarize a solution without learning anything.

 

We are willing to help you learn, Just tell us your thought process that led to the partial solution attempt and what is preventing you to proceed. Be specific. Often thinking about it this way will help you arrive at a solution on your own. Just try!

Message 5 of 7
(4,407 Views)

Thanks for your help..

I was stuck with the idea that It should be get letter output  in the fomula node...

Now I found  another way....^^ 

Message 6 of 7
(4,379 Views)
Is the "the idea that it should be get letter output in the formula node" a requirement? Like I said, you can't output a string, so you would need to output the letter as a numeric and then convert.

If you've found another way, please share it here so that others can benefit from your post if they have the same question.

Also, once the problem is solved, please mark the most relevant solution and give Kudos where help was given. Marked Solutions and Kudos make the NI Forum go round 🙂

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 7
(4,329 Views)