01-28-2018 08:13 AM - edited 01-28-2018 08:14 AM
Hello All,
I have a temperature sensor of resolution of (4*16) and am reading the values through a serial port using VISA - (The values keep refreshing very quickly). The output array values are correct but when i try to see the max and min values from the same array they are incorrect.
Could some one please help me, i have just started learning labvew.
And please excuse me if this is a dum question.
Solved! Go to Solution.
01-28-2018 10:16 AM
I see 3 problems with your code.
1. Move the VISA Conguration subVI outside of your while loop. it should be only done once at the beginning of your VI.
2. You are doing an array Max and Min on a array of strings. You need to be converting those strings to doubles. Comparisons of doubles will give you the largest and smallest. Comparison of strings will give you what is alphabetically first and alphabetically last.
3. Finally, your not accounting for the space that is coming right after the comma. Everything that is after the 1st column in your data has a space in front of it, and that is messing up the alphabetically comparison of your string versions of the numbers. A space charcter comes alphabetically before a digit character. So "{space}34.11" comes alphabetically before "33.04" and thus makes 33.04 look like the largest number. In effect, your method is really only giving your the largest number in the first column, and the smallest number in the remaining columns. Fix point #2 and this problem goes away.
Your parsing of the string into individual string elements could be handled a lot easier than that while loop you have in there now. Use Spreadsheet String to Array in the String pallet using comma as a delimiter and you'll be able turn that entire while loop of code into a single node.
01-29-2018 11:58 AM
thank you so much, will try it out like your advise/direction and keep you updated.
02-01-2018 08:30 AM
Hello RavensFan,
Thank you for your feed back the other day.
I was able to implement it and i think im getting the desired output.
Could you please take a took if this is what you asked me to change.
02-01-2018 12:55 PM
That looks good. It looks like it is working like you want now.
There is one change I would make that relates to LabVIEW style. Your boolean control, the stop button, that stops the loop doesn't have any label. All terminals on a block diagram should have their label shown. If you don't want the label on the front panel, that is fine, just change visibility of the label on the front panel, but don't do it on the block diagram because that is the primary way for someone looking at your code to know what that terminal is for. Hide the front panel, label, but don't hide the diagram label, and don't do something like delete the characters out of the label.
02-04-2018 08:14 AM
Hello RavensFan,
Thank you for all the advise and tips.
I have modified the VI and added some features including an intensity graph.
I am attaching this here so that it could help some one else or some one can improve on it, as i did not find any thing on the MLX90621 visualizer for labview on the community.
Thank You.
Atif Shariff.
02-04-2018 08:14 AM - edited 02-04-2018 08:16 AM
Hello RavensFan,
Thank you for all the advise and tips.
I have modified the VI and added some features including an intensity graph.
I am attaching this here so that it could help some one else or some one can improve on it, as i did not find any thing on the MLX90621 visualizer for labview on the community.
Thank You.
Atif Shariff.
02-04-2018 12:48 PM
I'm glad to hear it is working for you.
If I may offer 2 more tips.
1. Use block diagram cleanup. Several wires run "backwards" making them harder to follow.
2. Check your spelling of the word "temperature" on the front panel. You left out an "e".
02-05-2018 09:26 AM
WOW, did not know all this functionality. I think i like LabView even more.
Thank you again RavensFan for your patience and advise.
Attached is the corrected .vi.
Regards
Atif
02-08-2018 06:56 AM
Hello Again,
One last question im unable to output sound from the laptop if the max temp or min temperature is reached. Im using the beep function .. any advise ?
Atif