LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to number

Solved!
Go to solution

@RavensFan wrote:
It is NOT necessary to add an additional delay in this while loop.  The VISA Read will pace itself.  You will have 10 seconds between VISA reads if no data comes in.  You'll have some unknown amount of time between VISA reads if data is comiing in.  That delay will be a function of how frequently the other device is sending data.

But dont you think after first read and before second read there should be some delay but yes you are right about your last line.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 35
(1,300 Views)

@Ranjeet_Singh wrote:

@RavensFan wrote:
It is NOT necessary to add an additional delay in this while loop.  The VISA Read will pace itself.  You will have 10 seconds between VISA reads if no data comes in.  You'll have some unknown amount of time between VISA reads if data is comiing in.  That delay will be a function of how frequently the other device is sending data.

But dont you think after first read and before second read there should be some delay but yes you are right about your last line.


No.


The delay will be there automatically.  If you put in an explicit delay that happens to be too long, then you'll run into a problem where your serial buffer will eventually fill up because you are reading the port slower than the device is sending data.  If you put in a short delay, then you might as well not even bother because the device's rate of sending data and the VISA read is what controls the pace of the loop.

0 Kudos
Message 12 of 35
(1,299 Views)

Yes true but if any sender is sending data in 5 sec then after 5th sec while loop will stop and next read starts immediately.Hence next data will come in 5th sec. hence if between two read delay is there then CPU resource will be free for atlease some ms.Isn't it

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 13 of 35
(1,296 Views)

While the VISA read is waiting for the next data to come in 5 seconds later,  the CPU WILL BE FREE to do other work.

0 Kudos
Message 14 of 35
(1,292 Views)

But control will be there if you see the highlight execution.it will wait till timeout or 4 bytes

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 15 of 35
(1,289 Views)

What does highlight execution have to do with this?

 

I don't even know what point you are trying to argue anymore.

0 Kudos
Message 16 of 35
(1,280 Views)

If you enable Highlight execution, according to my experience it will wait till timeout or 4 bytes (in this example). 

 

We actually deveiated from question..better we stop it here.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 17 of 35
(1,278 Views)

@Ranjeet_Singh wrote:

But control will be there if you see the highlight execution.it will wait till timeout or 4 bytes


As Raven said, the VISA Read will read at it's own pace.  Life goes on while it is waiting for data.  IMHO, hard-coded waits = I don't really understand how to communicate with this particular equipment.  (Usually, but not always.)

 

[edit]

Funny, I just put together a VI with parallel loops and the lightbulb on, and the other loop was looping while the VISA read was waiting...

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.
Message 18 of 35
(1,276 Views)

what is that particular equipment by the way

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 19 of 35
(1,273 Views)

@Ranjeet_Singh wrote:

what is that particular equipment by the way


Any equipment, actually - except the most dumbest equipment that won't even tell you when it is ready to receive a new command.

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 35
(1,270 Views)