Storing multiple Sine waves in one LVM

Hi all,
actually i got a very short question. I can't believe that i'm unable to fix the problem by my own... But that's the way it's suppose to be I think.
The question:
Just a simple Sine wave in a while loop, connected to a graph. When I run it i see a lot of different Sines in the graph window, let's say 100 sine waves. How can I write this data from ALL THE 100 SINE WAVES to 1 LVM?
When i store the data right now I only see 1 Sine Wave and not all the waves i've seen in the graph window.
I hope somebody can help me with this. Cause this is just a simple example of a very complicated programm i'm working on.
Thanx for spending time on this stupid problem!

Could you post your VIs?  I am not sure what you are talking about.
Thanks,
Bob Young
Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
DISTek Integration, Inc. - NI Alliance Member
mailto:[email protected]

Similar Messages

  • How to view different sine waves in an array and make an fft of these and display it in one graph

    How can i cannect the output of my mathscript in the Spectral Measurements VI SIgnal Input. I'm having a problem since the output of the mathscript file "D" is DBL 2D. I dont know how to convert this data type in order to be connected to the signal input of the Spectral Measurements VI. I also want that the waveform graph connected to output of the Spectral Measurements VI, will display the FFT of the three sine waves in one graph.
    Attachments:
    1.JPG ‏32 KB

    Duplicate
    LabVIEW Champion . Do more with less code and in less time .

  • "How do I generate a sequence of waveforms, like first a sine wave, then a square one, and say again a sine wave?"

    "Hello everyone, I hope someone can answer the following question. How do I generate a sequence of different waveforms, with different attributes?
    Like, i want to generate a sine wave for some time, then a square pulse of some width and then again a sine wave of some other time. Finally I want to repeat this sequence. I'll really appreciated it if I can get an answer soon. Thank you!

    From the previous comments I am assuming that your waveforms are arrays, rather than the waveform data type. I am also assuming that the sine waves on both sides of the square wave are the same signal.
    If so then I suggest a slightly different approach. 1. Generate your sine wave, rather than the empty array. The length should be the length of the entire end signal.
    2. Generate the square waveform. You can either generate it at the length you need, or you can generate a much larger square wave, and then use the Array Subset VI to get the portion you need. Which method you use depends how you want to implement the whole method.
    3. Use the Replace Array Subset VI to place the portion of the square wave at the location (index) of the original sine wave you ge
    nerated.
    The result of this method will be an array that starts with your sine wave, and then at the index you choose it will place the square wave of the length you want right into the signal, and then finish up with the sine wave for the rest of the signal.
    Evan Collier
    Application Engineering
    National Instruments

  • Generate n sine waves and add them together

    Hi
    I'm new to Labview and I want to generate n number of sine waves and add them together to form one signal that can be out put through a DAQ card. Each successive wave frequency will be the multiple of a base wave all will be the same amplitude.
    This to me suggested a For loop with a sig generator  and a passback in it but when I tried this it threw an error because the dt were different.
    Any help will be appreciated.
    Thanks

    Show us what you did.
    LabVIEW Champion . Do more with less code and in less time .

  • Simultaneous updation of sine wave using 2 PXI-6711 cards using RTSI Trigger

    Hi ,
    How to generate continuous sine wave using two pxi-6711 cards at same time without any phase shift using traditional nidaq functions.
    Regards,
    satya

    In LabVIEW, go to Help>>Find Examples. Navigate to Hardware Input and Output>>Traditional DAQ>>Multiple Device. There is an example there called "Two E Series Shared Scan Clock". That example is for analog input, but you should be able to modify it to be for analog output. Basically you will just have to share the scan clock from one board(master) and use it as an 'external' clock for the other board(slave).
    -Alan A.

  • Simultaneous analog output 1k sine wave and data acquisition

    Although many topics of simultaneous analog output and input can be found in NI Developer Zone, I have not found a case similar to my project. I'm trying to generate a 1kHz sine wave by using the analog output of NI DAQPad-6070E, and acquire one channel input signal simultaneously. I found most of the examples can not work properly above 100Hz. Any suggestions are welcome. Thank you.
    Jian

    I have sucessfully solve the problem when I observed the increase of
    scan backlog number. Simply increase the buffer size of AI/AO and you
    can make the 1kHz sine wave output and data acquired properly.
    On Tue, 3 Feb 2004 09:03:07 -0600 (CST), jujian wrote:
    >Although many topics of simultaneous analog output and input can be
    >found in NI Developer Zone, I have not found a case similar to my
    >project. I'm trying to generate a 1kHz sine wave by using the analog
    >output of NI DAQPad-6070E, and acquire one channel input signal
    >simultaneously. I found most of the examples can not work properly
    >above 100Hz. Any suggestions are welcome. Thank you.
    >
    >Jian

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to.

    Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to. 
    I'm NOT in any way a Terminal Services expert and I need help trying to get an application program working in a multi-user environment.
    The issue is that the printer changes for every user that is logged in. The application needs to print NOT to the default printer, but to a "special" printer which is selected in the application... let's call it a label printer to simplify the explanation.
    You have your default regular printer, easy for the application to find that one, and then you have a special printer that labels get printed onto. The application needs to know what printer is the label printer. So we allow the user to select that in the
    application and the selection is stored in a config file in 
    C:\ProgramData\mfgr\prog\setting files
    I don't have access to the application so I can't change how this works.  
    In the "regular" world, selecting the label printer driver to use should be per machine, NOT per user. When a new user logs into a machine, the physical printer doesn't go "poof" and a new printer suddenly appear. Same printer for all
    users.
    Yet in terminal services, the physical machine is "merged" with the virtual machine on the server. And there can be many users logged in at the same time. So each users real machine (and real printer) is injected into the "fake" terminal
    services machine. The name of the printers is made unique for each user. So the printers DO go "poof" and change names depending on the user logged into terminal services.
    So user "A" logs in and sets up the application to print to "LabelPrinterForUserA" (or whatever the name of the printer happens to be), that setting is stored in the ProgramData subfolder, and all is well. Later, user "B" logs
    in, and when they print, the application tries to print to "LabelPrinterForUserA" which doesn't exist for user B or is only accessible by user A. If user B re-configures, that breaks it for user A. 
    SOLUTION 1: The way that /should/ work (in my mind) is that you define one "generic" printer in Terminal Services... call it "Virtual Label printer" and when the user wants to print to it, the print job gets re-directed back to whatever
    physical printer is actually connected to their local workstation. There is a map of virtual printer to actual printer depending on the current user. The application is told once to print to "Virtual Label Printer" for all users.
    SOLUTION 2: Or... there should be some way to make the ProgramData sub folders separate per user. E.g. when user "A" tries to access:
    C:\ProgramData\mfgr\prog\setting files
    they actually get 
    C:\UserData\UserA\AppData\mfgr\prog\setting files
    and user "B" gets
    C:\UserData\UserB\AppData\mfgr\prog\setting files
    So the question I have is: Does either of those solutions exist hidden somewhere in the setup of terminal server? Or is there another way around this issue that I don't know?

    I don't really have a "for sure" answer to this, but because people here can't seem to deal with a question that hasn't been answered I'll provide the best answer I did receive from ServerFault.com user Nathan:
    I can feel your pain with using old software on terminal servers ...the solution I've come up with definitely won't scale as it requires some manual configuration, but I've gotten this method to work with our label printers (which require to be
    printed to an LPT port...yep, that old).
    Share your USB-connected printers to the network on each machine. Then, have the user log in on aunique session for each of them
    (a TS account cannot be shared among computers for this to work) and install a network printer pointing to the USB one they shared. Try to use a DNS name to account for possible DHCP movements.
    After, it should work. Each user can do this since display names can be identical as long as the ports are different (which they are).
    This was clarified by the following series of comments:
    I think you are on to something here, and I originally advised the admin to do this. The problem he ran into is that it setup the printer names in the TS as "printer on usersworkstation"
    and he could not rename it except to change the "printer" to whatever. E.g. the "on userworkstation" remained. I believe there is another way of installing the printer which avoids this, but I can't find it. Ages ago, one used to do NET
    USE LPT2 \\computer\printer password /USER:domain\user /PERSISTENT:YES and then tell the driver to print to LPT2 –  James
    Newton Mar
    17 at 16:21   
    @JamesNewton That's actually the exact method we used. The way around the "network printer" part is to install it as local printer and map it to a TCP/IP port that way. –  Nathan
    C Mar
    17 at 16:28
    You mean in the case where the printers are TCP/IP connected and not local USB / LPT to the users workstation? That makes sense. Wonder if this will work for USB connected printers... –  James
    NewtonMar
    17 at 16:35   
    @JamesNewton You'd share the local printer on the client's PC then on the server connect via TCP/IP to it. You'd need static addresses or use DNS names if DHCP, though. –  Nathan
    C Mar
    17 at 16:51
    Ah. Yes. I see. Looks like the LPT thing should work even with a USB connected printer:superuser.com/questions/182655/… –  James
    Newton Mar
    17 at 17:09   

  • Question on the result of using Wavelet transform on sine wave

    Dear all,
    I have apply the Wavelet transform on a 50Hz sine wave. The result is shown below. But I don't understand the result of Wavelet transform. Anyone can help me? Thanks.
    Victor

    You seem to have something against the FFT, yet continually compare other transforms to the "sweet spot" for the FFT, ie. sinusoidal and periodic functions.  Without trying to write a treatise on the subject (there are many fine books), a few observations.
    The primary purpose of any transform pair is to perform a rotation in function space, for the FFT we are familiar with the time domain and frequency domain.  The wavelet domain is not so simple.  The FFT is very effective for sinusoidal and periodic functions, ie. those that have no localization in the time domain.  If you have a sinusoidal input, the infinite signal in the time domain can be reduced to a pair of numbers (one if you take the power spectrum).  That is very efficient, other periodic signals can usually be approximated by a small number of terms.  
    Wavelets on the other hand are chosen to be localized in both the time domain and the wavelet domain.  If you look at a periodic signal like your sine wave, you see a mess, and to recreate the input signal you will need to keep an awful lot of the points around for the inverse transform.  You may be able to set the last 1/3 to zero, but that's it.  To see an effective application, you should be looking at localized functions, like an impulse.  Put an impulse into the wavelet transform and you get something that is still a bit complex, but pretty simple.  The FFT of an impulse contains components at all frequencies and the wavelet clearly wins in this case.  
    On paper, there is usually a clear choice, and the FFT almost always wins for spectral estimation.  On the other hand, if you are trying to compress "real world" data, for instance an image, then there is a choice to be made.  Standard JPEGs are FFT based, you take the FFT and try to keep just the largest frequency components.  As you probably notice, edge contrast usually suffers, especially at higher compression.  With wavelets, it is typical to have slightly better contrast leading to better preservation of details for a given compression.
    In short, my opinion is that transforms are useful when they simplify the problem.  Wavelets do not simplify the representation of a sine wave. 

  • How can I Write a sine wave in an Access-fil​e?

    I measure a sine wave in LabView 6i. How can I write the datas automatically to an Acces-file, at the same time?
    In my program, I managed it with Execute SQL.vi, I change a number in a SQL statement(String) -> after this I push start and then it writes the statement in the Access-file.
    The problem is, it writes only one data per measurement in the file. How can I write all datas in the Access-file and measure the wave at the same time?
    Thanks for help!
    Attachments:
    getwave.vi ‏49 KB

    On the waveform palette, you will find a "to components" vi that you can break out the array of the waveform. You can then, using a for loop write all of the values from the waveform.
    Better yet, there are examples in the database toolkit manual on pages 3-13 to 3-15 that deal with reading arrays (and even has a waveform example).
    Good luck!

  • How can I calculate the frequency of a 2-4Hz three phase sine wave in 50msec?

    I want to calculate the frequency of a sine wave using either all three phases or just one, but I want to know the frequency after 50 msec, I don't want to have to wait for a full period.

    I have a mathematically sound suggestion but I do not know how well it will work in application. Most period measurements measure the time between a full period or several periods to eliminate the error introduced by the measuring device. Essentially the device error is made insignificant.
    Mathematically you can do much more but there is a tradeoff between recording less information and knowing (or assuming) some values. For instance, if one knew the amplitude and could calculate the derivative of the signal, one could calculate the frequency. A sine wave can be represented by the function: A sin (BX)=C , where A is the amplitude, B is the frequency, C is the present measured value. If the equation is solved for X, we get: X=(sin^(-1)(C/A))/B. The d
    erivative of the first equation is AB cos(BX)=C. If the equation for X is now substituted into the second equation, we get, AB cos(B (sin^(-1)(C/A))/B)=C. Solving for B we get B=C/(A cos(sin^(-1)(C/A))). Remember, we already know A and C, so we are done.
    Practically every step and assumption in the above argument introduces possible error which will affect the accuracy of the frequency. Unfortunately it is a trade off and that is why at least a whole period needs to be measured to get an accurate frequency.
    Jeremy Braden
    National Instruments

  • Want to create a multiple Purchase Order using one file source

    I'm want to create a multiple purchase order using one source file. I want to read the file source create LINES in a purchase order and when the Vendor code changes I want to Add the purchase order and then create a new purchase order and Add LINES and so on.
    Right now I get  Item.no is missing [POR1.ItemCode][Line 2]

    Here is a code sample
        Private Sub testcode()
            Dim strOrdplanFile As String
            Dim oLineRec As SAPbobsCOM.Recordset
            Dim strLine As String = ""
            Dim ItemName As String
            Dim Quantity As String
            Dim RequiredDate As String
            Dim SupplierType As String
            Dim ShipTo As String
            Dim Vendor As String
            Dim oPurchaseOrder As SAPbobsCOM.Documents
            Dim bAddPOrder As Boolean = True
            Dim bPurchase As Boolean = False
            Dim sSQL As String
            Dim iReads As Integer = 1
            Dim iCurrentPurchaseNumber As Integer = 0
            Dim bErrors As Boolean = False
            Dim retCode As Double
            oPurchaseOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
            strOrdplanFile = strFolderLocation & "ORDPLAN.TXT"
            If File.Exists(strOrdplanFile) And FileLen(strOrdplanFile) > 0 Then
                Dim sr As New StreamReader(strOrdplanFile)
                strLine = sr.ReadLine()
                txtPurRec.String = "0"
                oFormStatus.Update()
                Try
                    Do
                        Vendor = strLine.Substring(0, 8).Trim()
                        ShipTo = strLine.Substring(12, 8).Trim()
                        SupplierType = strLine.Substring(26, 1)
                        ItemName = strLine.Substring(27, 20).Trim()
                        Quantity = strLine.Substring(94, 8)
                        RequiredDate = strLine.Substring(206, 9)
                        oLineRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        sSQL = "SELECT PrcrmntMtd, CardCode FROM OITM WHERE ItemCode = '" & ItemName & "'"
                        oLineRec.DoQuery(sSQL)
                        If oLineRec.RecordCount() > 0 Then ' if it exists add the record
                            If oLineRec.Fields.Item(0).Value.ToString = "B" Then
                                If (bAddPOrder) Then
                                    oPurchaseOrder.CardCode = Vendor
                                    oPurchaseOrder.DocDueDate = RequiredDate
                                    'Add first item to the purchase order
                                    oPurchaseOrder.Lines.ItemCode = ItemName
                                    oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                    oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                    oPurchaseOrder.Lines.Add()
                                    bAddPOrder = False
                                    bPurchase = True
                                    iCurrentPurchaseNumber = iCurrentPurchaseNumber + 1
                                    txtPurRec.String = "R: " & iReads & " W: " & iCurrentPurchaseNumber.ToString
                                    oFormStatus.Update()
                                Else
                                    'compare CardCode to make sure Vendor hasn't change
                                    If (oPurchaseOrder.CardCode.CompareTo(Vendor) = 0) Then
                                        'Add item to the purchase order
                                        oPurchaseOrder.Lines.ItemCode = ItemName
                                        oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                        oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                        oPurchaseOrder.Lines.Add()
                                    Else
                                        'vender code changed
                                        retCode = oPurchaseOrder.Add()
                                        If (retCode <> 0) Then
                                            SBO_Application.MessageBox(oCompany.GetLastErrorDescription(), 1, "OK", "", "")
                                        End If
                                        oPurchaseOrder.CardCode = Vendor
                                        oPurchaseOrder.DocDueDate = RequiredDate
                                        'Add first item to the purchase order
                                        oPurchaseOrder.Lines.ItemCode = ItemName
                                        oPurchaseOrder.Lines.WarehouseCode = ShipTo
                                        oPurchaseOrder.Lines.Quantity = CDbl(Quantity)
                                        oPurchaseOrder.Lines.Add()
                                        bAddPOrder = False
                                        bPurchase = True
                                        iCurrentPurchaseNumber = iCurrentPurchaseNumber + 1
                                        txtPurRec.String = "R: " & iReads & " W: " & iCurrentPurchaseNumber.ToString
                                        oFormStatus.Update()
                                    End If
                                    iReads = iReads + 1
                                End If 'new
                                strLine = sr.ReadLine()
                            End If
                        End If
                    Loop Until sr.EndOfStream
                Catch ex As Exception
                    MsgBox(ex.Message, MsgBoxStyle.Information)
                End Try
                If (bPurchase) Then
                    lRetCode = oPurchaseOrder.Add()
                End If
                sr.Close()
                swLogFile.WriteLine("Purchase orders stored : " & iCurrentPurchaseNumber)
                oPurchaseOrder = Nothing
            End If
        End Sub

  • My Sine Wave File sounds different in Logic than iTunes

    I am working on creating musical compositions with embedded sine wave patterns (which I am generating in a foriegn application). These sine waves are designed to entrain the brain to different frequencies to facilitate in stimulating meditative states of consciousness in the listener.
    Unfortunately, when I import my sine wave audio file (in .wav format) Logic changes it and the rhythm is frequency is twice as fast! When I play the file in iTunes it sounds just the way I generated it, but when I import it into Logic through the audio bin or simply drag and drop onto the arrange window, it sounds different and cannot work for the precise control I require for my compositions.
    Does any one have any idea why this is happening or what I can do to import my audio file without changing it?
    Thank you so much for any ideas/assistance,
    Devlin Dewitt Donnelly

    Hi DD Smooth,
    you should check sample rate settings on your original audio files and make them match the sample rate settings on your logic project prior to importing them. Sounds like you are generating 48khz .wav files in your foreign app and Logic must be set to 44.1khz by default. Or the other way around
    Message was edited by: Imol

  • How to change the phase by 90 deg of a sine wave

    Hi
    Does any one know how to change the phase of a sine wave by 90 degrees.
    Mal

    Hi Malkoba,
    Thank you for your post.
    Having looked at your VI I can say that you have created the correct inputs to the 'Sine Waveform.vi'.
    However the dial you had created had no affect as it was not wired into it the 'Sine Waveform.vi' on the block diagram.To fix the problem I have wired the 'Phase' dial into the 'phase' terminal of the waveform generator. This now changes the phase of the sine wave during runtime.
    The dial also now has a digital display (numeric box below it)- this can be used to read the dial's value, or feed in specific values into the control.
    Please find a modified version of your VI below.
    Regards,
    Field Sales Engineer | National Instruments | UK & Ireland
    Attachments:
    NI_phase shift sine.vi ‏31 KB

  • Best fit lines for loops and sine waves

    I am trying to find a best fit line that will work for sine waves and loops (hysteresis loops). I can get the sine wave just fine, but when I switch to a hysteresis it just puts a line across the middle (I assume because of the 2 y values for every x). I am doing data acquisition that will take in both forms and graph them. I tried a polynomial fit and it doesn't work at least the way I implemented it and I tried a few others but it looks like they are all function based. Also, my y values are coming out of a Bessel filter. I don't think this would be affecting anything but I thought I would put it in here incase it does.
    Did I miss one that I haven't tried that works for my application?
    Thanks
    Patrick

    RiversDaddy wrote:
    ... currently I am doing it by looping and reducing the error towards zero to fit the amplitude and phase. (I know the frequency).  If this is what you are looking to do then I will help, or should I be doing things differently? All of the functions I have found to filter or extract tones seem to introduce a larger frequency of phase error than i get using this method, but am I missing something?
    "looping" is a bit vague. What is the actual algorithm to find better estimates (e.g. levenberg marquardt, etc.)
    What problems did you have with extract single tone. Can you show some data where the results from it are not good?
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for