Jump to content

Riceman

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Brazil

LabVIEW Information

  • Version
    LabVIEW 7.1
  • Since
    2005

Riceman's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. File Path: is the whole path to the file where you want to write the data to. If you don't wire it, a File Selection Dialog will popup to ask that to the user. Append to File: is a control input that decides wheter to Overwrite the contents of the file (or create it if file does not exist) everytime it's called or to append (add) the data to the end of the selected file. TRUE - appends to selected file; FALSE - creates or overwrites the selected file. New File Path: is an output that returns the actual path of the file, in order to know which path was selected by the user in case File Path is not wired. If File Path is wired, New File Path will be equal to it. When you click any input/output with your secondary mouse button, a floating menu appears. In this floating menu the is a submenu called 'Create'. In it you can create constants, controls, indicators for the input/output. If you select constant, it is always created with the default value of the input, so if you don't want to change that value, there is no need to wire it. Are you using the DAQ Assistant? How are you measuring your data (one sample at a time, N samples, continuous)? If you are reading One sample at a time you need to wire the output of your DAQ assistant to a Signal Collector (found in the Signal Manipulation Palette) in order to accumulate the samples you read. Also, a good tool to find out what is going on is setting a breakpoint somewhere before the error occurs and check out what's going on using probes and step-by-step execution. To set a breakpoint click the block where you want with the secondary mouse button and select 'Set Breakpoint' on the floating menu. To add probes you can do it before running the vi in the same floating menu ('Probe') or by clicking on the wire when the VI is running. By any means, the probe must be added before the program flow passes (executes) the probe position. To step the execution look at the buttons in the toolbar of the block diagram when running.
  2. Already solved my problem. I've opened the block diagram of the Read LVM File and changed it to add a Reset Input. Here are the files I've changed, in case anyone is interested. :thumbup: Download File:post-2459-1121416621.vi Download File:post-2459-1121416645.vi
  3. If you notice on Write LVM File there is a Reset Input, but not on Read LVM File. I have a added a menu to my application through which I can read previous measurements saved by Write LVM File. In the Read LVM File configuration I've set it to ask for the file name. The problem is that it only works once. After it reads one file, when I click on "File > Open" again no file selection dialog appears and no file is read, it is simply ignored. I believe that this behavior is because Read LVM reaches EOF after the first read and does not restart (reset) after being run once. But I could not find a way to reinitialize it as it does not have a Reset Input. Details: The Read LVM File is being called from a SubVI. Any Ideas on how to solve this still using Read LVM File Express VI? Or will I have to create one myself to read the files the way I want?
  4. Another very good tip is to check out in the LabView Help Contents, under the QuickTips Heading. In there, are a lot of good practice tips and shortcuts separated in many categories.
  5. Thanks a lot for your help. :thumbup: It's just that I'm not familiar with using Globals, I always pass arguments.
  6. How exactly do I import this global variable value to my vi and change it?
  7. Is it possible to change the text on File Selection Dialog Titlebar when it is called automatically by a Write to LVM File block? If so, how exactly?
  8. Use the DAQ Assintant to get the data. Configure the channels and type of data in it. It should be found in the Input Palette. If it is not there, reinstall your DAQ Board Drivers, and make sure you include the LabView drivers. To save the readings to a file you may use Write to LabView Measurement File, found in the Output Palette. If you need to treat the data before saving it, you will notice DAQ Assistant will give you one output independently of the number of channels. Use an Unmerge Signals (in the Signal Manipulation Palette). Resize the block to the number of channels you are reading. The order is the same as configured in the assistant. Then Merge Signals again before saving to the file. Use the help for each block for more details. These are just some directions for you to start out. You will go gaining experience as you explore the help and palettes of your LabView. Also, have you installed MAX (Measurement and Automation Explorer)? It has a valueble help for understanding the board configuration.
  9. 2 of them that I use a lot, besides the Ctrl + Double Click on subVI. 1) Ctrl + Drag'n'Drop a Block (or a selection of blocks) duplicates it, even if it is a variable, property node, reference or whatever (and does not create a new one as with Ctrl+C, Ctrl+V) 2) This one I discovered accidentally while performing an operation in 1). If you hold down Ctrl + Turn the Mouse Wheel Up/Down inside Structures like Case, Event, etc. (where there may more than one case), LabView will loop through the structure showing each case as you move the wheel. Please, notice that I use LabView 7.1. Don't know for other versions.
  10. 1) Use a Case Structure to check the validity of the values you want and if invalid in the Output Palette you have a Block to Display Messages or in the Input Palette you have a Prompt User Block with which you can ask for a value in the message. Notice that if you enter into the Box Properties (in case it's for numeric values) you may limit the accepted range of values and type of values (byte, word, long, double, etc.) and LabView will do the validation automatically. 2) If the script must be run only once, Add a button in your front panel, put all the code inside an event structure (except the button), and set it to the Value Change of the button. Thus, when you press the start button the event will be executed once and the VI will end. If you want a Start Button and a Close button (so the program will be open until the user wants) create another button and add an Event Case to the same Event Sctucture. Put it all (including the buttons) inside a While Loop, and from within the Close Button Event Case link a "True" constant to the Loop Stop control.
  11. Correction to my last post: The method I use did not work because when I resized the array some elements "jumped" to the other rows. I had to use the 2 FORs method to avoid dynamic Array Reshape and initialize with the final size already. I also had problems with the build array, that's why I started using the Insert Into Array VI. Thanks, everyone, again!
  12. This last suggestion of yours was the solution I've found before I've got any answer. The thing is that this method includes some case structures and comparisions in the middle of my block diagram that I would like to avoid. Either I have to make 2 FORs (one to find the greatest array, then initialize the 2-D array, and another to add the rows of arrays to it) or 1 FOR (which is the solution I've used) with a case inside checking whether the next array is greater then the dimensions of the 2-D array and if so resize the 2-D array to fit the new one. So, I've waited for suggestions to know whether there was a "cleaner" (without so many cases and comparisions and much less wiring) and more efficient (less time and processing consuming) way to do this. Thanks everyone for your help!
  13. My problem is: I have a dynamic number of arrays, each one with different length (size). If I initialize a 2-D Array and then "Insert Into Array" inside a for loop, from the second iteration on all arrays (if greater than the first one) will be truncated to the size of the first array. What I need is a data structure where I can store a dynamic number of variable size arrays. As if each row of a 2-D array had a different number of columns. I've tried using clusters, but the problem is that they can't be of dynamic size. Any Ideas?
  14. Why don't you simply use a case structure to do what you want? You may create as many cases (for each different condition) as you want, and do your calculations inside each different case.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.