LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use scan interface mode when collecting data from cRIO? How do I display the continuously collected data on a waveform graph?

Solved!
Go to solution

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?

0 Kudos
Message 11 of 23
(1,405 Views)

Oh and I'm using it in Scan Interface Mode...

0 Kudos
Message 12 of 23
(1,405 Views)

@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.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 13 of 23
(1,401 Views)

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..

 

 

Capture.PNG

0 Kudos
Message 14 of 23
(1,392 Views)

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.   

 

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 15 of 23
(1,386 Views)

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.

Message 16 of 23
(1,380 Views)

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.  Capture.PNG

 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. 

 Capture2.PNG

0 Kudos
Message 17 of 23
(1,375 Views)

Thanks!  That seems to work, but I still can't write the data to a file correctly.  😞

0 Kudos
Message 18 of 23
(1,372 Views)

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. 

Example_VI_BD.png

 

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?

 

 

 

--
Tim Elsey
Certified LabVIEW Architect
Message 19 of 23
(1,365 Views)

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.  

0 Kudos
Message 20 of 23
(1,362 Views)