Decimate array

Hello:
My name is Juan Crespo, and I write you from Spain. I have a problem with a Labview application I am developing. I hope you could help me.
In my application, I read an interleaved array from a text file, the number of single arrays that are interleaved is variable, but user must put this number in a numerical control. I wanted the application to decimate the interleaved input array into arrays and then show a graph displaying all the arrays.
My problem is as follows: I have a LV block that I thought useful to my application ("Decimate 1D array"). But this block dont allow to set from a control the number os arrays in which the interleaved one must be divided. Dont you know any way in order to divide an interleaved array in a set of arrays, where the number of elements of this set must be provided from a control?
Well, I thank you very much for your attention... and, please, sorry for my bad english.
Yours Sincerely
Juan Crespo

Hello Juan. How are things in Spain? You can set the number of output arrays by resizing the decimate function. See the attached vi. You have to do this at development time. You cannot do this using a control for the number of arrays and have the function resize at runtime. Maybe you could use a case structure and connect the control to the case. In each case you could have a decimate function that is properly sized. See attached vi, lower section. Hope this helps.
- tbob
Inventor of the WORM Global
Attachments:
Decimate.vi ‏74 KB

Similar Messages

  • Programmatically Resizing 'Decimate Array'

    I am using Labview 6i. Is it possible to programmatically resize the
    'Decimate Array' function? I've got a bunch of data to display in a graph
    and want no more than say 1000 points displayed. I want to only look at
    every other point if I have more than 1000 points and every third point if I
    have more than 2000 points, etc... Is there an easy way to accomplish this?
    Thanks,
    Peter

    You an find a vi in the palette Analyze/Signal processing/timedomain.
    This one does what you want and is called ! decimate array.vi! The function you seem to recall is called decimate 1D array.
    An easier way to find this particular one is to use FIND in the palette. Click on the magnifier glass and type dec and you find both the function and the vi.
    greetings from the Netherlands

  • Can I Bind a Front Panel LED to a specific element in an array of booleans?

    In LabVIEW 2010 I have a string of LEDs. I have and array of boolean values that contain the values that the LEDs should indicate.
    What is the best way to connect the LEDs to elements in the array of booleans?
    Can I Bind a Front Panel LED to a specific element in an array of booleans?
    How is this done?
    Can anyone show sample code?
    Solved!
    Go to Solution.

    Imagine that you have an I/O card that provides 128, 256 or 1024 digital inputs and the requirement is to have an LED on the front panel to represent the state of each digital input. This frequently occurs.
    Wiring that many digital inputs individually is a royal pain and then some !
    It would make sense to have one shared variable as an array of Booleans that represents the status of all inputs and then use data binding instead of wiring each individually. The individually wiring would violate all recommendations on diagram size and fan out.
    Frequently scanned For loops to update all of the LEDS would take alot of CPU time.
    Wouldn't it be MUCH better if PSP could be used to update the LEDs whenever the data changed (as it is supposed to do) ?
    In my case I have a LabVIEW Yaskawa servo driver that provides me information about 16 servo drives that may be connected. I have LEDs on the front panel to represent some of that status for each individual drive. But Yaskawa provides the information on the drives as an array of clusters of information for each drive, which I perform some business logic on and turn into shared array of Booleans to feed the LEDs (and some banks of switches as well).
    Unfortunately LabVIEW does not seem to have any way to bind the LEDs (and Switches) to individual elements in the shared array of Booleans. It is just not that smart. Even with only several banks of 16 LEDs and Switches, wiring them individually using Decimate Array of Index Array functions is a royal pain and makes the block diagrams very large. It would be much worse and almost unreasonable to do if the size of the information was much larger.

  • Adding time stamp to table/array

    Hi,
    In my posted VI I am displaying some collected temperature data on a table.  What I am having trouble with is getting the time data to work properly on the table.  When I set the include time data to true, it reads out the time as 1904 etc. I'm not sure if it's possible for me to include a time stamp in my array because when I try to convert a time stamp to a double precision float, the output is still a cluster, and thus cannot be added to the array.  I've also tried to convert the array to a string and concatenate the time stamp on, but the signals input for the table does not accept strings, and because I would eventually like to export this table to a spreadsheet in a file, I don't really want to link the strings to the indicator directly.  I've tried to work with the instrument as well, but when I read time data from it it gives it back in the form of multiple numbers, such as 2008, 8, 28, 13, 30, 31.12 and I can't consolidate it to one number.  Needless to say, I'm a little stumped and am open to suggestions on how to fix this problem, whether its a quick fix or a change in the way I'm trying to record the data.
    Thanks in advance,
    Mike
    Message Edited by mbeenen on 08-28-2007 03:59 PM
    Attachments:
    Automated Thermal Testing Table.vi ‏75 KB

    Here are the sub VI's that I'm using.  The inner while loop is designed so that the loop will halt immediately when stopped, and not have to finish its current iteration, as the iteration period is intended to be rather long.  I may modify the program to have a programmable start/stop time later, but this is at least my temporary solution.  The purpose of the decimate array function is to seperate out the channel label from the actual data so they can be placed as headers in the Excel function.  The intent was likely not clear with the lack of the SubVI's.  Overall, the display table on the front panel is no longer necessary, it was just for me to see how the table was working in the early stages of development.
    The one issue I had with your suggestion is the fact that I the build waveform function only accepts a 1-D array for the waveform input, and with multiple and variable number of channels being used I'm not sure how I could easily manipulate the data I gather into multiple 1-d arrays.
    As always the help is appreciated,
    Mike
    Attachments:
    Write_Table_To_XL_Mod.vi ‏39 KB
    Conf Temp 2.vi ‏37 KB
    EZ Temperature.vi ‏20 KB

  • Split commas delimited into 1D complex array

    I have comma delimited string in this format
    [0.866405665874481,0.127425819635391,0.983153462409973,-0.0711551383137703,0.955700755119324,-0.27884304523468,0.787182509899139,-0.501964211463928,0.512355387210846,-0.687117278575897,0.177220240235329,-0.777789652347565,-0.0876994803547859,-0.792799115180969,-0.324512422084808,-0.736825287342072,-0.517065346240997,-0.627932071685791,-0.666604995727539,-0.471743047237396,-0.767350137233734,-0.287838608026505,-0.819185018539429,-0.0853987112641335,-0.81872695684433,0.123056441545486,-0.761552691459656]
    The data contains pairs of complex numbers.  The first 2 numbers is one pair, next 2 numbers one pair, next pairs.....
    How can I extract the pairs of number and make it into a 1D complex array?
    This is the expected output:
    (0.866405665874481,0.127425819635391),(0.983153462409973,-0.0711551383137703),(0.955700755119324,-0.27884304523468),(0.787182509899139,-0.501964211463928),(0.512355387210846,-0.687117278575897),(0.177220240235329,-0.777789652347565),(-0.0876994803547859,-0.792799115180969),(-0.324512422084808,-0.736825287342072),(-0.517065346240997,-0.627932071685791),(-0.666604995727539,-0.471743047237396),(-0.767350137233734,-0.287838608026505),(-0.819185018539429,-0.0853987112641335),(-0.81872695684433),(0.123056441545486,-0.761552691459656)
    Any gurus pls advise
    Thanks and great day
    Solved!
    Go to Solution.

    I used the Spreadsheet String to Array, Decimate Array, and then Re/Im to Complex.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Delimited String to Complex Number Array.png ‏13 KB

  • Bytes array to double words array

    I have an array of bytes. I need to take 4 bytes at a time to create a doubleword (32bits).
    I am currently using Decimate Array and Join Numbers twice to do this.
    Is there a more efficient way of doing this that I am overlooking?
    Solved!
    Go to Solution.

    nyc wrote: I do have to perform endian manipulation. The information is little endian. My original information is a string from a TCPIP read. My current attempt is to convert it to a bytes array. 
    Can you explain in more detail what I would do in this case?
    As I noted, you can use the Unflatten From String. Since the data is coming from a TCP Read you can wire that directly to it:
    Message Edited by smercurio_fc on 06-15-2010 09:19 AM
    Attachments:
    byte array to integer array_BD.png ‏8 KB
    byte array to integer array.vi ‏18 KB

  • ARGB to RGB, array processing performance

    I'm trying to use a 2D picture control to display rapidly changing data - I need a decent frame rate.  I'm using the Cairo graphics library to generate the bitmap I want to display and then using a dll call to LabVIEW:MoveBlock to get it to display.  The bitmap is fairly large (720x1366) but Cairo and the MoveBlock seem pretty efficient and their performance is fine.
    The problem is that I need to convert the frame (a 1D array of U32, representing ARGB) to an array of U8 representing R then G then B. This is then converted to a string and sent to the 2D picture control to display.
    I'm using this VI to do the conversion.
    The ARGB and RGB arrays are preallocated.  However, the performance still sucks.  At the moment I'm getting about 16 frames a second and this section of my main loop is taking four times longer than everything else put together.  All I'm trying to do is strip out the alpha channel!  I've tried using masking and bitshifts rather than the split number blocks - no benefit.  I've tried pulling back the original frame as an array of U8 (A then R then G then B) and then using the decimate array and interleave array blocks to filter out the A bytes.  It was slower.
    Any ideas?
    Luke

    The array going into the shift register is already preallocated to the right size (number of pixels * 3).  The ARGB array is sized to the number of pixels.  I've tried various splitting solutions, but it seems the cost of resizing the array into a linear array so I can convert it into a string to send it to the picture control is too great. 
    Here's the code in context:  The ARGB array is grabbed using MoveBlock, processed to just get the RGB values and then formatted to be sent to the picture control.  The picture control is updated after the frame blank is detected, which just about gives flicker free updating.  The slow bits seem to be processing the ARGB array and passing the array to the picture control.  I've tried grabbing the ARGB as an array of A, R, G and B (ie bytes) but this doesn't yield any speed up.  I've also tried not processing it at all and telling the picture control to expect a color depth of 32 rather than 24, and, whilst this works (not documented... Grr NI Grr)  it isn't any faster and gets the colours wrong...
    All I want to do is put an ARGB array on the screen quickly... how hard can it be??

  • Splitting array according to its index

    Hi all
    I want to have a "demultiplexer" block that, having one (2Nx1) array as input, will split the data in two (Nx1) arrays as output wether the index of the first array is even or odd......
    At first I tried to implement this with a simple case structure in a while loop:
    But this doesn't work because I can ony run this .vi when the outputs of the case have option "Use default if unwired" set on. And this will produce not a pair of (Nx1) arrays, but a pair of (2Nx1) arrays. The first array will be [value, 0, value, 0, .....] and the second will be [0, value, 0, value....]
    I want to get rid of those zeros....
    Any hints?
    Thanks in advance!
    Solved!
    Go to Solution.

    Try the decimate array function. That's probably all you need.
    Here are a few general comments to your code in general:
    Since the number of iterations is known before the loop starts, you need a FOR loop. No need to wire N or compare the iteration count. It will iterate for all elements in the autoindexing input array automatically, then exit the loop. Also, output indexing on a FOR loop is much more efficient, because the array sizes of the outputs can be determined and exactly allocated before the loop starts. With a while loop, labview cannot do that.
    If you have LabVIEW 2012, you could use conditional indexing on the output tunnels.
    You could wire the remainder directly to the case structure and make one case 1 and the other 0. Less code! (See my signature).
    To check for odd vs. even, a logical AND with 1 is sufficient and more efficient.
    The "-1" belongs before the loop because it needs to be done only once (well, the compiler recognized loop invariant code and will in fact create compiled code as if the "-1" were before the loop, but why not be explicit?)
    When creating a code screenshot, try no to select anything.  These black dotted outlines are distracting.
    LabVIEW Champion . Do more with less code and in less time .

  • Read every 5th (or so) line from a text file.

    How to create software in LabView 6.1 that can do the following:
    1. Read a text file. The date (time stamp, and four numbers – separated by “,”) are stored in lines.
    2. Read every 5th (or so) line. How to read EOF caracter?
    3. Write data (lines) in a new file.

    Quick answer : if your file is not too large, load it in memory as a 1D array of strings, then use the "Decimate array" function, convert back the string array into a spreadsheet string and save.
    See the attached jpeg
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Decimate Text file.jpg ‏17 KB

  • Add multiple simultaneo​us data sources to Continuous Measuremen​t and Logging Template

    I am looking at using the  Continuous Measurement and Logging sample project as a starting point for my project.  The template shows the use of a single data source at a single rate.  In my case I have multiple data sources that will arrive at different rates and need to come together and be logged to the same file with the fastest arrival dictating the log entry and the slower data would be their last values.  It is a slow data collecton process ranging from 1 second to around 10 second sample rate.  More of a monitoring application with logging than a data aquisition application. Since the waveform data type is base-t  plus delta-t and my data arrives at varying rates, my first task would be to remove the use of it and define a typedef for my data. I would use a single logging message loop, but what approach can anyone recommend for the aquisition?  I imagine separate aquisition message loop vis for each data source but what about placement?  Placing them all at the top level vs placing them within a the existing aquisition message loop vi? Any other thoughts or recommendation are appreciated.  Thanks in advance!

    if you want to sample one channel at 10/s and an other one at 1/second....  How is your file going to look like?  Does this mean that for the slower channel you just want to keep the same value for the other 9 values?
    The sampling speeds that you are talking about are really slow.  It would certainly not hurt your hardware to sample eacht channel with the same speed.  And it you really just need one sample every 10 second, you can always decimate you array of values.
    For instance :
    channel 1 : 1 point per second (sample ratio) => 10 points in 10 seconds
    Channel 2 : 1 point per 10 seconds => 10 points per 10 seconds (same sample speed) => decimate array (keep 1+/10 values) => 1 point per 10 seconds
    This is going to be the easy way, or you want to start with parallel loops running, but that's "not that simple" anymore
    Kind regards,
    - Bjorn -
    Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's
    LabVIEW 5.1 - LabVIEW 2012

  • Compiler error out of regs, reg 1239

    I've installed LV2009 and trying to open version  8.6 vi.
    I am getting a pop-up message "Compiler error. REport this problrm to Nationa Instruments Tech Support. out of regs - no spill candidate found, reg 1239!"
    32-bit Labview client  on Win 7 64 bit and Win server 2008 64 bit give same error.
    The code attached.
    Solved!
    Go to Solution.
    Attachments:
    SyncLoc.llb ‏465 KB

    After converting and testing the problematic VI in LV 2009 sp1, I found that the code that worked for me since LV 8.2 and 8.6 is bugged now.  
    I am using an array of waveforms. I apply "Split 1D Array", followed by "Decimate 1D Array" library functions. The resulted array is stripped of the waveform information in LV2009.
    I isolated the bugged piece in the attached VI.
    Is it a bug?
    Attachments:
    Test decimate array.vi ‏23 KB

  • Chart displays real quick

    I am using buffered data acquisition and i acquire at the rate of 20,000 samples per second and i write my data to a binary file. The problem is I view my data in a chart when recording the data. The chart is too fast, I want to reduce the speed of the chart say at around 2000 samples per second but i want to record data at 20,000 samples per second. Is there a way so that the chart displays my data at a slower pace?
    Thanks,
    Oxygen

    see attached vi.
    just pass the data array to the decimate function as illustrated.
    Attachments:
    Decimate array.vi ‏79 KB

  • Send data from GPIB Read Function to XY Graph

    hello
    I'm really new to LabVIEW so this is probably an easy one, but I'm having a serious issue trying to figure this one out. how do I send data from GPIB Read Function to a graph, let's say XY Graph. my data consists of a string of numbers, separated by commas, alternating between X and Y values. for instance:
    0, 0, 0.1, 0.2, 0.2, 0.4, 0.3, 0.9, 0.4, 1.6, 0.5, 2.5, 0.6, 3.6, 0.7, 4.9
    which would graph a parabola. I tried to connect the output (data) of BPIB Read Function to XY Graph, but I get an error. do I have to do something else before I send that data to the XY Graph? thanks for any suggestions.
    r. 
    Solved!
    Go to Solution.

    first of all, thanks a bunch for replying
    I added "spreadsheet string to array function" and it looked OK (I didn't connect anything to 'array type' because I couldn't figure out what those blocks were - I'm really new to LabVIEW"
    I couldn't find "decimate array" so I added "decimate 1D array," which is what my labVIEW listed (I have 8.6). I fed that directly into "express XY Graph," which lets me feed separate X and Y values (or so I assume). but, even though the input to "decimate 1D array" and output of "spreadsheet string to array function" say 'array' - the program is not happy. when I move my mouse over the 'x', the following is the message that I get:
    "you have connected two arrays of different dimensions.
    The dimension of  is 2. 
    The dimension of  is 1." 
    I'm not quite sure what that means. any suggestions what I can do with it?
    Attachments:
    Picture 1.png ‏11 KB

  • MODBUS help needed!

    Hello~
    I've never worked with MODBUS and I'm having a problem communicating with my device.
    The "slave" is an OleumTech WM2000. I'm using a cFP-2020 as the Master.
    The slave writes 32-bit Floating Point data to registers 7001 thru 7012 and I have no idea how to read them.
    I've downloaded the MODBUS vi's and have also tried the "my modbus serial query.vi".
    Perhaps someone could help me set-up a basic query of these registers; that's all I need to do. No writing...
    Thanks.

    With 32-bit floating point, you need to read the pairs of registers (which are 16 bit integers) and join the two bytes together into a 32 bit word.  So with 12 registers, you need to read all twelve and join them 6 32-bit integers.  One way of doing that is to read the entire array, decimate the array into two, and join thte two arrays together into a 32 bit array.
    I am attaching an example where I did that.  I set this up kind of like an action engine where I have some Get and Set commands, for either reading from or writing to registers, and also turned my groups of registers into named group so I could identify them my name in my main VI.
    See attached in LV 8.2.1
    Note that the order of the bytes 16 bit registers matters.  It depends whether the slave is big endian or little endian, i.e. whether the most significant 16 bit word comes first or second.  If the attached example doesn't work, try swapping the wires between the decimate array and the join words function.
    Message Edited by Ravens Fan on 10-06-2008 08:55 PM
    Attachments:
    MB RW Hld Reg CTA.vi ‏46 KB

  • Please help me 2 little question

    Hi all
    2 little questions:
    1)in the count of a read file block how can I insert the EOF(end of file)
    condition? instead of use (as now I'm doing) a fixed integer.
    2)anyway the array that come up is a 1x480 and i want subdivide it in a
    16x30 getting the i-th's 16 elements (the columns) for each of the 30 rows
    I've used the decimate array function but unfortunately I have to know
    exactly the number of rows that I want, is there a way to set the rows with
    a variable number? (getted for example from a digital control)
    Thank you very much to any of you that will dedicate me a little bit of his
    time.

    1) insert the EOF function after the file open function and before the read. Inputs to EOF are the file reference number, an error cluster and two setting. The outputs are a copy of the file reference number, an error cluster and an offset. If you leave the two setting inputs (called I believe, Offset Mode and Offset Position) unwired, the offset output will be the number of bytes in the file. The Read Characters from FIle.vi routine under the File IO palette shows how this is done.2) If you take the number of values in the 1D array and do a MOD n division (where n is the number of columns in the data) the quotient output from the division will be the number of rows. Besure to trap the error condition where the Remainder output is >0. This indicates a partial ro
    w at the end of the data.Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for