LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

showing grid lines as dashed lines


ritesh024 wrote:
I am attaching my code here .. Pl. have a look at it ..

Sorry, but you did not attach any code, just some images. Looking at the subVI, it seems exceedingly complicated for what it does (basically an unflatten operation). Please attach the real VI. For the subVI, make sure that the string control contains some typical data as default value.


ritesh024 wrote:
my device send packets of 64 bytes everytime ... if i set "bytes to read" to 128, it misses d data after abt 5 seconds .. but if i set it to 256 it runs smoothly...

You have tow different problems.

  1. A timing/buffering problem that makes you lose data.
  2. A programming problem to simulate a chart with a graph and some shift registers.

The way you juggle the 2D array in the main VI makes absolutely no sense and is extremenly inefficient because you constantly coerce data. (watch for the small red dots). You actually don't accumulate any history data in the shift register beyond the immediately previous iteration. How much history data do you want to keep?

Message 21 of 26
(1,494 Views)

Hi.

I am attaching both the VIs. Serial Read is the main VI.

 

I want to store like last 1024 bytes or may be more in the history .. tell me how to go about it ...

N i have started working on Labview just for the last 2-3 weeks .. So it would be great if you could add a bit of explanation with your solution to Help me understand better How Labview Works .. 

 

Thanks ..

Download All
0 Kudos
Message 22 of 26
(1,479 Views)
Help!!
0 Kudos
Message 23 of 26
(1,459 Views)

ritesh024,

 

Could you explain exactly what you are wanting your main while loop to do based on the data coming in.  What you want displayed on which graph and I believe you also mentioned data logging, but I do not see this in the VI.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 24 of 26
(1,426 Views)

Jared_B,

In the main VI, i am reading data coming from my device using "VISA read" function.

VISA read function returns the string containing data . I need to process this data now. i send this string to a SubVI which does the necessary processing.

After processing, the SubVI sends back the data which i plot on the graph.

 

Issues:

1) How can i use shift registers to store the data(last 1024 bytes) to look backwards in time ?

2) Using  graphs, i need to set "bytes to read" atleast to 256 to view my data without getting broken. as i need to save my data also into a file, it adds to the computation time.That might be because of the buffer problem, but i am not getting how to resolve this issue . 

 

Ritesh

 

0 Kudos
Message 25 of 26
(1,394 Views)

ritesh024,

 

For number 1 - I'd recommend just using a Chart rather than a graph, this will yield you the exact results you desire.

 

As ar as setting the bytes to read to 256, I am assuming that this is because data is coming in quicker than you are able to currently read it.  For this I'd take the previous recommendation to use producer-consumer loops, one loop to acquire your data, and the other to process and display.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 26 of 26
(1,366 Views)