Trigger to write only current individual sampled data to spreadsheet

Hi, I am new to labview and I have a task that I am not capable of completing.
My task is to read the values of two encoders simultaneously. I am reading the encoders using 2 counters. I am generating a clock using a third counter, allowing the encoders to use that clock for simultaneous sampling.
Then, using a physical push button, I want to trigger writing the angular positions of the two encoders to one spreadsheet file, making sure that ONLY both values at that same sample are written to the file. I want to write the ouputs of the encoders everytime I press the trigger, multiple times during execution, appending the new values to the same spreadsheet file. (Each column in the spreadsheet file should contain several outputs of each encoder: Column 1 for Encoder 1 and Column 2 for Encoder 2)
My problem is not knowing how to implement the writing of the encoder outputs at the same sample the trigger is pressed.
I hope it is clear what I am trying to do and I would greatly appreciate your help.
Please find the working VI attached.
Thank you,
r15
Attachments:
Meas-Ang-Pos-Buff_(2encoder with clock).vi ‏43 KB

Hi again
Thanks for your replies.
I followed your advices but I still need some adjusting for my code to work the way I intend it to.
To be more specific, I am building a robotic coordinate measuring arm where I aim to place the end-probe of the arm on an object and get the (x,y,z) coordinate at that specific point. To get the coordinate, I have to get the angular positions of the encoders (placed at the degrees of freedom of the arm) at that specific point. Hence, I will be using this physical trigger to signal writing the encoder values, at that specific point, to a spreadsheet file. After registering one point, I would like to be able to move the end-probe of the arm to another point and to follow the same procedure. (Use the trigger to signal writing the angular values of that new coordinate to the same spreadsheet file).
The problem with placing the trigger in the while loop is that on each iteration the value of the encoder is saved, which is not what is required of my task.
I want the trigger to be somehow independent of the while loop because of my application I described above.
I hope this makes it clearer as to what I am aiming for.
I modified my VI as you advised (find modified VI attached), and I will be gratefull if you can help me further with this task.
Thank you,
r15
Attachments:
Meas-Ang-Pos-Buff_(2encoder with clock).vi ‏43 KB

Similar Messages

  • How to design extractor can have only current Fiscal Year data.

    Dear Experts,
    I require a full upload DSO , which can have only current fiscal year data . I have created view putting there certain conditions for minimising the data size. How i can restrict it , to have only current fisacal year data for YTD reports. It would be daily uploaded.
    Should i created Data Source based on function ?
    Regards,
    Anand Mehrotra.

    while extracting the data from source you can set the filters at the info package level so that it will not extract the previous years data.
    In the data selection tab in Info package enter the current fiscal year and schedule the IP it will extract only the current year data.
    next execute the DTP to load data till DSO.
    the data is restricted in the infopackage level before entering to PSA so there is no need to write any routines in the DSO level.
    Edited by: prashanthk on Feb 1, 2011 12:45 PM

  • How to modify the VB examples in ni-scope to sample data simultaneously from two channels in PCI 5922?

     Dear all:
    I want to write VB programs to sample data simultaneously from two channels in PCI 5922. The niscope driver has some example VB programs to sample data from one channel, for example, the "save to file ", the program works well to sample the data from one channel.  When I modify it to sample data simultaneously from two channels, I always get error so I seek your help on how to write the program to sample two channels simulatenously. Thanks.  I attached the sample program here and what I tried to modify is the "channel name" and "waveform()"
    Regards
    Andy
    Attachments:
    savetofile.doc ‏42 KB

    Hi Bajaf, regarding the FFT of the four channels, the next link might be what your looking for:
    http://digital.ni.com/public.nsf/allkb/862567530005f09c8625671b00739970
    Respect the phase issue how are you doing the acquisition of the signals, are you doing two independent acquisitions? if you are controlling them as independent acquisitions try to synchronize them with triggers and the clock.
    How much are they out of phase?
    By the way we know have forums in Spanish
    Best Regards
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • I Need to Write the current Date and Time

    I need to write the current date and time to calculate the spend time in each instruction.
    What is the instrucion?
    Thanks.
    MIGUEL ANGEL CARO
    [email protected]

    The current time can be determined with a Date object:
    Date now = new java.util.Date() ;or if you are interested in the seconds since the epoch:
    System.currentTimeMillis() ;If you wanted to print them out:
    System.out.println( new java.util.Date() ) ;
    System.out.println( System.currentTimeMillis() ) ;Kenny

  • Write To Measurement File Only One Line Of Data

    Hello,
    I have an express VI setup to acquire a single channel of strain running in a simple while loop.  The output is wired directly to a Write To Measurement Express VI.  However, the resulting measurement file contains only one line of data.  
    I have tried changing the settings of the VI to no avail.  I feel that I must be missing something basic.  My while loop is setup to take one measurement on demand for each loop.  I am assuming the VI knows to write each loop as a new line of data?  
    Thanks for any help,

    Did you choose "append to file" in the Express VI configuration settings?
    You need to upload your VI for further help.  It's impossible to help someone debug a problem without the code to look at.

  • Trigger and Gate Only Returns One Channel

    Hello all,
    I am trying to write a VI that will run in the background and start writing some data to a file when it detects a signal. For detecting the signal, the VI uses the "Trigger and Gate" express VI to see when the input voltage goes above a treshhold. Then I plan to write whatever data comes out of the "Triggered Signal" output.
    There are 8 channels, with the 6th one being the channel that is being checked for a signal. I have configured the "Trigger and Gate" express VI to trigger when that channel reaches 0.01 V and it does trigger when that happens. However the problem is that the "Triggered Signal" output only contains data for the first channel, and I want it to contain all of the channels.
    I don't have access to the device that will be sending the data right now, so I am testing the VI using the "Read From Measurements File" express VI. It reads from a file that contains data that I saved from the device previously. When I set the the "Retrieve segments of specified size" for the express VI, so I can see how it progresses, I get the error I mentioned above. When I set it to "Retrieve segments of original size" (the file contains only 1 segment, so it reads all data), everything works as expected.
    Any ideas as to what I am doing wrong?
    I attached the VI with some sample data.
    Attachments:
    data.csv ‏4834 KB
    trigger-and-gate.vi ‏112 KB

    Hi krizka,
    There are two really good examples that can be found using the NI Example Finder (help -> find examples). These are under Hardware Input and Output -> Analog Measurements -> Voltage  
    Cont Acq&Graph Voltage-Int Clk-Analog Start.vi
    Cont Acq&Graph Voltage-Write Data to File (TDMS).vi 
    These will give you a good start point. Please feel free to ask if you have any questions
    Joe Daily
    National Instruments
    Applications Engineer
    may the G be with you ....

  • How to get only current exception message from tables

    Hi
    In my sceanario , I want to have the list of Current MRP exception messages list from table
    I understand that MRP detailed lists, including all exception messages, are stored in transparent table MDKP and cluster table MDTC.
    I can tell ABAPer to write a report for me , to read the data from these tables , but I guess these tables contain old exception message also , which are not currently appearing in MRP list
    How to get only current exception message
    Rgds,
    sandeep

    Sandeep,
    MDTC contains only data from the most recent MRP run.  So, all messages you see are those which are currently valid.
    The messages might have first appeared during a previous run, but they still need to be addressed.
    Before you invest a lot of time and effort into writing and debugging a custom report, you should probably try to use the standard SAP functionality found in MD06.  On the Processing indicator tab, you can select "Only with new exceptions".  Here you can tag a material/plant as 'processed', and thereafter, the exceptions that existed there before you tagged the part will not be re-displayed.
    Best Regards,
    DB49

  • Creating View based on Current and previous data from same table

    I am trying to create a view based on a table called “my_companies”. The table has following columns: “company_id”, “start_date”, “product_type_code”, “partner_id”
    The main purpose of this view is to obtain previous company_id’s associated with a particular “partner_id“and “product_type_code”. So basically, I’m looking to create an extra column, say “prev_company_id” in the view along with all the other columns. The “previous” data can be obtained depending on the “start_date”. I’m not able to write a query successfully to do this.
    Can anyone help? Thanks in advance.

    Hi,
    Whenver you have a question, it helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing.  The sample results should include any special cases that you foresee, such as one company having many previous companies, or vice-versa.
    It sounds like might need a +self-join+, where you have two copies of the same table, as if the current companies were in one table and the previous companies were in another, even though they are all actually in the same table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I quickly sample data from 200 channels using DAQmx?

    Hello,
    I am trying to sample thermocouple data using a SCXI 1000 chassis with two SCXI 1100 modules and one SCXI 1102B, all of which have a 1300 isothermal terminal block. The computer I am using has a PCI-6052E DAQ card and 1 GB of RAM. I will eventually need to upgrade to a SCXI 1001 chassis with enough modules to collect about 175-200 different signals. The problem is I am testing with just the 96 channels I have available and the program runs super slow, with the maximum sample rate only .026 Hz. Currently I have all the channels being read by one DAQmx VI. I've looked through the example programs and tutorials, but nothing there deals with large numbers of channels. Is there a way to improve the sample rate to around 1 Hz with so many channels?
    Thanks in advance

    Check the filter configuration for your SCXI-1100.  The product page says that if you set the filter for 4Hz, you'll only get 3 Samples/second.  The slowest module in the chassis determines the sample rate.  If one of your modules is configured that way, you'll get a maximum rate of approximately 3 hz / 96 channels = 0.031 hz/channel, which is pretty close to what you've reported.  The filter is set by a jumper on the module, see the manual under "filter selection."
    You might want to look at "Determining Maximum Scan Rate for Multiple SCXI Modules" as well.

  • Back button to re-edit form..."Current version of data..." error?

    I've noticed a fairly common error that my users are running into. Here is the situation...
    A user navigates to a form...makes modifications...saves the form...and is redirected to another page. Then, the user clicks the browser back button to re-edit the form...saves the form and gets the following error...
    "...Current version of data in database has changed since user initiated update process...."
    I am currently running v2.0...but I was able to also duplicate the issue within v3 (online...Customer Tracker sample application).
    Is there any way to catch the error to display a custom message?
    Or maybe some settings that I am missing to guarantee that when the user clicks the back button, the page is refreshed so it doesn't show the cached version with the old data?
    Or maybe there is another way to approach this?
    Thanks...
    Matt

    Matt,
    This is functioning exactly as it should... Imagine what could happen if it didn't work that way! People would overwrite other's information all the time.
    I think the solution you need is two fold: user training and app modifications.
    I know what you're thinking, user training, hah! But it's going to help as you make more of these kinds of web apps.
    As for app modifications there are two I can think of that may help.
    1. I don't know how the users open the app but if they click on a link then you can have the popup window open without tool bars and such (but they still have the backspace on the keyboard).
    2. Add a button on the page they are redirected to after saving the form. Make the condition of the back button "If item is not null" and put PXX_ITEM_NAME in expression 1.
    Then create the item you just put in expression 1as display as text (saves state). Set the condition to never. Now go to the page with the form, and create a process that sets PXX_ITEM_NAME equal to the value of the item used as the primary key for the form. Make sure the process only fires after an update is made.
    Then when the users get to the page after making a modification they will see a "back" button.
    The last step is to create a branch that will take the user back to the form if they click the button and populates the form item for the primary key.
    Let me know if this is making any sense or not.
    Dan
    Dan

  • GPS timestampi​ng continousl​y sampled data

    Hi all,
    I'm working on an application that samples 32 analog and 5 digital signals at a fixed rate of 4 kHz and I'd like to accurately timestamp each sample using a GPS time reference.
    The timestamp accuracy should be better than 120 us. The application is written in C/C++ and uses the DAQmx C API.
    The hardware I have available is the following:
    * PCI-6224 card (A/D with 32 analog channels, lots of digital I/O and 2 timer/counters)
    * PCI-6602 card (8 timer/counters and a 80 MHz clock)
    * TrueTime XL-AK (model 600-000) GPS time reference, with serial ASCII output, IRIG-B timecode output and PPS (pulse-per-second) output.
    Unfortunately my GPS is not equiped with a 1 MHz or 10 MHz reference output. Also the IRIG-B output is not easily useable because it is AM modulated on top of a 1 kHz carrier (therefore not compatible with a digital input and all 32 analog inputs have already been allocated)
    I plan to implement this application by doing all timing generation on the PCI-6602 and doing all sampling (analog/digital) on the PCI-6224. A pair of counters is configured to do GPS timestamping as demonstrated in the document in this thread:
    http://forums.ni.com/ni/board/message?board.id=250​&message.id=8560
    By routing the same sample clock and digital edge start trigger to all blocks that sample data (analog or digital), the data from all measurement tasks would be synchronised to each other. This would result in 3 streams of parallel data: timestamp values (second + sub-second count), analog data (32 channels) and digital data (say 32 bits for each sample).
    However I suspect that the counter arrangement from the thread mentioned earlier does not produce *buffered* timestamps. This would make it impossible to use it as I just described above. Is this correct?
    Does anyone know another solution?
    I've been thinking about the following alternatives:
    1) Sample the PPS signal at a higher rate to more accurately find out where the first sample in the current second starts. Then the timestamp for each sample can be calculated as Tsample = Tpps + Tfirst_sample + N/F, where Tpps  = time (in seconds) of the last PPS pulse, Tfirst_sample = offset of first sample in the current second, N = sample number within the current second, F = sample frequency.
    2) Same as above, but using buffered two-signal edge-separation measurement to get the offset between PPS and sample clock at even better accuracy.

    Typically, (and sometimes necessarily), a sample clock signal used for counter measurements would be connected to a counter GATE pin.  For the specific case of "encoder" measurement on the 6602, the Z-index signal must be physically wired to the counter's default GATE pin, so the sampling clock signal would need to be physically wired to the GATE pin of a different counter.  Having wired the sample clock signal to a single GATE pin, both of the 2 counter measurement tasks can programmatically specify that their sampling clocks come from that single pin.
    The M-series board offers more flexibility in programmatic PFI signal routing than the 6602.  You can pretty much wire to any PFI pin and then programmatically specify which pin to use as Input (SOURCE) and which as Sample Clock (GATE).  I still typically adopt the convention of using default pins whenever possible.
    The terminology for counters can be a bit confusing.  In my opinion, the old traditional NI-DAQ was a little more cryptic at first glance but much more consistent overall.  The new DAQmx terminology tries to hide implementation details more, but in the process generates multiple aliases to the same pin assignment, depending on how you're using it.
    A quick rundown.  A SOURCE edge causes the count register to increment.  Under DAQmx, this may be referenced as an "Input" or a "Timebase" terminal, depending on the measurement mode.  When counting edges, it's an Input.  When measuring period or frequency, it's a Timebase.  Whatever it's called, the natural behavior at the counter hardware is to increment a count register on each active edge.
    A GATE edge can cause a count value to be stored in the acquisition buffer.  Under DAQmx, it may be referenced as a "Sample Clock" source when counting edges.  When measuring period or frequency it may be a "Channel" or an "Input terminal."  Again, whatever it's called, the behavior at the board level is to store an instantaneous count value into the data acq buffer on each active edge.
    [There are exceptions, of course.  The GATE pin is also used for "Pause Triggering", and can also be used to reset the count register for position measurement with Z-indexing enabled.  And so on.]
    -Kevin P.

  • ORA-20503: Current version of data in database has changed since user initi

    Hi,
    I am getting the below error when I try to update an existing record.
    "ORA-20505: Error in DML: p_rowid=11887, p_alt_rowid=CASE_ID, p_rowid2=, p_alt_rowid2=. ORA-20503: Current version of data in database has changed since user initiated update process. current checksum = "7EB7B6F69DB421184B4CEE0884E435C6" application checksum = "53106AB0EB97FD1442D85F2AAE3AFA69"
    Error Unable to process row of table "
    And this does not happen always. IT happens once in a while and I am unable to check what is causing the issue. It is a critical issue and need to be fixed asap.
    Any help is greatly appreciated!
    Thanks!
    Kavya

    We are using Apex version: 3.1.2.00.02
    What else could be the reason and how should I fix it?
    At this point the application is migrated and I am unable to write a custom package for the DML operations. And this issue happens randomly and that too only while updating the data.
    Please help!

  • Time doesn't match sampled data?

    Hallo all experts,
    I write a LV code which reads data from USB 6211 and saves them with time instants in a text file, but the time instants don't correspond the sampled data. The time values are generated by elapsed time, after build array with the data read from DAQ, they are fed to the write to a text file. The test signal is 10 Hz, but the text file yields 0.2 Hz signal. How could I synchronize them?
    Any tips are highly appreciated.
    win2

    Don't use the "elapsed time" express VI for precision timings. It seems to have limited resolution (internally, it converts a timestamp to DBL).
    You can use e.g. the tick count to keep track of the time. See the attached comparison. (still there will always be some subtle differences due to the software timings).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    usb6211_forumMOD.vi ‏42 KB

  • How to renormalize number of flows in Netflow Sampled data

    Hi,
    I am working on extrapolation(renormalization) of bytes/packets/flows from randomly sampled (1 out of N packets) collected data. I believe bytes/packets can be renormalized by multiplying bytes/packets value in exported flow record by N.
    Now, I am trying to extrapolate number of flows. So far i have not got any information on it. Do you people have any idea on how flows can be renormalized from sampled data ?
    Well, at the same time i have some doubts regarding this concept altogether -
    1. In packet sampling, we do not know how many flows got dropped. Even router cache will not have entries for dropped flows
    2. In flow sampling, router cache will maintain entries of all the flows and there may be some way by which one can know how many actual flows were there. But again there is no way to know values of individual attributes in missed flows like srcip/dstip/srcport/dstport etc.(though they are there in flow cache)
    3. In case of sampling (1 out of N packets), we anyway multiply #packets and #bytes with N to arrive at estimate for total packets and bytes. When we multiply by N, it means we have taken into account all those packets as well which were NOT sampled. So, it means all the packets which flowed between source and destination have been accounted for. Then there are no missed flows, isn't it ? And if there do exist some missed flows then multiplication by N to extrapolate number of packets/bytes is not correct.
    4. What is the use of count of flows anyways. Number of flows may vary depending upon the configuration such as active timeout etc. So, it does not provide any information about the actual flow between source and destination unlike number of packets and bytes.
    Please share your thoughts.
    Thanks,
    Deepak

    The simplest way is to call GetTableCellRangeValues with VAL_ENTIRE_TABLE as the range, next summing array elements.
    But I don't understand your comment on checksum, so this may not be the more correct method for your actual needs: can you explain what do you mean?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Can I write to a collection or data table with Sienna?

    Hello all,
    First of all, it will be painfully obvious that I am not a developer. I have some knowledge an can do that I want when it come to tracking information with Excel but I'd like to dabble in Sienna and see if I can make a simple little app.
    With Sienna, can the Text Input boxes be used to write to a table in an excel file, so I can then apply Fx to the data and display it in the app?
    For example, a user enters in a number in the app. It get's written to a table, then an fx is applied ( such as  simply subtracting 10 from the inputted value) and the result is displayed to the user.
    Thanks,
    Ryan

    Hi Ryan,
    That is one of the motivations for building Siena and so we are happy to have you, developer or not!
    Is there a specific reason for wanting to write back to Excel, other than for subtraction? Siena is perfectly capable of pulling Excel data, you won't be able to write back to the Excel file, but you can manipulate the imported data within Siena.
    In any case, consider the following example where we use a slider to perform the subtraction and display the results for each column. I used the following sample data from excel - the table the data is contained in is called 'Table8':
    Column1      Column2
    239029       78989
    23147         2374893
    278432793 37893
    238729       382397
    1) Add a Slider, called Slider1
    Set the Min to the lowest value your user will subtract the excel data by, and
    Max to the highest value your user will subtract the excel data by. I picked 10 for my min and 100 for my max
    2) Import the data
    3) Custom Gallery, called Gallery1 - It's the option at the bottom right of the "Galleries" group
    3) Set the Select Gallery1 as a whole and set the 'Items'
    under the 'Data' group to 'Table8'
    4) Click "Add Visual" on the first item in the Gallery and add a Label, called
    Label1. This label will also have its Text automatically set to
    ThisItem!Column1. Change this to ThisItem!Column1 - Slider1!Value.
    5) Click "Add Visual" on the first item in the Gallery again and add a second Label, called
    Label2. This label will also have its Text automatically set to
    ThisItem!Column2. Change this to ThisItem!Column2 - Slider1!Value
    6) Now drag Slider1, back and forth an notice the values both in
    Label1 and Label2 change as the slider is adjusted.
    If there is a need to store the manipulated data, then 
    LoadData() and
    SaveData() expressions could be leveraged within Siena.
    Hope this helps.

Maybe you are looking for

  • Performance issue in browsing SSAS cube using Excel for first time after cube refresh

    Hello Group Members, This is a continuation of my earlier blog question - https://social.msdn.microsoft.com/Forums/en-US/a1e424a2-f102-4165-a597-f464cf03ebb5/cache-and-performance-issue-in-browsing-ssas-cube-using-excel-for-first-time?forum=sqlanalys

  • Nokia lumia 925 display problem

    Hi everyone, I have owned Lumia 925 and having trouble with its display as it gets low in din light. It gets lie even greater than the phone's default low level.

  • JDBC Receiver Channels stuck !!!!

    Hello, We are facing a very strange situation.. From our SAP/R3 system we are sending data to 3 databases (3 dif. Countries). And the three of them have different verison of Oracle. 9.2.0.6 , 9.2.0.8 and 10.2.0.4. The problem happens only with channe

  • Error while invoking infobus form applet

    Hi, Iam trying to deploy a InfoBus form applet created using JDeveloper 3.0 to IIS server in windows NT. I deployed the applet as follows. 1) I created EmpTest.jar file which consists of InfoBus form applet code files which I created using JDeveloper

  • PS CS6 Extremely slow and sluggish. Brush tool delay.

    Hello everyone. I own a copy of Photoshop CS6. Switching from Photoshop CS to CS6, I have found this version to be extremely slow and I can not find a reason why it is like this. It is impossible for me to work on it. Problem: Slow performance, when