LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run a VI in real time without a delay

Solved!
Go to solution
A stacked sequence is just really, really bad design. If you don't show some after repeated requests to do so, your problem is going to be yours to solve. Additional information would be the instrument manual.
0 Kudos
Message 11 of 25
(1,348 Views)

@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?

0 Kudos
Message 12 of 25
(1,338 Views)

We're not trying to discourage you from posting your code.  Please post so we can help you.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 25
(1,312 Views)
Solution
Accepted by topic author Yasmine90

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.

 

0 Kudos
Message 14 of 25
(1,288 Views)

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.

0 Kudos
Message 15 of 25
(1,281 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 16 of 25
(1,269 Views)

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.

 

0 Kudos
Message 17 of 25
(1,242 Views)

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.

0 Kudos
Message 18 of 25
(1,230 Views)

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. 

0 Kudos
Message 19 of 25
(1,224 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 20 of 25
(1,203 Views)