01-24-2013 02:46 PM - edited 01-24-2013 02:48 PM
Just use this Saved for 2011
At least run it- and see what errors you are hiding from yourself
01-24-2013 02:48 PM
01-24-2013 03:36 PM
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?
01-24-2013 06:16 PM
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).
01-24-2013 08:29 PM
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).
01-25-2013 07:29 AM - edited 01-25-2013 07:30 AM
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.
01-25-2013 08:06 AM
01-25-2013 10:27 AM
@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.
01-25-2013 10:38 AM
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.
01-25-2013 10:47 AM - edited 01-25-2013 10:48 AM
@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.