The Solution of An Example from A Labview 4.0 Book

I have a "LabVIEW for Everyone - Graphical Programming Made Even Easier" published in 1997 and am learning from it since I am a beginner.  There is an activity (6.7, calculator) on P.177 without instruction, and I cannot figure it out.  Does anyone know the answer for that (screen shot is appreciated)?  Thanks!
FYI, I am using LabVIEW 5.0 on Windows 98.
Bobby

Bobby,
I am curious about the engine control.  How are you controlling that with LV 5? What kind of old DAQ device do you have?  What computer OS works with the devices? What kind of engine? Do you have any documentation on the engine and its controller?
Some very good programmers started out as chemists or mechanical engineers and never took a computer science class.  At the most basic level programming is simply telling that extremely logical device, the computer, what to do.  All you need to do is to think logically and tell the computer exactly what you want it to do.
You do need to learn the language (LabVIEW in this case) and the tools it provides. It sounds like you are trying to take useful steps in that direction.
Plan or design your programs.  Even little ones like the calculator.  Make a list of tasks the program must perform.  For each task define what inputs it needs and what outputs it produces.  Then describe the algorithm, formula, or procedure it will use to generate the desired outputs from the given inputs.  Last, you write the code to implement your design.
A method like this will work for programs like the calculator and can be expanded to very large, complex measurement and control systems.
Try some things.  When you get stuck, post what you have along with a description of what does not work.  The more specific your descriptions, the better the help you will get.
We are here to help you learn.  Most of us are volunteers so you may not always get an immediate response.
Lynn

Similar Messages

  • Is iwork the solution for uploading spreadsheets from a PC to view on a ipad?

    Is iwork the solution for uploading spreadsheets from a PC to view on a ipad?

    So do you think any one at apple can answer this question, instead of having to check out there in the world to see if someone has accidentally figured it out?

  • Is there a way to determine the equivalent ANSI C code from a Labview project?

    I'm a complete beginner to Labview.  I have this fairly complex Labview project that was used to create a DLL which matlab could call to control my PCI-6534 card without having to know the NIDAQmx calls.
    I'm in the process of figuring out how to make those NIDAQmx calls directly from Matlab but I'm not getting the same results as when I call this DLL mentioned above so I thought I'd try to make sense of the Labview project VIs.  I'm starting to make sense of the overall scheme of the VIs, but I'd like to be able to run the project, step through it, and perhaps see the NIDAQmx commands (or something equivalent so I can determine how to call the NIDAQmx commands within Matlab).
    Is this possible to do?
    Thanks,
    Jason
    Solved!
    Go to Solution.

    Yes. The toolbar allows you to turn on highlighting so you can run the VI and see the contents of wires. You can put probes on wires. You can single-step through code. All of this is explained in the LabVIEW Help under Fundamantals -> Running and DEbugging VIs -> Concepts -> Debugging Techniques.
    In regards to the implied question in the title of your post, no you cannot directly convert LabVIEW code to C in the development environment. Yes, there are tools to convert LabVIEW to C, but that's intended for microprocessors.

  • QuickCluster keeps vanishing with Compressor 4 and none of the solutions work, even booting from a clean system disk

    I have a 2009 8-core MacPro with 16gb of RAM. QuickCluster started to disappear about three months ago. Apple support suggested that I log in as a new user and that worked for a while but the QuickCluster disappeared again. I decided to create a new system boot disk with nothing but 10.7.3 and FCPX and Compressor on it, nothing from my previous user settings. That worked for about two weeks and then the QuickCluster disappear as well. I updated Compressor last week and remarkably the QuickCluster returned....until today. Now I am back to using Adobe Media Encoder for fast encodes and I am not happy. Sure it's fast but Compressor is a much better program.
    Before you suggest it: I have used Compressor remover, and Compressor fix from Digital Rebellion - no change. I have trashed library files according to Apple's support pages - no change. Permission repair - nothing. There must be something that is not in the typical pathways that Qmaster uses that is getting corrupted. Any suggestions?

    Thanks for helping. A screen shot of something that isn't there might not be helpful. Let me see if I can describe the problem better.
    Upon opening the Qmaster menu, I have the option to enable QuickCluster which I can do. Then the oddities start: first I get a system administrator password window which never happened before. I am logged in as an administrator and QuickCluster before always just enabled. I enter my password and close the Qmaster window however when I submit a batch, the QuickCluster option isn't there. Sometimes the computer isn't there either! (When that happens I have to trash the Qmaster library files or no rendering at all.) When closing Compressor, the system password window comes up again and if I don't enter it Compressor will not quit. Upon reopening Compressor, after the window asking if I want to enable shared services is clicked yes, the system password window comes up. If I cancel it then the QuickCluster is not enabled and Compressor behaves normally without any more requests for the system password. If I enter the password, the QuickCluster doesn't appear in the submit window and there's a chance the computer won't either.
    This has occured the same way when the computer is booted off my normal system drive or the clean system boot disk that has none of my personalizations.
    - William

  • What sample rate does the 2 channel oscilloscope example (solution wizards labview 5.1 ) acquire data at?

    I am using labview 5.1 and a DAQCard1200. I chose the Solutions Wizard from the LabView starting window. I followed the steps and selected a DAQ based 2 channel oscilloscope. I chose to program scales etc. myself rather than use the virtual channels. My question is, in this program, when I change the timebase, am I changing the sampling rate? What is the sampling rate for that matter? Is it set to the DAQCard maximum? Does it change if I only set one channel to be active? I threw in some code so that I could take a snapshot of the data, but I end up with 2 columns of voltage data but no idea what the sampling rate was. Makes it very difficult to perform any frequency
    analysis.

    Hi, here's a simple program i did a few years ago. Just remember the daq cards only go up to about 100khz(assuming they have'nt changed) max sampling frequency, so your highest frequency will be 50khz to stop aliasing. This proram will let u select your sampling rate and let u select the number of scans to be aquired. I do not know if the spectrum analyzer side will be any use to u, but its there if u need it.
    Stu
    Attachments:
    op_amp_2.vi ‏104 KB

  • Can I call .m files from a LabVIEW executable without the full developmen​t version of matlab installed?

    I have an executable that I am trying to build (and distribute).  Right now, it has Matlab script nodes that call some matlab .m scripts that someone else wrote.  The target PC will not have the full development version of Matlab installed.  Would that work?  I have tried to compile the .m scripts into a DLL, but I can't import that to LabVIEW because of the special Matlab types (*mxArrays).  I have also tried to write a wrapper around that DLL, but with no success.  So now I'm wondering if I can either call the Matlab .m scripts directly from a Matlab Script node OR if I can call my Matlab DLL from within a script node.  OR any other idea someone might have...
    Thanks a lot!
    -Matt Bradley
    ************ kudos always appreciated, but only when deserved **************************

    Simon,
    I looked at MathScript and am considering using it, but one thing that is not clear to me is if I will be able to use my .m files like I can with Matlab.  I call the same Matlab script repeatedly and it keeps track of some information in global variables (for example, the number of consecutive detections).  Can I do that entirely within mathscript or would I have to reload all of the info each time -- if I had to do that, it would mean substantial changes to the .m files ... and that's not an option.
    -Matt
    -Matt Bradley
    ************ kudos always appreciated, but only when deserved **************************

  • Example for loading a csv file into diadem from a labview application

    Hi everyone, i'm using labview 8.2 and DIAdem 10.1.
    I've been searching in NI example finder but I had no luck so far.
    I have already downloaded the labview connectivity VIs.
    Can anyone provide a example that can help me loading a csv file into diadem from a labview application?
    Thanks

    Hi Alexandre.
    I attach an example for you.
    Best Regards.
    Message Edité par R_Duval le 01-15-2008 02:44 PM
    Romain D.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
    >>Détails et Inscription<<
    Attachments:
    Classeur1.csv ‏1 KB
    Load CSV to Diadem.vi ‏15 KB

  • Please, help with Live Audio/Video example from jmf solutions

    Hello,
    I�m desperate looking for a solution for a particular problem.
    I�m trying to feed JMF with an AudioInputStream generated via Java Sound, so that I can send it via RTP. The problem is that I don�t know how to properly create a DataSource from an InputStream. I know the example Live Audio/Video Data from the jmf solutions focuses on something similar.
    The problem is that I don�t know exactly how it works, os, the question is, how can I modify that example in order to use it and try to create a proper DataSource from the AudioInputStream, and then try to send it via RTP?
    I think that I manage to create a DataSource and pass it to the class AVTransmit2 from the jmf examples, and from that DataSource create a processor, which creates successfully, and then find a corresponding format and try to send it, but when i try to send it or play it I get garbage sound, so I�m not really sure whether I create the DataSource correctly or not, as I�ve made some changes on the Live Audio/Video Data from the jmf solutions to construct a livestream from the audioinputstream. Actually, I don�t understand where in the code does it construct the DataSource from the livestream, from an inputStream, because there�s not constructor like this DataSource(InputStream) neither nothing similar.
    Please help me as I�m getting very stuck with this, I would really appreciate your help,
    thanks for your time, bye.

    import javax.media.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import java.io.IOException;
    import javax.sound.sampled.AudioInputStream;
    public class LiveAudioStream implements PushBufferStream, Runnable {
        protected ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW);
        protected int maxDataLength;
        protected int vez = 0;
        protected AudioInputStream data;
        public AudioInputStream audioStream;
        protected byte[] audioBuffer;
        protected javax.media.format.AudioFormat audioFormat;
        protected boolean started;
        protected Thread thread;
        protected float frameRate = 20f;
        protected BufferTransferHandler transferHandler;
        protected Control [] controls = new Control[0];
        public LiveAudioStream(byte[] audioBuf) {
             audioBuffer = audioBuf;
                      audioFormat = new AudioFormat(AudioFormat.ULAW,
                          8000.0,
                          8,
                          1,
                          Format.NOT_SPECIFIED,
                          AudioFormat.SIGNED,
                          8,
                          Format.NOT_SPECIFIED,
                          Format.byteArray);
                      maxDataLength = 40764;
                      thread = new Thread(this);
         * SourceStream
        public ContentDescriptor getContentDescriptor() {
         return cd;
        public long getContentLength() {
         return LENGTH_UNKNOWN;
        public boolean endOfStream() {
         return false;
         * PushBufferStream
        int seqNo = 0;
        double freq = 2.0;
        public Format getFormat() {
             return audioFormat;
        public void read(Buffer buffer) throws IOException {
         synchronized (this) {
             Object outdata = buffer.getData();
             if (outdata == null || !(outdata.getClass() == Format.byteArray) ||
              ((byte[])outdata).length < maxDataLength) {
              outdata = new byte[maxDataLength];
              buffer.setData(audioBuffer);          
              buffer.setFormat( audioFormat );
              buffer.setTimeStamp( 1000000000 / 8 );
             buffer.setSequenceNumber( seqNo );
             buffer.setLength(maxDataLength);
             buffer.setFlags(0);
             buffer.setHeader( null );
             seqNo++;
        public void setTransferHandler(BufferTransferHandler transferHandler) {
         synchronized (this) {
             this.transferHandler = transferHandler;
             notifyAll();
        void start(boolean started) {
         synchronized ( this ) {
             this.started = started;
             if (started && !thread.isAlive()) {
              thread = new Thread(this);
              thread.start();
             notifyAll();
         * Runnable
        public void run() {
         while (started) {
             synchronized (this) {
              while (transferHandler == null && started) {
                  try {
                   wait(1000);
                  } catch (InterruptedException ie) {
              } // while
             if (started && transferHandler != null) {
              transferHandler.transferData(this);
              try {
                  Thread.currentThread().sleep( 10 );
              } catch (InterruptedException ise) {
         } // while (started)
        } // run
        // Controls
        public Object [] getControls() {
         return controls;
        public Object getControl(String controlType) {
           try {
              Class  cls = Class.forName(controlType);
              Object cs[] = getControls();
              for (int i = 0; i < cs.length; i++) {
                 if (cls.isInstance(cs))
    return cs[i];
    return null;
    } catch (Exception e) {   // no such controlType or such control
    return null;
    and the other one, the DataSource,
    import javax.media.Time;
    import javax.media.protocol.*;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.sound.sampled.AudioInputStream;
    public class CustomDataSource extends PushBufferDataSource {
        protected Object [] controls = new Object[0];
        protected boolean started = false;
        protected String contentType = "raw";
        protected boolean connected = false;
        protected Time duration = DURATION_UNKNOWN;
        protected LiveAudioStream [] streams = null;
        protected LiveAudioStream stream = null;
        public CustomDataSource(LiveAudioStream ls) {
             streams = new LiveAudioStream[1];
             stream = streams[0]= ls;
        public String getContentType() {
         if (!connected){
                System.err.println("Error: DataSource not connected");
                return null;
         return contentType;
        public byte[] getData() {
             return stream.audioBuffer;
        public void connect() throws IOException {
          if (connected)
                return;
          connected = true;
        public void disconnect() {
         try {
                if (started)
                    stop();
            } catch (IOException e) {}
         connected = false;
        public void start() throws IOException {
         // we need to throw error if connect() has not been called
            if (!connected)
                throw new java.lang.Error("DataSource must be connected before it can be started");
            if (started)
                return;
         started = true;
         stream.start(true);
        public void stop() throws IOException {
         if ((!connected) || (!started))
             return;
         started = false;
         stream.start(false);
        public Object [] getControls() {
         return controls;
        public Object getControl(String controlType) {
           try {
              Class  cls = Class.forName(controlType);
              Object cs[] = getControls();
              for (int i = 0; i < cs.length; i++) {
                 if (cls.isInstance(cs))
    return cs[i];
    return null;
    } catch (Exception e) {   // no such controlType or such control
    return null;
    public Time getDuration() {
         return duration;
    public PushBufferStream [] getStreams() {
         return streams;
    hope this helps

  • Accessing the Solver AddIn to Excel from LabVIEW

    I would like to be able to set the parameters and run the Solver AddIn in Excel from LabVIEW. I know that from LabVIEW you can install the different AddIn's but is there anyway to access the actual AddIn once it has been installed?

    Hi Karin -
    I believe your answer is ActiveX.
    Briefly, ActiveX allows application a (e.g. LabVIEW) to control application B (e.g. Excel, Word, etc.) programmatically. The kicker is that application B must export that functionality to LabVIEW. We ship an example with LabVIEW that controls Excel via ActiveX, it will give you a head start. We do not provide extended support for ActiveX programming simply because there are literally thousands of applications we could control. Microsoft might be able to shed more light with an Excel ActiveX programmer's reference or some relted document.
    good luck-
    ben schulte
    national instruments

  • Trouble with examples from the website

    Hi
    I was trying to down load couple of examples from your website - Motor
    control, closed loop control system. But have trouble with it.
    I have Labview version 5.1 not 7.
    It gives an error after I unzip the file.
    Are they not compatible with 5.1??
    Pls help
    Krithika

    When you download an example from the NI homepage please always have a look at the "Software Requirements" section. Here you will find the version of the development environment the example was compiled with.
    Many examples are compiled with LV 6.x or LV 7.x thus it's probable that you can't open them with LV 5.x
    Best regards,
    Jochen Klier
    National Instruments Germany

  • When I copy/paste a paragraph from a PDF doc, it pastes with no spaces between words. How can I fix this? I've searched everywhere for the solution but didn't find anyone had this issue.

    When I copy/paste a paragraph from a PDF doc (onto Facebook status bar, for example) it pastes with no spaces between words.  I.e: "The manhadajugofcoolwaterand offeredmeadrink." How can I fix this? I've searched everywhere for the solution but didn't find anyone had this issue. I'm new to Apple so any help will be much appreciated. Thanks!

    I can't speak about this occurring with FaceBook since I don't use FaceBook, but I see the same type of thing when I copy and pasted from websites. It doesn't always happen and I cannot find any particular set of circumstances under which it occurs or does not occur.
    I am merely responding to let you know that it happens to me as well and I have seen no way to correct it. I'm not so sure that there is a way to correct in in that it may have something to do with how the original text is formatted in the PDF or on the website and how it eventually "fits" into the text field or the area in which it is pasted.

  • Sometimes my computer takes too long to connect to new website. I am running a pretty powerful work program at same time, what is the best solution? Upgrading speed from cable network, is it a hard drive issue? do I need to "clean out" the computer?

    Many times my computer takes too long to connect to new website. I have wireless internet (time capsule) and I am running a pretty powerful real time financial work program at same time, what is the best solution? Upgrading speed from cable network? is it a hard drive issue? do I only need to "clean out" the computer? Or all of the above...not to computer saavy.  It is a Macbook Pro  osx 10.6.8 (late 2010).

    Almost certainly none of the above!  Try each of the following in this order:
    Select 'Reset Safari' from the Safari menu.
    Close down Safari;  move <home>/Library/Caches/com.apple.Safari/Cache.db to the trash; restart Safari.
    Change the DNS servers in your network settings to use the OpenDNS servers: 208.67.222.222 and 208.67.220.220
    Turn off DNS pre-fetching by entering the following command in Terminal and restarting Safari:
              defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false

  • I cannot send email over 3G. Receiving email is ok. Using wifi from my landfibre allows me to send email. No idea where to find the solution. Suggestions please. Thanks ia

    I cannot send email over 3G. receiving email over 3G is ok. Using wifi from my landline (glass) is ok. No idea where to find the solution. Suggestions please. Thanks i.a.
    TheOne

    You need a DATA service enabled by your carrier to be able to send e-mail via thier network.  Do you have a data plan with your carrier ?  If so - is it enabled ?
    Can you access internet thru your network (not wifi) ?

  • Is it possible to change the default PDF file name from 'LabVIEW Document.pdf'?

    My application uses the 'Automatically print front panel every time VI completes execution' functionality to print front panels.  When I have my printer set to 'Adobe PDF', a dialog pops up and the default file name is 'LabVIEW Document.pdf'.  Is there a way to programatically set the name to something other than 'LabVIEW Document.pdf'?
    I've already found a solution that manipulates the Windows registry, and I'm looking for another option.
    Brent

    Do a search, as this question has come up before. The solution centered on not using the Adobe PDF printer driver but one that is intelligent.

  • I managed to transfer the music from 1 pc to 1 other pc (to be played by iTunes). Bit didn't fixe the transfer of the meta data (for example the rating). Does anyone know how to use your old playlists, etc..(= meta data) on the other PC? So, please help!

    I managed to transfer the music from 1 pc to 1 other pc (it is played perfectly on the other PC (Windows 7- pc) by the newly downloaded and installed iTunes, version 10.6.1.7). But I didn’t fix the transfer of the meta data (for example the rating). Does anyone know how to use (or import) your old playlists, etc..(= meta data) on the other PC? So, short: how to migrate the meta data from one pc to an other pc?
    It's a pity that it seems not to be possible to import on the new pc e.g. the ratings!!!
    I don't want to start again with rating my (beautiful classical) music!
    Thanks, from Amsterdam, NL

    Did you do the move via Home Sharing, astro?
    If so, perhaps try the instructions from the following post:
    Re: i transfered itunes to my pc playlists did not go

Maybe you are looking for

  • Editing video or audio in increments LESS than 1 frame?

    Case #0183085485 Updated Wednesday, March 21, 2012 7:59:24 PM PDT Opened Thursday, March 15, 2012 4:54:02 PM PDT Status Open - Pending Adobe Response Product Production Premium 5.5 Support contract Adobe Support Program Subject Premiere Pro CS5.5: Ed

  • SSMS 2014 to SSRS 2012 WMI connection error / Invalid namespace

    We have swapped out the default SSRS2012 Windows Authentication with our own FormsAuth custom authentication. From SSMS2012, I can connect to our reporting server instance via FormsAuth without issue. From SSM2014, I can't connect to our reporting se

  • Control parameters for data transfer

    Hi! There are no data in SBIW source system - General Settings - Maintain Control Parameters for Data Transfer. How does it have an influence on loading data?

  • Ipad mini unable to enter code to unlock

    When I turn on my ipad mini I am unable to enter a code to unlock the ipad mini and it shows searching at top left of screen,  is it possible I have a virus and how do I get rid of it? Thanks

  • Places Spinning Beach Ball

    I am unable to assign a location to a picture. Places have been enabled in the preferences. When I select a picture and open the Info column, I start typing the name of a location (for example, the Bus Stop bar on Olive Way in Seattle), the spinning