06-29-2015 09:48 AM
Hye there, i have been asked by my lecturer to read the data from measurement file which the format is .lvm. However when i run the simulation, the data given out is not continuosly. It's just a simple block diagram i used. When i put while loop it just come out as an error after a while. here is the screenshot of my work. Btw, im sorry. Im newbie here,making effort for my final year project.
Do help me brothers and sisters.
Fatin 🙂
06-29-2015 10:00 AM - edited 06-29-2015 10:04 AM
If you would, including a snippet of the code instead of a screenshot would allow us to see how your express VI is configured.
I believe you can't read from the same file more than once within a single run of the code (using the express VI). So you putting that in a While loop is causing the error in the second iteration. There is a pointer that the code keeps to know where it should read data from. When it loops the first time, it reads the entire file and then leaves the pointer at the end of the file. When it loops again, the pointer is at the end of the file and can't see any more data to read. You should only need to run this express VI once, anyways, because it will output all of the data from the file the first loop.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-29-2015 10:20 AM
yes. Thanks Mr. James. So this is my file.
Fatin 🙂
06-29-2015 10:27 AM
What happens when you remove the While loop?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-29-2015 10:32 AM
It's do run but not continuosly. I have tried with for loop also got error. I have 100 data. The waveform signal stop at 100. My lecturer want it can be pause, start and stop, means continuosly running.
06-29-2015 10:48 AM
What are you supposed to do when the end of the file is reached? What's wrong with just reading all of the data at once and display it on yoru graph? I see no need for a loop right now unless there is a requirement you have not clarified.
06-29-2015 10:49 AM
06-29-2015 10:51 AM
The file you're reading from has a set amount of data. That Read from File express VI is reading all of the data from file and then closing the file, so you only need to do this once at the beginning and then take the data from there. When I say get rid of the while loop, I mean get rid of the loop all together and don't put a For loop. What does the data output look like with no loop around the express VI?
It's unclear what your lecturer is trying to get you to do and all we can do here is help you with what you have shared.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-29-2015 10:58 AM
Thanks Mr. James, okay when there is no loop it run smoothly no error come out. It just that i want it to be continuosly read the data from 0-100 and then again 0-100 and again and again in one graph. Is that possible? That's why i think i need to use while loop or for loop but it turn out like impossible. it's may be my mistake from not understandin the basic.
06-29-2015 11:01 AM
Nope. I want to read it continuosly. Is that possible in one graph?