03-26-2013 05:05 PM
Yes, but the wire connecting to data I acquire with cRIO and the TDMS vi data is broken. I am using NI 9023 device, so I just dragged one of the ports (AI0 MOD for instance) into the block diagram, which generated an orange (meaning floating number) indicator/control looking icon on the block diagram. And that's what I have trouble connecting the TDMS vi data port to... I hope this makes sense. Do you know why the wire is broken?
03-26-2013 05:06 PM
Oh and I'm using it in Scan Interface Mode...
03-26-2013 05:10 PM
@gleekd wrote:
Yes, but the wire connecting to data I acquire with cRIO and the TDMS vi data is broken. I am using NI 9023 device, so I just dragged one of the ports (AI0 MOD for instance) into the block diagram, which generated an orange (meaning floating number) indicator/control looking icon on the block diagram. And that's what I have trouble connecting the TDMS vi data port to... I hope this makes sense. Do you know why the wire is broken?
What does the Error List say is the problem? Could you attach some code? There are some things that aren't compatible with RT, but I would be surprised if TDMS is on that list.
03-26-2013 08:27 PM
I've attached the testing code below (I borrowed the example from LabVIEW). I have both the write to measurement file vi and TDMS vi in the code just to see which one works. The write to measurement file vi does not actually produce a file at all, at least the file cannot be found at the location specified in the property window. The TDMS connection has a broken wire..
03-26-2013 08:48 PM - edited 03-26-2013 08:56 PM
The help file for TDMS Write indicates that Data should be an Array of numerics, not a scalar, as you have wired there. There's a few ways to go about doing that, but without knowing more of the scope of your problem it's hard to suggest one.
03-26-2013 08:53 PM
TDMS Write supports writing data of 1D/2D array. If you intends to log a single data to your channel, you can wire your data into "Build Array" first instead of directly into TDMS Write.
03-26-2013 09:13 PM
OK, so the image I attached is what I did with a single carrier chassis. This program allowed me to use the difference between the neighboring locations to figure out the frequencies at which the peaks occur. I can write the locations out to a measurement file on the PC to post process the data. In reality, I need to use a standalone device (cRIO) to acquire data in real time, and I was hoping that I could duplicate or at least do something similar to what I did with the single carrier chassis (NI USB-9162). However, the problem is that I cannot use DAQ assistant for the cRIO, and I cannot use write to measurement file vi to write the data to the cRIO's internal memory. If I want to use any data acquired from the cRIO, I have to drag AI0 from Module 1 from the Chassis (like this one) to the block diagram, and that's where the orange variable is from.
But that is only one data point, and I am really interested bundling the data, or collecting the data all together, before I can write them to a file in cRIO. Since write to measurement file vi doesn't work for me (which I don't know why), I decided to use write TDMS, but that still doesn't work for some reason... I'm sorry if this sounds confusing, but I hope you can see what I'm trying to do.
03-26-2013 09:20 PM
Thanks! That seems to work, but I still can't write the data to a file correctly. 😞
03-26-2013 10:00 PM
If the data taking is intended to be finite, you can simply index the data at the tunnel and use tdms Write (or any other file write) directly, like so.
If you constantly and indefinitely want to log data to a file there, as usual, are many different ways to do it. The preferred way, so that you don't limit execution speed of your acquisition loop, is to pass the data to a separate loop and log the data there.
I don't see any reason the Write to Measurement File shouldn't work in that instance, but my guess is you just have a bad file path. Obviously, it's hard to say for sure without having actual code, and only a screenshot. Try using a constant to set the File instead of being prompted. Are you getting any errors from the error out on the Write to Measurement File?
03-26-2013 10:46 PM
When I use write to measurement file though, I didn't have to create a path necessarily because I think that I can set it in the property window, but perhaps that only works if it's on a PC? I didn't get any error message though. Everything worked with the single carrier, but with the cRIO the program ran, but no data file was created even though I specified the path in the property window to be on Desktop, for instance.