LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx and TDMS not always working

Solved!
Go to solution

Hello,

 

I am new to the DAQmx and TDMS vi's and am hoping someone will be able to help me. The attached code contains several case structures, however only one of them has the DAQmx and TDMS vi's running through them. My intent is to record the voltage output from two photodetectors as I scan the current of a diode laser controller.  When I run this code it does not always record the values while I am scanning and when I quit the program the TDMS file viewer will show me no data. Sometimes, but rarely, it will show me some data. The stacked sequence within the case structure is the code that runs the laser controller and a couple of translational mounts. The DAQmx and TDMS vi's that should record the data are just next to that.

 

Thank you!

 

 

Alfredo
0 Kudos
Message 1 of 6
(2,725 Views)

I tried loading your code but I can't because you are missing several subVI's.  I would suggest zipping up all of the files and posting them.

 

Looking over your code, I can't really tell what the problem is at first glance.  I would suggest setting a break point at the TDMS Write node and putting in probes to see if 1) it ever executes and 2) if it has data when it does execute.

 

Not sure what you mean by "only one of them has the DAQmx and TDMS vi's running through them"

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 6
(2,722 Views)

I just ran the code about 5 times and it only recorded the data I was expecting once even though I changed nothing. I am attaching the code with the subvi's.

 

What I mean by "only one of them has the DAQmx and TDMS vi's running through them" is that the data is only recorded using these vi's once only one of the many case structures is activated. I'm simply pointing out that the vi's are not used anywhere else.

 

Also in the DAQmxRead vi, should I have Analog 2D DBL or Analog 1D Waveform?

 

I think the problem with the inconsistency in my code might be because I have a Stached Sequence Structure within the Case Structure where the vi's are.

 

Thank you.

Alfredo
0 Kudos
Message 3 of 6
(2,697 Views)
Also, I did place probes and data was streaming through it even when the TDMS file viewer would show me nothing. This is weird because I also have a waveform graph attached to it and it does show data, even though it is not what I expect.
Alfredo
0 Kudos
Message 4 of 6
(2,695 Views)
Solution
Accepted by topic author AlfredoT

Got it! All I had to do was move the DAQmx Start Task vi into the Case Structure.

But, I still don't know if I should have Analog 1D Waveform or Analog 2D DBL. Which should it be?

Alfredo
0 Kudos
Message 5 of 6
(2,687 Views)
Depends on what you want to save and how you might want to use the data later. A waveform data type contains timing information (t0 and dt). A 2D DBL does not.
0 Kudos
Message 6 of 6
(2,684 Views)