LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Complex Data from 2D Array into tdms file

Dear all,

 

I need to save 2D array that consist of complex number into tdms file. Later, I want to analyze the tdms file on matlab to make sure about the result from LabVIEW.

The variable that i need to analyzed include on the loop function. It is the data from continous-arrived signal. Last time I try to saved, the result of tdms file only have "0" (zeros) value.. even though my algorithm can processed the arrived signal.

 

I failed to attached the vi that i had worked (oh my.. 😞 ). From that vi, i need to saving "m" variable.

Capture.JPG

Is anyone out there can help me, please..

 

0 Kudos
Message 1 of 6
(3,595 Views)

I guess you use Firefox? Try Explorer or Google Chrome to attach your VI.

If we cannot see your VI which includes the TDMS functions, we cannot help...

0 Kudos
Message 2 of 6
(3,569 Views)

I attached 2 vi, 1 vi for simulation and another for implemented on USRP.

Actually I need real time measurement.. but it'll to troublesome if every code that I changed, I should configured on USRP.. so I build the simulation vi too.

0 Kudos
Message 3 of 6
(3,556 Views)

I only checked the file "Dir_Finding_Beamforming_ESPRIT_MVDR_w Saving File_v4.vi ".

The Front panel and also the block diagram is gigantic, what kind of monster monitor you have? Your code have many problems and bad design, but I do not have the time to list everything here.

One of the main problem with your code is that, you use the data Queue in a wrong way.

 

In your middle while loop ("Fetch the data into frames and put it in the queue") you Enqueue elements into the Queue. However, you Dequeue these elements in both the top and the bottom while loops. Whichever loop "wins", that loop will Enqueue Dequeue the data elemet, and this element will be removed from the Queue. So the other loop will lose this data. So this is a big problem.

 

Also why do you try to Release the same Queue twice at the end of the VI? Using the "Stop" Abort Execution function pretty brutal and not a proper way to stop VI execution.

 

I really advice you to do some more learning, like taking the online courses Core 1-2 (3).

 

A possible fix for the Queue could be using two Queues: one for the Data logging, another for the top while loop...

 

edit: or just combine the top and bottom loops into one single loop, so you can use a single Queue with a single Dequeue in the VI...

0 Kudos
Message 4 of 6
(3,545 Views)

The original code belongs to Angle of Arrival Detection with NI USRP

I had changing only the mathscript algorithm to fit my own algorithm and added saving algorithm to get received data signal (but, I failed)

I attached original vi from NI-comm

 

About using the same queue twice.. do you meant queue on the Rx-saving-data block ? somebody on labview-experience told me about using independant queue for saving tdms.. so, I implemented it like that 

 

I don't know about the bad code.. This is my first project with labview and I though, when I can run the code well enough, that's just what the code supposed to be.

Actually, until this second, I can't get correct result from the measurements and I though the error comes from my side.

 

Back to saving data,

Blokk.. can you suggested any solution ?

0 Kudos
Message 5 of 6
(3,515 Views)

The original code belongs to Angle of Arrival Detection with NI USRP

I had changing only the mathscript algorithm to fit my own algorithm and added saving algorithm to get received data signal (but, I failed)

I attached original vi from NI-comm

 

This VI which you attached is not from NI, but from just someone posted on the community site. It has also some silly things in the code (like releasing twice the Queue), but at least only one single Dequeue, not two Dequeue functions like in your VI.

 

About using the same queue twice.. do you meant queue on the Rx-saving-data block ? somebody on labview-experience told me about using independant queue for saving tdms.. so, I implemented it like that 

 

 If you do not understand how a Queue works, you should learn more programming, or hire someone who can do the work for you. In your VI which I talked about, you Dequeue at two different positions in your code. This is the problem (one of them).

 

This is my first project with labview and I though, when I can run the code well enough, that's just what the code supposed to be.

If I build a car with brakes which work "well enough", would you take it to the motorway?

 

Sorry, right now I do not have time, but as I said you have to eliminate the double Dequeue-ing...

 

Here you can find resources to learn LabVIEW:

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

 

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

 

0 Kudos
Message 6 of 6
(3,507 Views)