LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Help for Presentation

I am assuming your problems is getting the data out of the file in the right format? Here is what I would do.

1. Read in the whole file
2. Convert to an array with a line for each element
3. Feed the whole array into a while loop
4. Divide the counter in the loop by the size of the array and use the remainder from this function to pull out an element of the array. This will let you run continuously
5. Use a string function to pull out your three numbers.

I have added code to your vi for you to look at. Use it if you can, delete it if you can't.

You can acknowledge me if you want.

Randall Pursley
Electronics Engineer
National Institutes of Health
Center for Information Technology
Division of Computational Biosciences



BTW, where does your name RODAWG come from?
Randall Pursley
0 Kudos
Message 11 of 18
(1,660 Views)
Hey Randall
Thanks for your reply and your info. I will be sure to acknowledge you. You were very helpful throughout the project.
I managed to postpone my presentation to next Monday so that gives me time to patch up final glitches.
I tried the file you sent me.

It gives me following errors.
Error 1 occurred at Scan From String (arg 1) in ReadFromFile2.vi
Possible reason(s):
LabVIEW: An input parameter is invalid.

If I click CONTINUE, I see a display that is actually the last line of data from my file (Attached).

The data then clears and I then get below error.
---
NI-488: Command requires GPIB Controller to be Controller in Charge.

Error 85 occurred at Scan From String (arg 1) in ReadFromFile2.vi
Possible reason(s):
LabVIEW: Scan failed.

Again if I click continue, I get same display that represents the last line of data.

Am not quite sure what would be wrong.
I did change the %\t to %\s in data format as I have spaces between my data.
Message 12 of 18
(1,653 Views)
Make sure your format string is actually tied to the right place. If I disconnect my format string from the function, I get the Error 85. I couldn't find a way to get Error 1.
Randall Pursley
0 Kudos
Message 13 of 18
(1,646 Views)
You have a carriage return at the end of your text file that you need to remove.
Randall Pursley
0 Kudos
Message 14 of 18
(1,645 Views)
Hey Randall
This is probably the last time I am bothering you.
I have my presentation on Monday afternoon and I hope you get this by that time.
I am simulating my results in 2 parts. One portion of it is working fine. The other one is the one I am sending a query about.

Based on what you sent me earlier on how to read a file with 3 data columns and separate them and display them, I integrated that into what I want to pursue.

I combined it with the BeatCount.vi that was also suggested by you earlier.

I am getting all the display as required. My VI is however not able to calculate the beat count and am just not able to debug that.

Can you please advice.

I have included BeatCount.vi that works perfectly if run by itself and Simulation.vi in which I have integrated the BeatCount.vi and the ReadColumsfromFile.VI in the same file attached.
0 Kudos
Message 15 of 18
(1,631 Views)
0 Kudos
Message 16 of 18
(1,626 Views)
I have attached a version that should work for you. The problem you are having is that the beatcount part is set up with a sampling rate of 20 Hz. The data in your file is sampled at a higher rate than that, probably 200 Hz. I made a change to the software so you can type in the sampling rate. The hard-wired value '50' in beatcount is 50 ms or 20 Hz. For 200 Hz sampling rate, the value should be '5' or 5 ms.

Also, you have an extra carriage return at the end of your data file that you need to delete. Just open up your file and go the the end of it and hit backspace one time and then save it again.
Randall Pursley
0 Kudos
Message 17 of 18
(1,620 Views)
I would like to thank everyone who helped me in various ways for my project , especially Lynn and Randall.
I am going to spend more time trying to master LABVIEW so I can provide the same kind of help to others.
I wish you all best of luck in your future.
Thanks alot for your support.
Message 18 of 18
(1,686 Views)