Strain measurment and write to file with NI9237

Hopefully this lab view VI can help some of the novices like myself to acquire strain using the NI9237 and write to a file.  The example VI available from NI "Cont Acq Strain Samples (with calibration)" is fine for sampling data and viewing on a chart, but you need to add your own elements if you want to logg data or write to a file.
Since aquistion is continuous, reading and writing data must be done at discrete intervals rather than continuously, or, you will end up with a very large file that can not be easily handles in excel. Also, data gets acquired in "packets" of several samples for each channel, so even if you put a write function within a case structre, as I have done ,and you don't convert the data you get that whole "packet" every time the comand writes to file. Again, you will end up with a lot more data points than you would like.
Though the top level VI is pretty simple, it took me some time and help from many folks for me to figure out what was going on.  I thought I would share.
Thanks to Sandra T, Jarrod B, Kyle B, Marc A, Herbert E and Jesse O. for your help
Next goal is to acquire voltage from a different Daq card, convert to load and graph and write load vs. displacement.
hopefully the attached files are the correct method so the VI fuctions with its sub-VI's.  If not let me know.
Regards,
Alfonso
A. Lopez
Attachments:
Cont Acq Strain-Qbridge-I-write to file-NI9237.vi ‏199 KB
Measure Strain.llb ‏238 KB

Alfonso,
I'm glad you got your application running.  It is also nice that you are wanting to share your code.  NI is currently testing a new system that allows community members to share code.  If you like, you can also submit your code here.
Regards,
Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D

Similar Messages

  • I write digital port by 'DAQmx Configure Logging.vi​' and receive TDMS file with 8 boolean channels. How can I write to 1 integer channel?

    Hello!
    I want to write 1 digital port from PXI-6536 with streaming to TDMS file.
    I'm writing by 'DAQmx Configure Logging.vi' and become TDMS file with 8 boolean channels.
    How can I write to 1integer channel?
    Attachments:
    1.JPG ‏27 KB

    Hey Atrina,
    The actual data stored on disk is just the raw data (that is, a byte per sample in your case).  It's really just a matter of how that data is being represented in LabVIEW whenever you read back the TDMS file.
    I'm not sure if there is a better way to do this, but here is a way to accomplish what you're wanting:
    Read back the TDMS file as a digital waveform.  Then there's a conversion function in LabVIEW called DWDT Digital to Binary.  This function will convert that set of digital channels into the "port format" that you're wanting.  I've attached an example of what I mean.
    Note: When looking at this VI, there are a few things that the downgrade process did to the VI that I would not recommend for these TDMS files.  It added a 1.0 constant on the TDMS Open function, and it set "disable buffering" on the TDMS Open function to false; you can get rid of both of those constants.
    Message Edited by AndrewMc on 01-27-2010 11:21 AM
    Thanks,
    Andy McRorie
    NI R&D
    Attachments:
    digitalconvert.vi ‏13 KB

  • How to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scripting

    how to get all how to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scriptingstyle and their fonts of a  indesign file and write all info with para info into txt file with scripting

    I write the script this one works
              var par=doc.stories.everyItem().paragraphs.everyItem().getElements();
      for(var i=par.length-1;i>=0;i--)
           var font=par[i].appliedParagraphStyle.name;
            var font1=par[i].appliedFont.name;
             var size=par[i].pointSize;
            WriteToFile (par[i].contents  +   "\r" +  "Style  : " + font  + "\r" +  "FONT1  : " + font1  + "\r" +  "Size  : " + size  + "\r", reportFilePath);
                            function WriteToFile(text, reportFilePath) { 
        file = new File(reportFilePath); 
        file.encoding = "UTF-8"; 
        if (file.exists) { 
            file.open("e"); 
            file.seek(0, 2); 
        else { 
            file.open("w"); 
          file.writeln(text);  
        file.close(); 
    Thanks for all your support

  • How can I make waveform graph and/or excel file with two different dynamic DBL values?

    As the question describes, I have two dbl sources from a load cell and linear actuator (from firgelli). I want to make a load/displacement curve from the force readings from the load cell and the displacement readings from the linear actuator. The load cell outputs an analog signal that can be acquired by a DAQ and the actuator comes in with a board and VI program to control the speed and measure the displacement of the actuator to a sample rate of my choosing. Is there a way that I can make a VI where it continues to collect data and construct the graph I'm looking for?
    Solved!
    Go to Solution.

    A couple points about your application:
    1.  Synchronization.  Since you're ultimate goal is a stress/strain curve, it is vital that your force and displacement data be synchronized appropriately.  If your sampling is beyond a few times a second, this is not really possible without some form of hardware synchronization via either a trigger and/or sample clock.  Two NI DAQ boards can be synchronized this way easily, but it seems you're using 3rd party hardware for one of these processes.  Would need to know more about that board to know what options you have.  You could specify what your resolution is in distance, and how fast the article will be moving, to get an idea of how fast to acquire, and how well you'll need to synchronize the data.  Another option, since it appears each data stream will be sampled on a hardware-timed sample clock, they will be offset in time, but not skewed during the acquisition.  You may be able to identify a feature in the data set common to each and use that to remove the timing offset after the process is completed.
    2.  Display.  To display data during the acquisition process, I usually recommend at least one display that plots vs. time.  Much easier to spot irregularities with the acquisition process that way.  However, if you'd like to also plot force vs. displacement, you can use an XY Graph to plot parametrically. For Example, in your case you would use the Displacement data as the X coordinates, and the Force data as the Y coordinates.
    3.  Saving data to file.  I would recommend using the Save to Spreadsheet File.vi (File IO pallette) to save your data.  If you use a comma as the delimiter, and save the file with a *.csv extension, you will have a file that is easily read into excel.  The standard tab-delimited spreadsheet file is also fine, it will just require an extra step to read it into excel to specify to excel what the delimiter is.
    4.  Batch vs. Real-Time Recording (Data File).  If your process is short (< 30 sec) you may be better off acquiring the data, Storing it locally to the VI (Array - usually maintained in a shift register), and then writing the file with a header (acquisition parameters, test article information, data column headers) and the data all at once in batch mode to the file after the process is finished.  If, however, it is longer than that you would be better off starting a data file with a header and appending the data to the file as you go, so that if something happens during your test, you at least have data up to that point.
    Hope this Helps,
    Kurt

  • File Read and Write using File Adapter in Bpel

    In Bpel Process i am using File Adapter ( Schema is Opaque) for read and write the file contents. i am able do successful deployment and read, write function in first time deployment, after that again i tired to run the application, its not going to write the content of file, its only writing the file with out data's or content in that file.
    Please help me...
    Saravanan

    Hi Eric
    In my domain.log file having the following details. In this file im unable to find out what the exact problem. Please look at this and help me.
    <2008-01-22 18:25:42,024> <INFO> <default.collaxa.cube.compiler> validating "C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\tmp\.bpel_BPELProcess2_1.1_298e83988d77b6640c33dfeec11ed31b.tmp\BPELProcess2.bpel" ...
    <2008-01-22 18:25:49,850> <INFO> <default.collaxa.cube.engine.deployment> <CubeProcessFactory::generateProcessClass>
    Process "BPELProcess2" (revision "1.1") successfully compiled.
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Loading JCAActivationAgent for {portType=Read_ptt}
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Locating Adapter Framework instance: OraBPEL
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Done loading JCAActivationAgent for processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.engine.deployment> Process "BPELProcess2" (revision "1.1") successfully loaded.
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::uninit Shutting down the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.0/', activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - performing endpointDeactivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Endpoint De-activation called in adapter for endpoint : D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::init - Initializing the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and initializing inbound JCA endpoint for:
    process='bpel://localhost/default/BPELProcess2~1.1/'
    domain='default'
    WSDL location='rd.wsdl'
    portType='Read_ptt'
    operation='Read'
    activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Endpoint Activation called in File Adapter for endpoint: D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - successfully completed endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,890> <WARN> <default.collaxa.cube.activation> <File Adapter::Inbound> PollWork::run exiting, Worker thread will die
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Managed Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> FileInteraction Created

  • How do I migrate files created in a Windows OS to a new external drive that is formatted as a MAC drive. I want to read and write these files back to the new drive.

    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.

    LKrzesowski wrote:
    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.
    If all you're trying to do is move the files from the Windows external to the Mac external, you can simply connect them both to the Mac and drag the files from the Windows drive to the Mac drive. If you want to move the files back and forth between them, you'll need to establish the format of the Windows external. Macs can read and write to FAT32 and exFAT (which can handle files larger than 4GB) formatted drives but can only read NTFS formatted drives without additional software. With the Windows drive connected, you can check its format with Disk Utility.

  • Can anybody explain me how to sample and play audio files with logic's EXS2

    can anybody explain me how to sample and play audio files with logic's EXS24 Sampler???
    i cant find a way to upload and manage my own audio content on this sampler...

    i uderstand , thanx...
    i managed to open an audio file and placed it in the sampler,i can play t sample in the little keyboard in the zones section, howver i dont know how to play it with my controller... the sample shows in C1 on logic's keyboard but if i play C1 on my controller nothing happens... how can i fix this?
    Also, i noticed the sample plays from beginning to end once i click on it, how do i do to just make it last until i release the key? like a logic sound??? (in case i want to play a small portion of the sample only)
    Thanx

  • Open a url and view the files with it's timestamp

    Hi guys,
    I need to create a flow service in SAP BC to connect to a server by it's url and display it's files with it's timestamps.
    I have never done this b4, and usinf SAP BC makes it harder for me.. Mostly I need to know how to access the server and view the files with their timestamp.
    Any guidance for me will be much appreciated.
    Thank u.

    Yes,
    It's like this. I will connect to an FTP server. Then I need to view the files it the server or folder i specify with their respective timestamps.
    I am using SAP BC and it's webMethods to create the JAVA flow service. I am only now familiarising myself with SAP BC.
    Moreover I have never done a coding to access a server and list it's file. I can do it o view in a local directory using JFrame aand stuff... But SAP BC doesn't support those..
    So If u can give me some guidelines to follow.. i would appreciate it.
    Here's what i have come up with so far
    public static final void ReadFileServer( IData pipeline ) throws ServiceException
    //define input variables
         IDataCursor idcPipeline = pipeline.getCursor();
         String path = null;
         path = (String)idcPipeline.getValue();
         // Check if url is in the pipeline
         if (idcPipeline.first("path"))
              File dir = new File(path);
              String filesFound[]=dir.list();
              long [] age;
              age = new long[filesFound.length];
              for (int i = 0; i < filesFound.length; i++)
                   age = new File(filesFound).lastModified();
              String temp = "";
              for (int i = 0; i < age.length - 1; i++)
                   for(int k = i+1; k < age.length ; k++)
                        if (age > age [k])
                        temp = filesFound;
                        filesFound = filesFound[k];
                        filesFound[k] = temp;
              for (int i = 0; i < filesFound.length; i++)
              //get url out of the pipeline
              path = (String)idcPipeline.getValue();
              //insert the FILES into the pipeline
              idcPipeline.insertAfter("filesFound", filesFound);
              idcPipeline.insertAfter("age", age);
         //If it is not in the pipeline ERROR
         else
         age = "False";
         idcPipeline.insertAfter("path", path);
         //insert the successFlag into the pipeline
         idcPipeline.insertAfter("age", age);
         //Always destroy cursors that you created
         idcPipeline.destroy();
    return;
    }

  • I take a .NEF file and a .JPG file with every click. When I transfer the files using a flash drive to another computer I never get all of the files to transfer. I get some of the .NEF and some of the .JPGs but not all

    I take a .NEF file and a .JPG file with every click. When I transfer the files using a flash drive to another computer I never get all of the files to transfer. I get some of the .NEF and some of the .JPGs but not all. How come?

    If you're exporting a project then you'll only get the images in that project. Also if any of the masters are referenced then you won't get those masters unless you check Consolidate masters into exported library
    It might be best if you started from the beginning and explained what it is your are trying to do and how you're going about doing it. Also a description of you're hardware/software setup would be helpful.

  • I'm trying to share folder between users on a single mac.  I put the folder in "shared," set permissions so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    I'm trying to share a folder between users on a single mac.  I want both users to be able to read and write so the folder stays current on both accounts.  I put the folder in "shared," set permissions on folder so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    Did you log out of one account and into the other or just used Fast user switching?
    Is the permissions set to anyone?
    When you move data to teh Shared folder is it copied or just moved?
    If copied then it's not a folder both can access, just a way station like a USB thumb drive that things are coped too and off of likely.
    You can run this #5 on each user account to reset the user permissions once they are taken back out of the Shared folder
    Step by Step to fix your Mac

  • Wire to cb, graph and write to file

    I have a tensile tester, I want to produce a vi that can directly display a chart of force and extension. I have 3 wires , force 0-10volts , extension 0-10v and ground. I do not know which point to wire it on a green board CB 68 LP ? I then want to get a chart and write both to an excel file. I'm new to labview but it would be a great help. Can you help me? James

    Hi James,
    What is you CB-68LP connected to? Does it lead to a PCI card in your computer? If so, what is the model number of that card?
    You can find out how to wire you CB-68LP by opening Measurement and Automation Explorer (MAX) on your computer. Look for your PCI card on the left hand side under My System>>Devices and Interfaces. If you right click on your device then go to "device pinout" this will show you the numbers associated with the various pins. Its then just a case of matching that Pinout with what you can see on your CB-68LP.
    Regarding writing your information to an Excel file, have a look at the "write to measurement file" express function. You can find this by going to the Functions Pallet>>Express>>Output.

  • Read PDF Formatted Spool and write PDF File to Application Server

    Hi Experts,
    After ECC 6.0, HR-W2 and W2C Form Spools are getting generated in PDF format.
    We have a requirement wherein we want to read the PDF Spool Programatically and write the PDF file to Application server (Using OPEN DATASET and CLOSE DATASET)
    PARAMETERS : p_spono LIKE tsp01-rqident.
    DATA: pdf_data type FPCONTENT.
    types: lt_pdf_table(1000) type x.
    data:  l_pdf_data type standard table of lt_pdf_table,
           l_pdf_line type lt_pdf_table,
           l_offset type i,
           l_len type i,
           p_file(100) VALUE '\sapout\DVH\pdf2.pdf'.
    *Read the spool content
    CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
        EXPORTING
             i_spoolid = p_spono
             i_partnum = '1'
        IMPORTING
               e_pdf = pdf_data
    *         e_pdf_file = file
        EXCEPTIONS
             ads_error = 1
             usage_error = 2
             system_error = 3
             internal_error = 4
        OTHERS = 5.
    * Modify the spool  contents to prepare internal table
      l_len = xstrlen( pdf_data ).
      while l_len >= 1000.
        l_pdf_line = pdf_data+l_offset(1000).
        append l_pdf_line to l_pdf_data.
        add 1000 to l_offset.
        subtract 1000 from l_len.
      endwhile.
      if l_len > 0.
        l_pdf_line = pdf_data+l_offset(l_len).
        append l_pdf_line to l_pdf_data.
      endif.
    * GUI DOWNLOAD Works Fine
    * Now pdf contents is ready , lets store in local PC
    *CALL FUNCTION 'GUI_DOWNLOAD'
    *  EXPORTING
    *   filename                        = 'C:\Documents and Settings\Desktop\shital.pdf'
    *   filetype                        = 'BIN'
    *  TABLES
    *    data_tab                        = l_pdf_data.
    OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error opening file:'(Z03) p_file.
    ENDIF.
    LOOP AT l_pdf_data INTO l_pdf_line.
      TRANSFER l_pdf_line TO p_file.
    ENDLOOP.
    CLOSE DATASET p_file.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error closing file:'(Z04) p_file.
    ENDIF.
    Currently as you can see I have commented out GUI_DOWNLOAD Function Module, But it works perfect when I try to Download file to Local Desktop.
    But when I try to pass the same Contents to Application server file and then try to open it by downloading file then it opens BLANK pdf file.
    As per requirements I should be able to write the file correctly on Application server and If I dowload it from there it should open PDF file correctly.
    Let me know if you require further details about the issue.
    Regards
    Shital
    Edited by: shital phadake on Apr 8, 2009 9:39 PM

    Thanks Selçuk for your reply and taking time for understanding the Issue,
    I went thru Functionality of the program you suggested but dont think it matches my requirement.
    Regards
    Shital

  • How to select the data from DB and write into File?

    Hi Experts,
    Can any one please help me,
    I want to write the data from a table "T1" from Data Base to one file in windows.
    This functionality i need to achive in SSIS package through script component and Execute SQL task if it's passible.
    If any other way is there please help me.

    through script component and Execute SQL task if it's passible
    The easier way is to use a "Data Flow" Task with a "OleDB Data Source" pointing the the SQL Server table / query and a "Flat File Destination" to export to a file.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Need to play and stop sound file with 1 ms resolution

    Hi,
    I'm trying to open a .wav file then later play it at a time when another parallel loop activates a boolean local variable which controls playback in my "sound" loop. I need high time resolution in stopping the playing of the .wav file, ~1ms. From what I've gathered, I can't use the "sound output write.vi" because it locks the loop until it finishes outputting a set number of samples. Because of this, "sound output stop.vi" has to wait until the next iteration, which is more than ~1 ms.
    In the help menu of the Sound Ouput VIs it says you can set the task ID for the "sound output start.vi" using the "sound output configure.vi." Unfortunately I've only been able to use the "sound output start.vi" following "play sound file.vi", and I don't really know why this is the case.
    I can't start my sound with the "play sound file.vi" because it locks the loop its in until it finishes playing the sound. Oddly this only happens when there is a parallel loop running, if I run it by itself, with no other loops, it doesn't lock the loop. I thought it might have something to do with the local variable, but the loop doesn't lock when the loop restarts the sound using the "sound output start.vi." 
    After opening a .wav file, can i use the "sound output configure.vi" to create a task ID for the "sound output start.vi" to work? Or do I have to use the "sound output write.vi" after calling the "sound output configure.vi." The help menu makes it seem like the prior suggestion is possible.
    Thanks a lot!

    Since it sounds like the problem you're running into is getting the data loaded from the file before you're ready to play it, look at the Files sub-palette, specifically the Sound File Read Simple VI.  You can use this VI to load the data into a waveform and have it ready for use later in the program.
    So in your overall program, read the file with Sound File Read Simple and configure the output with Sound Output Configure and call Sound Output Write when you're ready to play the waveform.
    Alex Person
    NI-RIO Product Support Engineer
    National Instruments

  • How to read and write(a file .txt) from a URLConnection

    I try to read and write on one URLConnection. Is it possible ? How can i make it ?
    The reading part of my application work's but not the writting part
    That's a part of rhe code that i use to write :
    String Line = "Hi";
    MyUrl = new URL(this.getCodeBase(), FichierEvenement) ;
    Con = MyUrl.openConnection() ;
    Con.setDoOutput(true);
    Con.setDoInput(true);
    Con.setUseCaches(false);
    Dos = new DataOutputStream(new BufferedOutputStream(Con.getOutputStream( )));
    Dos.writeUTF(Line);
    Please help me :)

    What are you doing with the bytes written to the OutputStream? This info would help, but i do have a suggestion. I ran into this problem when trying to write strings using writeUTF. The output was all screwed up. So, maybe change your string to a character array. That way Unicode is displayed properly. This in conjunction with writing to an .html file instead of to the connection itself might work.

Maybe you are looking for

  • Error during setup of VSLS2011 "setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager.."

    Hi I have VS 9 installed and was wanting to install LightSwitch so downloaded the ISO(VSLS2011_ENU.iso) and burnt to disk ran setup.exe and received the this message. "Setup could not install the following component: Microsoft ApplicationError Report

  • Information in transaction VP01SHP

    Hi After defining new condition type for picking list ,I am trying to enter  details in transaction VP01SHP . I request you to help me to enter information in following fields . Itu2019s not that I do not know , I am not sure which information exactl

  • Firewall and wireless router

    I have searched everywhere and I can't find the awnser. How does my firewall setting in any computer on my wireless network effect what can go thru my router (wrt54g)?  Specifically, I have a wvc54gc camera that I can't connect to from outside of my

  • Solution for inheritage of user statuses in a WBS hierarchy

    In a SAP 4.6C system I have set-up a specific user status profile for the WBS-hierarchy of a project. The intention is that at the highest WBS-level the user-status is changed manually and that the statuses of the lower WBS-elements will be changed a

  • Installing BIEE error

    Hi All, I tried to install Release Version: Oracle Business Intelligence 10.1.3.4.1 for Windows, but it shows me the following msg: systeminfo.exe - Unable To locate Component "The application has failed to start because framedyn.dll was not found. R