LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing/Polling Boolean Values using TDMS Write

Highlighted

Hello all,

 

I have an issue writing boolean values to a TDMS file. I have 6 buttons on the front panel in an array. I want the boolean values of each button to be written in a column of its own using TDMS write at a frequency I specify. I've tried using a producer/consumer architecture but to no avail. I'm not sure how to proceed. The data that is written in the TDMS file is one column long and full of boolean values that doesn't make any sense.

0 Kudos
Message 1 of 9
(180 Views)
Highlighted

We don't know how to help you proceed either.

 

You are having issues with TDMS Write and how the data looks in the file.  But you attach a small screen shot of a small portion of your code consisting of just a DAQmx Write which is not in any way connected to the problem with TDMS files you describe.

0 Kudos
Message 2 of 9
(134 Views)
Highlighted

Ah sorry, didn't realize my other pictures didn't send. The picture of the DAQmx Write is my boolean controls (which are just switches) and the TDMS write is my logging function. The TDMS Write is also writing data from a DAQmx Read function. I want to add 6 more columns to that TDMS file with the position (0,1) of the switches. I also have a picture of the TDMS file (called data). In that picture I want to add 6 more columns that log my boolean values.. I hope I was able to explain clearly. 

Download All
0 Kudos
Message 3 of 9
(106 Views)
Highlighted

Your question makes absolutely no sense. TDMS write on an output operations and polling booleans is an input operation. What are the booleans you are polling and how do they relate to the write operations?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 9
(101 Views)
Highlighted

I don't see the connection between the booleans and the writing of TDMS waveforms.

 

I guess I didn't explicitly state it.  But you should send a VI so we can see the code.  You've sent more pictures, but they are just small segments of other parts of the block diagram.  With pictures, we can't run, poke at the code, look at the unseen cases of case structures, ......

0 Kudos
Message 5 of 9
(91 Views)
Highlighted

I may have explained incorrectly. I want to log the position of my buttons (which are valve controls) so that I can tell when they are ON/OFF in my data. All my data is being logged in a TDMS file and I would like my button status to also be logged in the same file. That way I can tell, while looking at the data, at what time my valves were ON/OFF. Hope that made some sense.

0 Kudos
Message 6 of 9
(89 Views)
Highlighted

Code attached. Im trying to join the DAQmx Write part to the Logging loop

0 Kudos
Message 7 of 9
(86 Views)
Highlighted

Put a small wait statement in your Digital Output loop.  No need to have that loop spin as fast as possible updating the valves.

I don't see where you are trying to send any digital data to the TDMS Write Loop.

 

I would probably put the digital output and the analog inputs into the same loop.  Combine the data there before sending on to the data logging loop through the queue.

 

I've never had a reason to send boolean values to TDMS before, so I don't know how you structure it and how it looks in the file.  You might have to experiment with that in a small program to work out the details and combine the data as needed in the acquisition loop.

0 Kudos
Message 8 of 9
(80 Views)
Highlighted

Tried for ages, I just can't seem to get it to work. The VI writes the boolean array data in one column, instead of spread across multiple columns. It's frustrating because it's writing the correct values of the array, just that it is all in one column so it's very hard to read.

0 Kudos
Message 9 of 9
(38 Views)