LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop doesn't record all data

Solved!
Go to solution

Just use this Saved for 2011

 

At least run it- and see what errors you are hiding from yourself


"Should be" isn't "Is" -Jay
Message 11 of 31
(1,480 Views)

Hi bcooke,

 

Jeff has shown all those shift registers in his post.

You still aren't able to re-code that even with a picture (snippet!) in front of you?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 31
(1,474 Views)

Jeff,

 

Thanks for that. I fixed my program so that it tells me the errors now. I am getting a timeout error after the inner loop runs once. What causes a timeout error and how can I fix that?

0 Kudos
Message 13 of 31
(1,466 Views)

A timeout error is usually due to a lack of data being received by the serial port.  Make sure your instrument is actually sending data.  Make sure your serial port settings are correct (baud rate, start/stop bits, etc.).  Make sure you are using the right port (it's stupid, but I've done it plenty of times).


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 14 of 31
(1,437 Views)

Thanks for that. The instrument is sending data because we do get some data points sent to our file. The timeout happens after the inner loop runs once (so we are getting the data point from the first time through the loop).

0 Kudos
Message 15 of 31
(1,430 Views)

Which instrument is giving your the timeout error (use highlight execution or probes to see)?  How does the instrument know when to send data?  I'm more curious about the instrument you are not sending a command to.  Is it continuously sending data?

 

The curious thing is that this happens on the second iteration of the inner loop.  This tells me that some other type of command is probably needed in order to get data from the instrument.

 

Have the inner loop only run once (wire 1 to N) and see if you get the timeout error.


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
0 Kudos
Message 16 of 31
(1,425 Views)
Go figure. What "we tested it and are sure it works" doesn't. and there is an error that is handled. Who could have guessed such a thing?

"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 31
(1,417 Views)

@JÞB wrote:
Go figure. What "we tested it and are sure it works" doesn't. and there is an error that is handled. Who could have guessed such a thing?



I also seem to recall that I said that he wasn't waiting long enough when reading the data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 18 of 31
(1,400 Views)

You know, there is really no need to be so rude about this. I told you that I am new at this. A group of us are trying to write this code for an experiment we are doing in class. None of us have background in LabView and our professor taught us nothing about it. We have to figure it all out for ourselves. I'm sure you all were like this when you first starting learning LabView as well.

 

About how I said we tested it before: we were getting data points in our file that were saying the same frequency (which seemed to show that the inner loop was taking data more than once) so it looked like it was working.

0 Kudos
Message 19 of 31
(1,393 Views)

@bcooke wrote:

You know, there is really no need to be so rude about this. I told you that I am new at this. A group of us are trying to write this code for an experiment we are doing in class. None of us have background in LabView and our professor taught us nothing about it. We have to figure it all out for ourselves. I'm sure you all were like this when you first starting learning LabView as well.

 

About how I said we tested it before: we were getting data points in our file that were saying the same frequency (which seemed to show that the inner loop was taking data more than once) so it looked like it was working.


I am sorry I was a bit blunt but you have to realize nearly everyone here is a volunteer doing this simply to help others. It gets frustrating when you offer advice to someone who then basically rejects their advice and tell them they are wrong. Rather than defending poor coding and and ignoring issues that were pointed out you could try to ask for clarification if you don't understand. People will be much more willing to help if you show a willingness to learn on your part.

 

Yes everyone starts out new, makes mistakes and needs to learn. In fact, you never stop learning. But it generally helps if you try to listen to the advice from people who are more experienced, who have made the mistakes and who are trying to help.

 

Regarding your timeout you may want to increase your timeout value. One hundred ms is pretty short. Also you shoudl add some error processing. You could test for the error and if one is present don't write anything to the file. You could also test for an empty string returned by the VISA read.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 20 of 31
(1,390 Views)