LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write text file rt module rio

good evening! I'm trying to acquire the voltage and time from a fpga vi using this rt vi.

Now I'm trying to write this data in a text file with 2 columns, 1 for the voltage amplitude and another one for the time. could someone help me please?

I'm attacching the RT vi.

0 Kudos
Message 1 of 8
(1,861 Views)

@alex8624 wrote:

I'm attacching the RT vi.


You did not attach "the RT vi", but a picture of a piece of the VI.  Please attach the actual VI, and describe what the FPGA is doing, including (a) the nature of the FIFO (what size, and what are its contents), and (b) how often data are placed in the FIFO.  You could even attach the FPGA code, or even (by compressing the folder containing it) the entire Project.

 

Bob Schor

0 Kudos
Message 2 of 8
(1,837 Views)

yes sorry, the FPGA should acquire voltage data with a time that i should be able to choose with the controller. for the rt vi I want to display the data with the graph and I would like to write them in a text file but I'm not able to do so.

I think this time I have attached the fpga and the rt vi

Download All
0 Kudos
Message 3 of 8
(1,821 Views)

Sorry, I was sloppy in my response.  But since you were so responsive, I'll be more precise.

  1. I'm assuming you are developing this in a LabVIEW RT Project.  I'm also assuming (and hoping!) that you have a Project Folder that contains the VIs and the FPGA code, along with the Project file (.lvproj).
  2. Assuming #1 is true, right-click the Project Folder and choose "Compress", which will make a .zip File of all of the contents.
  3. Attach the .zip file.  That let's me open the Project and see everything "in its place", all nicely wired together.

Bob Schor

0 Kudos
Message 4 of 8
(1,814 Views)

it should be everything there, or at least I hope what you asked me is there.. the open closed file text are not attached to anything because I dont know where to wire them.

0 Kudos
Message 5 of 8
(1,812 Views)

Thanks.  I'm not an FPGA expert, and fairly new to the RIO world, but there are some things here that I don't understand (and it's probably my lack of experience -- I'm working on a RIO project now, but my previous RT venture was with a PXI system).

 

I think you've provided enough information for someone with more experience than I could provide more comments.  But some things that puzzle me include:

  • This is the Real-Time part of a LabVIEW RT Project.  I always did the "Front-Panel stuff" like graphing the data and writing data to disk on the Host ("My Computer"), never on the RT Target (though during Development, I might save some values in an Array).
  • You may have said, but I don't know much about your sampling.  You seem to be taking in a single channel of Analog data.  What is your data rate?  How many samples/second?
  • You put your data into an FPGA FIFO, and take them off 2000 at a time (in less than 5000 ms, so you seem to be sampling at a rate of at least 400 Hz).  You then "reshape" it into a 2D Array of size 1 x 500, which throws away 75% of your data and leaves you with a 2D Array having only one row (so no need to make a 2D Array out of it).  I don't understand what you are trying to do.

Do you have colleagues who know LabVIEW with whom you can discuss this?  Maybe someone else on the Forum can provide some help ...

 

Bob Schor

0 Kudos
Message 6 of 8
(1,795 Views)

"This is the Real-Time part of a LabVIEW RT Project. I always did the "Front-Panel stuff" like graphing the data and writing data to disk on the Host ("My Computer")"

this is exactly what I thought I have done.. could you please tell me what to do different to do it, I dont know anyone that is able to use or know labview, so I cant discuss with anyone.

what I need to do is reading the voltage data with a variable frequency, decided each time, so I thought that using a controller in the fpga vi should do it.

then I need to write the data of voltage and the time in a text file.

0 Kudos
Message 7 of 8
(1,765 Views)

"When the only Tool you have is a Hammer, Every Problem looks like a Nail".

 

Start with the Problem.  Here is (my) summary, based on information that you have provided largely through "hints", but without directly stating the problem:

  • You have access to some cRIO device.  [I don't remember if you specified the device, but I'm not a cRIO expert, and don't remember "looking it up"].
  • You never specified the nature of the signal you are trying to measure, such as the voltage range you are measuring, the expected frequency of the "signal" in that voltage (is it slowly changing, like temperature or humidity, changing at some moderate rate, or changing much faster than the eye can see).
  • You have little LabVIEW experience, and don't have colleagues/students who could help.
  • You don't say if you have a budget (in time and dollars) to accomplish this.

It sounds, to me, like you have "a hammer", and may be attempting to connect two pieces of metal together with 6-32 screws and nuts -- wrong tool.

 

There are inexpensive DAQ Devices, such as the NI USB-6001, that plug into a USB port on your PC, are programmed directly in LabVIEW (not LabVIEW-RT), can sample multiple analog channels at 10 kHz or higher, and cost around $200 (you can get equivalent products from other vendors that are LabVIEW-compatible).

 

Writing a routine to collect analog signals in LabVIEW with such an instrument is fairly simple.  I recommend you do a Web Search for "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (I might have a word or two wrong in the title, but that's pretty close).

 

Assuming you have a USB-6001 (or 6002, 6008, 6009), here's the best way to get started (as outlined in the article):

  • Open your PC.
  • Plug in the Device.  Listen for the "USB sound".
  • Open MAX (LabVIEW's Measurement and Automation EXplorer), find your device under "Devices and Interfaces", open a Test Panel, and "play" with your device by configuring an Input Channel, setting sampling times, voltage range, etc., then hit "Start".  Since it's an A/D converter, try simply touching an input port and look at how the signal gets "noisy" when you do so.  For Extra Credit, explain why this happens, what the "noise" is.

Bob Schor

0 Kudos
Message 8 of 8
(1,752 Views)