LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you string integers together?

I have the task of creating a program that will give you the resistance in ohms based on the color bands on the resistor. (This is a problem for a Labview course I am taking)Smiley Wink
I know this program could be done a lot more efficiently but I am still a beginner. My real question is kinda hard to explain and probably has a very easy solution. I have 3 case structures all are controlled by string controls. The resistance should appear in an indicator based on the color band colors. If there is a wrong color or mistyped color a led lights up. My question is How do you put the first 2 color bands together without using a mathematical function. For example if you have blue-grey-red your resistance is 6800 so the blue is 6 the grey is 8 and the red is x100.  How do you get the 6 and the 8 together to make 68? I am also going to upload what I have so far so you can see how elementary this really is. Smiley Sad
I have worked on it for 2 days now and cant get it right!!
0 Kudos
Message 1 of 4
(2,727 Views)

Why don't you want to use a math function? All it would take is a single multiply on the output of each case statement and that's hardly advanced math. Smiley Wink Since you have constants in the case statements, you could also just place the correct value constant in there.

For sake of argument, if you want to avoid basic math, then convert to strings, concantanate, and then convert back to numeric.

p.s Your use of the OR function makes absolutely no sense at all. There is a distinct difference between an OR and a numerical ADD.

0 Kudos
Message 2 of 4
(2,719 Views)
Multiply 6 times 10 and add 8!  Then multiply by the mutliplier.Smiley Wink
 
You may want to turn your string controls into Enums that way the colors can be selectable from a list and you won't have to worry about someone misspelling a word.
(Gray vs. Grey could be a source of problem.)  Another possibility would be a text ring control so that you can get the value stored with the color name as well.
 
Another cool thing you can do is use color boxes to recreate the actual color pattern on the display.


Message Edited by Ravens Fan on 02-20-2008 07:27 PM
0 Kudos
Message 3 of 4
(2,716 Views)
Man do I feel like a dummy!!Smiley Surprised lol This is part of a lab in class and I always struggle with the simple stuff. The or function is only there to turn the light on if someone puts in a wrong color. I know that it could be done better and probably easier but this is just where we are in class.


Thanks for the quick replies and help I really appreciate it!!
0 Kudos
Message 4 of 4
(2,713 Views)