I have data from a temp and a humidity sensor that I'd like to write to a delimited file. Ideally a new line of time stamped data would be written every 10 seconds (haven't attempted the 10 second interval part yet). I'm not sure how to get the temp and humidity out of the two while loops and into a file. The attached vi is what I have so far. Please forgive me if I'm missing something fundamental. I've looked through lots of posts with example code in LabVIEW forum with no luck.
Anything specific examples that you can point me to is appreciated.
you mean that you read temp and humidity sensor at regular intrval of 10 sec. are you using analog card to take samples these sensors via fpga and then save data via RT or on pc. or they are giving data on serial port.
any how as far as my understanding you can do all this within a single while loop. you can stop the while loop when you receive the data after 10 sec interval. then save the data in a file.
if you answer my above mentioned queries then i will amend my vi accordingly. one more thing your vi is not opening in my LV 8.5 so if you give me the snaphots of your vi then it will be easy for me or save your vi as lv 8.5
this might help you, havent tested it..but you will have to modify to your needs
statemachine w elapsed timer set for 10secs, after timed out goto report out (write, read and insert into array). stop vi and write to file
i am also a new about LV, but i think there should be a while loop out of your program, you can put a timer in this, the time is 10s. the third while loop is redundant i think, you can put the time stamp into the array directly, and then output to spreadsheet. hope there will be usefull.
Thanks. I like the state machine setup. I modified your example and can see that the 'report' state is firing every 10 seconds, but it is not writing all the way out to the file. Attached screenshot shows two probes placed 1) outside the while loop and 2) outside the case. Probe 2 gets timestamp and temperatures, but probe 1 says Not Executed. Book1.xlsx