Read Waveform Data in C

Dear community,
I am looking for a way to read waveform data file with external software like C or Java.
The Data Acquisition, very simple code, is written and run in LabVIEW 2009SP1.
(see attachment)
Is an prepared header for data struct, open(), read(), close() this file format?
Anybody an idea? I didnt find anything here.
Regards,
esod
Attachments:
writeDAQ.png ‏21 KB

Hi esod,
see this:
I'm saving an array with just one waveform in it. The resulting file contains:
0000 0001 - array size (one waveform in the array)
0000 0000 D156 9847 5451 8000 0000 0000 - timestamp of first waveform
3FF0 0000 0000 0000 - dt value (1)
0000 0003 - array size of Y component
0000 0000 0000 0000  - first sample (0)
3FF0 0000 0000 0000 - 2nd sample (1)
4000 0000 0000 0000 - 3rd sample (2)
remaining stuff: the variant containing no attributes (?) in this example.
Timestamps use 128 bits in LabVIEW. Samples and dt use DBL datatype. Arrays have their size prepended as I32. Variant is a monster of it's own…
Forgot to mention in the first place: Those are internal representations of LabVIEW datatypes. They might change with each LabVIEW version (as happened to the timestamp long time ago), but I guess it is unlikely for the current waveform datatype…
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Is it possible to read scalled data in 2D Waveform (DBL) at 2M Hz Sampling rate?

    I am using PXI Real time for my acquisition.
    NI PXIe-6368
    Simultaneous X Series Data Acquisition.
    It is supporing 2MHz sampling rate; When I am reading unscaled data, there is no problem.
    But when I am reading scaled data, I am getting,
    execution get stop or 'Run Out of memory' error.
    Can you please help me on this?
    I am not able to share the code, right now. I will try to share in personal.
    Thank you,
    Yogesh Redemptor
    Regards,
    Yogesh Redemptor

    Hi Allan,
    If you provided some numbers, we may be able to nail this issue for you. Without them I will just guess.
    The error codes you reported indicate that the app is not keeping up with the incoming data. If you are sampling 4 channels at 50kS/s then the hardware is transfering 200 kS/s into its on board FIFO. Page 344 of the NI catalog indicates that the FIFO can hold 2048 samples before it over-flows. The -10846 error indicates that these over-flows are occuring. To prevent this, the app must completely empty the FIFO more frequently. Doing the math this works out to one empty operation every 10ms maximum.
    This is a rather demanding rate. This only addresses the -10846. The -10845 error is troubling. The hardware you are working with may not do the j
    ob.
    Suggestions:
    1) make sure your app is reading at least this often.
    2) slow down you Acq rate (I know, not an option)
    3) DO NOT TRUST ME! Call NI and talk to their hardware support group and ask them;
    a) "Can I do continuous acq from X channels at Y rate using a DAQCard 6024E?"
    b)If yes, "Could you point me at an example?"
    c)If no, "Can I get credit on this device toward a purchase of a device that can?"
    I hope this get you started.
    Reply to this answer if you have further inquiries,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Reading Waveform (.hws) files from Analog Waveform Editor into LabVIEW causes read errors

    Hi Gang,
    In my application, I want to create files Using the Analog Waveform Editor and then, through LavVIEW, play them out through an D/A.
    I've not been able to read the .hws file into LV.  I've tried two methods:
    Using the Read Waveform VI in the Waveform palette, yields Error -1821.
    I looked in the knowledgebase and found the article "Using the Analog Waveform Editor and HWS Files with Multifunction DAQ Devices"  That recommended using the HWS VIs that are a part of the FGEN driver.  I tried that and get an Error -21515.
    The file I want to read is quite small, only 20 samples.  Is there some limitation on .hws files or the Waveform Editor I'm not aware of?
    I've attached the file if anyone is willing to experiment. I had to change the extension from .hws to .txt to be able to attach it.
    All responses will be appreciated.
    Thanks,
    Roger
    Solved!
    Go to Solution.
    Attachments:
    Havesine.TXT ‏108 KB

    Interesting. I tried to look at your file with the low level read .hws file vi's and I too got error -21515. So I tried the NI-HWS express load.vi and it looks like it worked. I'm not familiar with the analog waveform editor...does it store using the dynamic data type? Oh I converted the dynamic data to 1d array of waveforms using the convert from dynamic data.vi.
    Using LabVIEW 2010SP1 and TestStand 4.5

  • Waveform data not displaying correctly

    Hello,
    I am having some trouble displaying some waveform data. 
    I have a DAQCard-6036E card, and I am bringing in 16 analog signals.  The task is set up through MAX, and right now is generic.  All I am reading is random noise in an attempt to see if my VI even works.  The acquisition mode is set to continuous, with a rate of 1k, and number of samples set to 100.
    The problem is that I get very intermittent data on the front panel indicators.  Only several of the indicators work, and its choppy at best.  What am I doing wrong here?  Is it a problem with my acquisition mode?   
    Thanks,
    Alex
    Attachments:
    DAQ (CompactDAQ).vi ‏39 KB
    DAQ.vi ‏137 KB
    DAQ (Air Data Computer).vi ‏35 KB

    Hi Alex,
    I just tried the your VI with the while loops deleted out of the
    subVI's and as far as I could see the indicators in the first two
    columns of the front panel were updated as expected. The other
    indicators are not wired so they will not update.  It might look like
    some of the wired indicators are not updating each time if the value
    doesn't change - ie the potential on the line is the same as the last
    read.  You might try putting a known signal on each of your test lines
    instead of using noise to test your system to verify that the voltage
    is changing each time.
    If you are still having trouble, post again.  I've attached a copy of the VI I used for test.
    Regards,
    Micaela N
    National Instruments
    Attachments:
    DAQ.zip ‏95 KB

  • Problems reading waveform files in MATLAB

    Deal all,
    I acquired signals on 2 A/D channel (using DAQ board M USB-6215) and save them into waveform file using WriteWaveformsFile.vi. But for processing (FFT, elippse fitting, sinewave fitting) I want to use these data in MATLAB. I tried some options like conwert waveform to bin file but I cannot get these data in MATLAB correctly. I also convert waveform data (or data from one waveform) using WriteToSpreadsheetFile.vi, but still I can get correctly data in MATLAB. I am not sure what I'm doing wrong. Thank you for you help on any tip. I use matlab R2009a andLabview 8.5.
    Tomaz.
    Solved!
    Go to Solution.

    Hello, I have waveform file saved and I want use these data to be read in MATLAB. I have problems to correctly save these data to file (e.g. .bin or .xls) to be available in MATLAB. I will try save data from waveform file to measurement file as you suggested. I hope this wil help. Thank you for the tip, srikrishaN.

  • Hello!!!I need to read some data from the serial port and processing these, at the same time I want to see the process that I am doing.

    I read the data without problems, and I see them using Waveform graph, the problem is that I want to see the real time stamps, but in the graph appears 2:00:00,000 and 01/01/04, so the date and the time is wrong !!
    Can I change this?
    I am thinking that the problem is that I have to adquire the data and the time stamps ( using Get date/time) and after, I have to represent both!!!
    Thanks!!!

    Hello,
    As you probably know a waveform is made of a beginning time (t0), a time difference between each value (dt) and an array of values (Y). Your problem is probably that you don't initialize t0. Use the Vi 'Waveform->Build a waveform' to initialize the time of the waveform.
    Hope this helps !
    Julien

  • MSO-X 4000 Read Waveform Timeout

    I'm having trouble using the NI instrument drivers for the Agilent MSO-X 4000 oscope. I'm trying to use the trigger on channel 2 to acquire the waveform on channel 1. Currently, I always get this error code : "VISA Read in Agilent 2000 3000 X-Series.lvlib:Wait for Acquisition Complete.vi->Agilent 2000 3000 X-Series.lvlib:Read Waveforms (Single).vi->"
    The problem comes from Read Waveform vi timing out. This does not occur if I set the trigger characteristic mode to "Auto" instead of "Normal". I've attached a screen shot of parts of the code. The top section is my initialization phase and I use the bottom section to read after the signal is setup. In both Auto and Normal mode, I get a full waveform on the oscilloscope, but obviously with it constantly triggering in Auto mode, I don't get the correct waveform. I'm completely baffled as to why this is happening. I've dug through the forums and someone recommended updating the firmware, which I did to no avail.
    Attachments:
    LabviewCode.jpg ‏77 KB

    I've figured out the problem after digging through the MSO Programming guide.
    I believe there's a programming error in the instrument driver that I downloaded from here:
    http://sine.ni.com/apps/utf8/niid_web_display.mode​l_page?p_model_id=21187
    I removed the "IG;" command from the Initiate.vi (called by Read Waveform.vi) in the MSO Instrument driver and the program works fine. The "Read Waveform.vi" is actually reading the waveform twice using two different commands. The first read (IG) clears the screen, so if the oscope is in triggered/single mode, there won't be a waveform to read for the 2nd time and therefore it will time out. If the oscope is in Auto mode, the screen is updated with data so the .vi doesn't time out, but returns garbage data

  • How do I convert an earlier numeric array in LabVIEW 5.x or earlier to a Waveform Data Type in LabVIEW 6i?

    I am trying to convert old data arrays in LabVIEW 4.x & 5.x to the new Waveform Data Type in LabVIEW 6i. Please Ref. Doc. LabVIEW 6.0 Upgrades Notes page 7-8 as a source.
    Has anyone ever tried it?

    try to use Buil Waveform VI after loading old data from files ...
    LabView Help : "Build Waveform
    Builds a waveform or modifies an existing waveform. If you do not wire an input to waveform, Build Waveform creates a new waveform based on the components you enter. If you do wire an input in waveform, the waveform is modified based on the components you specify. This function is expandable."

  • Is the sample rate half with the snd read waveform.vi?

    Hi Guys,
    I plan to use the PC soundcard for data acquiring with the standard LV "snd read waveform" vi. During programming  I found that the sample rate is the half of the adjusted value. For example when I set
      - the format to 8bit mono
      - the buffer size to 11025 byte
      - and the sample rate to 11025
    then the operation takes 2000ms. I would expect 1sec.
    Used system: LV7.0,  WinXP  SP2.
    Does anybody know the reason? I have to use 44100Hz sample rate (44100 "individual" sample per secundum) in my application.
     Thanks,     
        Tomi
    Attachments:
    Panel.jpg ‏18 KB
    Block.jpg ‏15 KB

    To be more precise, that's the time take for the below mentioned finite cycle
    SI config>> SI start>> SI read >> SI clear.
    Its this 'entire' process which takes 1997 milli Sec
    Now, what you really have to check is wheather your 'SI read' function is living up to the sampling rate you have set!
    Check that by putting your 'time elapsed' check for SI Read function alone!
    Hope this helps
    Regards
    Dev

  • Help with Multi point chart plot hile using the waveform data type..

    Currently I have two channels being transfered into the AI C-Scan block (by means of a build array) in hopes to display the outputs on a chart as well as an output file. As an outout I am using the waveform data type, as I hear this is the way to go. Problem is that I have the the Waveform chart directly connected to the waveform out put the the AI C-SCAN block but nothing is being displayed on the chart. Although the time is updated on the chart it is listed as the year 1903. I do have data these channels as the there are digital outputs for these channels. Perhaps I should use the AI CONFIG and AI READ clocks rather than this AI C-SCAN. Any ideas...

    Christian,
    Please see the Real-Time Chart shipping example for LabVIEW. This example describes how to set the base time of the chart so that the time and date are correct.
    You may want to autoscale the Y-axis as your data may be out of range of your chart and that is why nothing is seen.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Sine waveform data Compression Techniques

    Hi Engineers,
    I am looking for some techniques or algorithms to compress the Sine Wave waveform data.
    (Some of the changes I already done like DBL to SGL format and 16 bit integers )
    I can't effort the sample loss.
    Thanks and Regards
    Himanshu Goyal
    Thanks and Regards
    Himanshu Goyal | LabVIEW Engineer- Power System Automation
    Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
    It Only gets BETTER!!!

    Himanshu,
    simple mathematic for binary files:
    30 channels a 10KS/s presumably double => 30*10.000*8 Bytes/s = 2.400.000 Bytes/s (roughly 2MB/s).
    Running the application for 1 hour should result in 2MB/s*60*60 = 7.2GB.
    So the file you are getting is the most condensed version of data without lossing information.
    Loss of information will bring that down to less amount of space needed, but you have to consider which information you want to discard.
    Possible ways:
    1) Convert all data to Single: You will lose information, eventually cutting off values if the values are very big or very small. On the other hand, you cut down the space to 1/2 (3.6GB/h)
    2) Averaging: Calculate the average for several values. This is ok for good oversampling (>1000) and small numbers (<50) esp. when the signal has lots of noise. The space needed is cut down by the amount of values you build the average on. Please note that you cannot use a moving average (which is in fact a simple filtering method).
    3) Calculate a form-fit function for packages of the signal and store the parameters for the given function: Best compression, but will lose nearly all information of the waveform and introducing uncertainties by the form fit function (increasing errors). In addition to that, packages might have steps to one another since the form fit function will not result in a continuous function without steps.
    There are more methods for sure, but those are the most basic and common that i can think of.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How can I find an example about acquiring waveform data by software trigger using PXI 4070 DMM?

    Anybody could proivde an example or simliar about acquiring waveform data by software trigger using PXI 4070 DMM?
    Thanks!

    hi there
    from the NI main page go to the developer zone http://www.ni.com/devzone/dev_exchange/ex_search.h​tm. select "LabVIEW" and "Digital Multimeter (DMM)" and search for "4070". then you'll find some examples.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Dominant Waveform Data

    I am working on some ideas that hopefully some of you guys might be able to help me with.  I don't know Photoshop well but I think it may be what I need to use for this project.
    I need to be able to analyze a photo (or a portion thereof) and get the dominant waveform data.  I have been thinking that I need to work from RGB to Waveform but I am not sure that is the way to go.  I was wondering of there is a way to calculate this info from an image in Photoshop or even extract it from the code contained within an image.
    As an example, I want to take a picture and have data that says essentially there are these kinds of blues at x frequencies, these yellows at x frequencies, etc. I am not looking for mapping info at this point (though that may be helpful, too.)
    It is similar to doing an FFT analysis of an audio file. In the attachment you can see an analysis of a sound that shows all the pitch content as well as the time domain. The darker lines coreespond to dominant frequencies where the lighter ones refer to secondary ones. What I need for an image is obviously different but hopefully that helps you get the idea. I need to be able to read the data in the image and convert  the color data into the fequency spectrum. This is why I wonder if calculating the domiant waveform will be helpful.
    I have played around with the Wide Histogram from Reindeer Graphics but that does not give me the dominant waveform (nor can I calculate it from the data it presents me).
    If anyone has any thoughts on it this would be helpful. I posted this idea elsewhere but I have been rethinking it so thought it best ti repost it with the new ideas.
    Thanks.
    Mark Chambers

    I neither know what a FFT-analysis of an audio-file is nor have I tested Wide Histogram from Reindeer Graphics, but I suspect what You want may not be achievable in Photoshop or at least only with great difficulty.
    As I understand it, the histogram refers to the quantitative distribution of the pixels’ channels’ values and can not be referenced to wavelengths at all, because it does assess channel for channel and not pixel for pixel. What this means is that for example a peak in the histogram could refer to one area where all three channels are identical, therefore neutral or some areas where one/two channel/s is/are in dominance, therefore highly saturated. (see images)
    It might be possible (utilizing the icc-profile’s connection to the l*a*b-space in some way that’s beyond me) to calculate wavelength and intensity pixel by pixel, but that would necessitate some pretty fancy Scripting and might be quite time-consuming.
    Maybe someone else knows better, though.

  • How do I turn a Labview measurement file into waveform data

    How do I turn a Labview measurement file into waveform data, I have done this recreating the waveform out of an array with build waveform vi, is there another way?

    OK I am sorted, sorry for such a stupid question!!!!!

  • Timestamps on AI Read waveform

    Hello everyone.
    I am a total newbie to this board and to LabView in general.
    What I have so far is, I am reading in an Analog Input through a NI PXI-4472 card.
    This I have working nicely, even managing to write data to a file.
    I am also reading in GPS time through a ZTec zt1000pxi GPS card.
    What I am trying to do is alter the timestamp on the AI Read waveform to reflect GPS time instead of my PC system time.
    Is there any way to do this?
    I am attaching my cade so far.
    Thanks for any help.
    Attachments:
    Analog input write to file.vi ‏103 KB

    Hi NIquist,
    I appreciate your response.
    I have a few questions for you. 
    How can I get the components of the waveform from the AI Read function?  I have not been able to get the waveform out of the output by itself to feed into the Build Waveform function.
    My next question is how to convert the GPS time to a TIme Stamp that the BUild Waveform function will accept?
    When I try to tie the UTC time from the ZT1000 function to the d0 of the Build Waveform function it gives me an error telling me the source is an unsigned 32 bit real and the sink is an extended. So i put in a "To Extended" conversion node, and it then tells me the source is extended and the sink is Time Stamp and it still won't accept it.
    Any ideas for getting around this?
    Sorry for the beginner type questions, but I really havent been able to find any info on my own for using this ZT1000 card for this, or any other, type of process.
    Thanks a lot.

Maybe you are looking for

  • Can you print from the ADF with Officejet Pro 8600 (not plus) & how to print checks in correct order

    Client has Officejet Pro 8600 I(not plus) They want to print payroll checks out of QuickBooks but when they put the checks in tray 1, it pulls the check that is on the top, which happens to be the last check # in the stack.  Is there a way to print w

  • What is the matter of my plugin?

    i want to decrypt a pdf file when opened that encrypted using the aes. now i found two method: 1.replace the filesystem now i just open a normal pdf file,not encrypted. i read the sample of RplcFileSystem,and modify the MyASFileSysReadProc like this:

  • Subcontracting return/rejection process

    Hi experts, My client is using subcontracting process in one of the plant which is excisable one .Some materials (assembly) gets rejected  in quality and is to be return to subcontractor with some challan and after rework from the subcontractor, the

  • Is this pointless???

    hey guys! Im building a page and i have a lide show. I used XML code and the slide show is flash. When i preview it, it works but when I upload it to the site it doesnt work. here is were its located, click on the studio pic for the window with the f

  • Installation error : Installing CE 7.11 SP1_SDN-Preview

    Hello all, When I tried to install CE 7.11 in my system, I am getting the following error, +Connection to SAPinst refused with the following message:+ +Connection to SAPinst could not be established, see following messages.+ +Could not connect to hos