From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data from measurement file using express VI continuously?

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 🙂

2015-06-29 22_46_33-DR.vi Block Diagram _.png

0 Kudos
Message 1 of 16
(3,977 Views)

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>   ---'


Message 2 of 16
(3,970 Views)

yes. Thanks Mr. James. So this is my file.

 

Fatin 🙂

0 Kudos
Message 3 of 16
(3,950 Views)

What happens when you remove the While loop?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 16
(3,942 Views)

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. 

0 Kudos
Message 5 of 16
(3,927 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 16
(3,911 Views)
You want to read the file just once. The data you read would be displayed in your loop.
Message 7 of 16
(3,908 Views)

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>   ---'


Message 8 of 16
(3,904 Views)

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.

0 Kudos
Message 9 of 16
(3,894 Views)

Nope. I want to read it continuosly. Is that possible in one graph?

0 Kudos
Message 10 of 16
(3,880 Views)