11-16-2015 09:14 AM
Ok, so here's the deal.. I am a brand new labview user and was thrown into a project and I am in way over my head for please forgive any cardinal labview sins that I have committed. What my program is basically supposed to do is continuously take light measurements of the room (which enter labview as voltage) and then covert them to lux using some formula i fouund online. It the average of the numbers is above the top parameter the a voltage signal is supposed to be sent through the AI_0 port and if it is below the low parameter then there should be voltage sent to the AI_1 port. If the vale is between the parameters, then it is supposed to keep scanning. I desperately threw the entire thing into a while loop to get the process to repeat, however I feel like this wasn't the most effective strategy. It may be better to but the whole thing in a timed loop and have it repeat every like 5 or 10 seconds (for demostration purposes) but I really don't know how to use them (I've read tutorial and still don't quite understand). And if the reading is above or below a certain parameter it throws off the next reading. For example, if the sensor see "darkness" it will be send the correct voltage signal but the very next reading will be abive the brightness parameter, no matter how much light it "sees". I don't know if this is because the loop is not clearing and the numbers are just adding or what? Please please help me because I am at a total loss for what to do next.
-forever clueless
11-16-2015 09:21 AM
Hi dawnd,
using some paragraphs would make it a lot easier to read your message…
And including all subVIs with your VI would make it easier to understand what your VI should do!
Why is there a FOR loop set to iterate just once?
Why do you create an array with just one element?
Why do you average that array containing just one elements? What is the expected result of that operation? 😄
There are several comments "Replace this subVI with your data to output" - did you do this?
You don't need a "timed loop", a simple timer would be ok.
And you don't need to open and close DAQmx tasks with each iteration…
Did you do any of the free courses for LabVIEW beginners?
Did you examine all those example VIs coming with LabVIEW?