09-17-2014 11:41 AM
09-17-2014 11:53 AM
@Yasmine90 wrote:
Actually, I would like to receive the data from the instrument exactly at the same time it displays it on its own screen.
I'm using a stacked sequence, because I have two loops and I want that one runs before the other.
That can be very difficult to do. For once, do you know when the instrument is sending the data compared to displaying it?
How fast is the serial port ?
How much data does it have to transfer?
09-17-2014 06:15 PM
We're not trying to discourage you from posting your code. Please post so we can help you.
09-18-2014 04:54 AM
hello,
Here is my code. I"m always having "timeout expired before operation completed". Could you please tell me what's the cause?
Thank you.
09-18-2014 05:45 AM
I've already solved my problem, it was just a problem of a big number of bytes to read that I was assigning.
Thank you anyway.
09-18-2014 06:38 AM
In all honesty, I can't see that being the issue. Rather I would think you're not setting the termination character correctly and it reaches the end of its message and VISA sits there waiting for a termination character that never happens. It doesn't really matter what you set the byte count to if you are using the termination character, as long as it is bigger than what you plan to read.
09-18-2014 08:46 AM
I've already solved my problem, it was just a problem of a big number of bytes to read that I was assigning
So now after all the discussion you finally posted your vi.
You are not sending any bytes to port, Just reading it ???
why are you closing your visa at each iteration and setting the IO buffer everytime?????
and what problem did you solve, you were not talking about real time you were talking about how fast you can read data from serial port.
And yes what Dennis sensed again and again this is a very bad programming.
09-18-2014 09:30 AM
Yes I know but I'm novice in labview, I'm doing what I can, indeed, that's why I am posting on ni's forum! if not why would I?
I put the close Visa because otherwise it generates an error, where do you suggest that I put it?
I know the Vi shouldn't be as big as this and the programming is not that good but I don't know the good techniques, so if you really want to help give me advices instead of blames. 🙂
Best Regards.
09-18-2014 09:37 AM - edited 09-18-2014 09:39 AM
you got that wrong , i am not blaming you, i am saying you should have posted your VI at the first place with question.
you would have got lot better ideas than just let other people guessing.
Now if we can go ahead with this would you explain how actually you are communicating with instrument so that we can help you.
09-18-2014 11:04 AM - edited 09-18-2014 11:07 AM
@Yasmine90 wrote:
Yes I know but I'm novice in labview, I'm doing what I can, indeed, that's why I am posting on ni's forum! if not why would I?
I put the close Visa because otherwise it generates an error, where do you suggest that I put it?
I know the Vi shouldn't be as big as this and the programming is not that good but I don't know the good techniques, so if you really want to help give me advices instead of blames. 🙂
Best Regards.
I'm glad that you came back. You have very thick skin. 🙂
I still think it's a problem with the basic communications. When you get the VISA timeout on the read, it's waiting around for more data. Making the bytes to read smaller fixed the symptom, but not the problem and might even be causing other ones that you might not be able to figure out. Like maybe now you will get occasional bogus readings and you don't know why. Do you know what the format of the expected data is? We can start with that.