From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with LV Real Time

You should probably generate the entire waveform, or a substantial segment of it, prior to writing it to the card.  Attach your code (best choice is to ZIP all the VIs) if you want more detailed help.

0 Kudos
Message 11 of 15
(354 Views)

hi nathand,

 

I think I've prepared my buffer with 40 bit boolean already before updating it in every T1 (time per step), otherwise I couldn't generate this wave continuously.

0 Kudos
Message 12 of 15
(350 Views)

So, if I've understood this correctly, on each iteration of the for loop you're generating 1us worth of data.  Are you confident that the for loop executes in 1us, especially with the TDMS write in it?  Try writing 1ms (or better 10ms or 100ms) of data at a time, not 1us.

 

Likely there's room for other improvement as well, but I don't have time at the moment to look through your code thoroughly.

0 Kudos
Message 13 of 15
(344 Views)

hi nathan,

 

yes, you are right, on each iteration of the loop I'm generating 1us worth data. The reason I'm doing this; I want to have fast write rate.

Hmm, now I'm not sure myself, if its really executed in 1us. I was thinking to do this because I want to generate each data in every iteration.

Now, I've been thinking, and the question is: can I use 10ms rate (to generate and write) but my data would be faster than 10ms, for example I want my data generated in every 100us, with 10ms rate means I'm generating my first 100 datas, then in the next 10 ms, I'm generating my 101st ~ 200th data. How to do that?

 

I think its like splitting my generation of 256 steps into 3 big packets.

0 Kudos
Message 14 of 15
(338 Views)

I'm unclear if you still have a question here about the waveform generation.  You'll need to change your code to generate more points at a time, but this shouldn't be too complicated.  The best approach might be to generate the entire waveform before you start writing any data, then send it to the board in whatever size chunks it can handle.  Alternatively, if the overall waveform is too large for a single named waveform on the board, split the waveform into several named waveforms and write a script that runs the waveforms in order.

0 Kudos
Message 15 of 15
(323 Views)