How do I create an n-dimensional constant array?

I have a code where I am trying to mathematically manipulate arrays in a while loop. I was planning on multiplying an array by a constant, but on the second iteration the constant actually ends up changing to an array of different constants*. Therefore, I'd like to define an array of constants of one value. I did this using the "array constant". I stuck a double point constant inside and wired it to me terminal. One problem I'm having is that the size of the array isn't matching my other array. In the box to the left of my double point constant value, I put in "10" because the size of the array I want is 10. Instead of generating a 10 element array with all the same constant, it generated...uhhh...nothing. I received null: []. What am I doing wrong?
Next, is there a way to define the length of this array based on the length of another array? For example, the array I want to work with is 10 elements, but it might not ALWAYS be 10 elements. I'd like to put in some flexibility so that if it changes to 30 elements, the constant array I create will be smart enough to know it also needs to be a 30 element array.
Also, I apologize for not including a picture. The computer with LabVIEW is not the same as the computer connected to the internet. Furthering my frustration, the only way I can transfer data from that computer to this one results in encrypted data unless I burn a CD. Ohhhh working for the federal government is a delight sometimes.
*The constant changes to an array of constants because the process is iterative. I start with a guess for the constant, but then that guess gets updated by the values in the array, forcing it to become an array itself.
Solved!
Go to Solution.

The problem is that when I do a shift register in my while loop, the constant is changed to an array. So to make the loop work, I want to initialize the loop with an array of constants.
This is a simplified version of what I'm trying to do in pseudocode:
C_old = [0.99, 0.99, 0.99]  // I shortened this to a 3 element array for simplicity
C_new = [0.99, 0.99, 0.99]
Re_old = [1E5, 1.2E5, 1.5E5]
while (abs(C_old-C_new) < 0.001)
     Re_new = Re_old*(C_new/C_old)
     C_newer = a bunch of stuff as a function of Re_new
     C_old = C_new
     C_new = C_newer
     Re_old = Re_new
So in my while loop, I have C_old, C_new, and Re_old on the boundary as shift registers. I don't really need the constants to be arrays, but the problem is that when I do C_newer as a function of Re_new (which is an array), I get an array of constants. So to make the shift registers work, they need to be the same datatype, so I need to initialize an array of constants at the beginning as C_old and C_new and also to test the values to stop the while loop.

Similar Messages

  • How to create a matrix with constant values and multiply it with the output of adc

    How to create a matrix with constant values and multiply it with the output of adc 

    nitinkajay wrote:
    How to create a matrix with constant values and multiply it with the output of adc 
    Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How do we create a PY Constant

    Hi,
    How do we create a PY constant in T511k table and how do we link that with a specific field of a screen.
    That means when we update the field of a screen then the PY constant should be updated.
    Kindly through some knowledge in this issue.
    Thanks,
    Tanu.

    Thanks for your valuable suggesstions.
    My requirement is like,
    I have to edit a PCR where the PY constant has required to be  compared with the existing value. For this calculation I need this constant( Value) to be in v_t511k table. I know we can create that in this table.
    I have created in the same procedure but when I changed some value in my required field in the  screen, the PY Constant is not been updated autometically.
    Do we have to create any link between them so the the constant is updated autometically or we need to update the constant each time in the t511k table.

  • How can I create a Teststand (1.0.3 or 2.0) distribution without having all of the VIs (6.0.2 or 6.1) in the same directory?

    How would I create a Teststand distribution of LabVIEW VIs and maintain the test VI directory structure that I want?
    I know that I have to use the application builder to build the custom operator interface, configure it as an ActiveX server, and launch the Teststand engine installation.
    The only problem that I have is using the VI packager which puts all of the test code and sequences in a single directory.
    This gets quite messy. There are just over 1000 files in the neatly orgainzed directory structure that I have now. (this includes support files, dll's and such)
    I have read brief appnotes on configuring the ini file(s) to use
    the vi search path that I want, but have not been able to get this to work. Maybe I'm not updating the correct ini? or have to include each subdirectory?
    I have currently upgraded from LabVIEW 6.0.2 to 6.1
    I am currently using Teststand 1.0.3
    I have not upgraded to Teststand 2.0 yet because I have not decided if I want to build at this revision or go through the extra work to mass compile Teststand at LabVIEW 6.1, install the LabVIEW 6i VI Packager Fix, and update the new Teststand LV operator interface with my changes.
    At present, I'm not getting the results I want and am quickly running out of time. I have to deliver the project by the 14th of July 2002.
    Sorry for the long question and thanks for you help.

    Hi,
    I dont think the problem is really related to using the VI Packager but more to how the OI interface applications relates to labVIEW File constants.
    If you are using the LabVIEW as the ActiveX Server then there should be no problems. But if you are using the Runtime LabVIEW server such as 'TestStandLVRTS' then the file constant would return different paths.
    eg for the Default Path you would get 'C:\TestStand\Components\User\RuntimeServers\LabVIEW' instead of 'c:\Program Files\National Instruments\LabVIEW'.
    Attacted is an example to show how to change these paths when using your runtime server. Unzip this into your teststand examples folder
    Put the INI file in the location of the \user\runtimeservers\labview folder.
    Change the labview adapter t
    o use TestStandLVRTS.exe. You can run the example sequence from either the OI or seqeditor.
    I hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    UsingLVOI.zip ‏20 KB

  • How do you create an array without using a shell on the FP?

    I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
    So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
    do not want to go that route.)

    Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
    I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
    If I seem a tad green... well I am.
    I hope you understand the LabVIEW environment and icons are still very new to me.
    Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
    e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
    "I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
    the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
    Attachments:
    Initialize_Settings.vi ‏55 KB
    Save_Settings.vi ‏52 KB

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • How do I create an ACR custom lens profile if camera exposure can't be set to manual?

    How do I create an ACR custom lens profile if camera exposure can't be set to manual?
    I ask this question for the Nokia 808 PureView 41MP camera. It produces stunning image quality but exposure can only be controlled via EV +/- compensation. I need a lens profile to correct for vignetting to get even skies in panorama (which turn out stunningly otherwise). There is no profile for the Nokia 808 PureView I am aware of and I'd like to produce one.
    Is the Adobe profile creator able to correct for varying exposure using EXIF or overlapping parts of the chart or background?
    Or would the Adobe profile creator ignore EXIF if I use studio flash to enforce a constant lightning situation, even if shutter speed would vary (aperture is constant and ISO can be set constant, just not the shutter speed)?
    Or did Adobe produce a profile internally they can share?
    Thanks.

    If you read the first post, this is the camera-app of a 41MP Nokia Pureview 808 camera-phone, so maybe someone could write a new camera app but the phone is Symbian OS which is dead, making that unlikely.
    http://www.digitaltrends.com/mobile/the-skeptics-guide-to-nokias-808-pureview-five-reasons -41-megapixels-are-not-a-gimmick/
    http://www.digitaltrends.com/mobile/the-nokia-lumia-820-and-lumia-920-too-little-too-late/
    It would probably be easier for Adobe to rewrite the LPC to allow vignetting to be computed from a single shot of a blank wall without a target in the shot, than to have someone rewrite a camera app that allows manual exposure.
    Another idea about how to get the phone to keep a constant exposure would be to experiment with putting darker and lighter objects in the field-of-view away from the target area to make the camera metering adjust things so it’s exposure is the same from one shot to the next.  This would take some doing but should work, unless the LPC uses the part of the frame that doesn’t contain the checkboard target in its computations.
    You’re basically varying the scene around the target so the camera takes the same exposure of the target each time.

  • Create a two dimensional table in Acess

    Hi,
    I am working with a database and the toolkit "the database connectivity tooset". I know how to create a new table from labview, but is it possible to create a "two dimensional" table from labview, i.e, where one table in Microsoft Access is linked to another one. I know how to do it in access, but it should be possible in program to crate a new table and this one has to be linked to another one then, just like the others. Does someone know how to do it??
    Thank you!

    Hi
    I assume you are not so familiar with databases, are you?
    First I want to comment your previous post:
    well I have a table for a product that contains, say different data for the product, i.e. the date of the test, who is responsible for the test, where it was performed. Also, linked to the date (I guess it is the primary key), there are also some data related. so in my table in the database, next to the date, there is a "+"-sign, so I can open up the page of all the data related to the date.
    Well, did you create this database on your own? So you must have created two tables (table one with fields Datum, Responsible & Cost and table two with fields Place1, Place2, Place3 & Place4). Then you must have dragged on field from one table to another field in the other table in the "Relations" view of access. Doing so, you created a relation. Due to this, access now knows how this date is related and displays the "+"-sign. You can not assume that the date is the primary key.
    In fact you do not have a "2D" table, but just different datasets from two tables connected to each other. This connection is created by relations.
    So, if I know would like to create a new table in my program (each product has its own table, so a new product=a new table), I would also like to create this "data" sheet that is connected to the data. Bu how do I do that?
    I can easily just create a new table (i.e. a new product), just using the "DB Tools Create Table.vi". But I guess it is when I actually want to add the data to the database, where I create the "data" sheet? Using the "DB Tools Execute Query" and a SQL statement with INSERT INTO, is that the way to go?
    As mentioned before, this "datasheet" is just a dataset from a second table which is made displayable by the relation. So if you're question is "how to create a relation using LV", you are quite on the right way. First create two tables one of which has to contain a field where the primary key from the other table is linked to. Then you have to set a PK in one table (using SQL statements) and then build the relation (also using SQL statements). I can't tell you, if you have to define the foreign key in the second table too.
    Have a look at the MS-Access help on how to assign relations and how to define primary keys. There may be something to take care off. Basically standard SQL should do - but using MS you never know .
    As this is somehow complicated, I always create the database structure in MS Access and that's it - afterwards all is done programatically (write and read data). Usually I don't open the database again with Access unless there is a special task.
    Hope this helps you a little bit otherwise come and ask again.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How do I plot average sensor values against a constant array (length positions)?

    I have 7 microphones from which I'm taking the RMS value.  They are physically in a line and I'd like to plot their values vs. their positions.  How do I do think.  I'm assuming I'll need to use the XY plot, but I'm not sure how to turn 7 signals into a single array and how to create an array of constants for the positions.
    Solved!
    Go to Solution.

    I don't know if I could catch your point, but I tried to buid a vi to plot 7 mic inputs as each mic was related to an specific X position. In the next while cycle, new mic values will be plotted offseted by the lenght of the arangement.
    Well, I hope this helps you.
    Leo
    Attachments:
    Mic_Array_01.vi ‏35 KB

  • How can I create a clickable matrix that each cell leads to a different view?

    Hi everybody,
    I want to create a matrix in my Sharepoint homepage that each of its cells will be clickable and lead to different filtered results. I use Sharepoint 2010.
    Currently I am thinking of creating the filtered results using views and then  inserting the links of the views in a two dimensional matrix. I want this matrix to be present in my homepage and those who click on its sells will be directed to the aforementioned
    views. 
    First I would like to know if it's possible to do this, whether there is a better way and finally how I can create this matrix. Any help is welcome! 
    Cheers,
    Sakis

    Depending on which version of SharePoint you're using, this (InfoPath) may not be the best way.  Otherwise, here's how I'd do it:
    Create buttons with custom look and feel...  make them look like your matrix... then, use rules to "switch views" to whatever view you want them to go to based on which button they click.  Buttons can be used to run rules and switch views, really
    easily.  Then (depending on what version of SharePoint you have... MOSS vs WSS, 2007 vs 2010 vs 2013) you could put a "Form webpart" on the home page to display your form when people visit the page. 

  • How do I create a print button to print a specific range of the document.

    How do I create a print button to print a specific range of the document.  I've found JavaScript to print a specific page, but a range or even multiple ranges.  Form is created in Adobe 9 Pro.  Any help would be truly appreciated! 

    Sure, I'll give it a test.  Its just that I have a 128 page form that not all of it needs to be printed.
    Currently,  I have an index page where I want to set up a print button queues per form, however there are several form scattered throughout the document that make up a specific section, but it does not require printing the entire document.  Does that make sense?
    I did find this JavaScript during my reseach, but have not be able to get it to work.
    var pp = event.target.getPrintParams() ;
    pp.interactive = pp.constants.interactionLevel.full;
    pp.printRange=[[1, 1], [3, 4]];
    event.target.print(pp);

  • How can I creat or open an excel file in labview?

    I am using Labview 7.1 and report generation toolkit. I got the example code from this address :"Creating a report in Microsft excel using the labview report generation toolkit"
    But seems this example only can creat report when the excel file exist, otherwise it will get error code 7.
    How can I creat a new file if it doesn't exist and open the file if it exist? Can I creat a report without openning excel because I need to creat more than one report and check it after the test.
    Thanks

    Simply use the "Open/Create/Replace File.vi, and wire a constant "Create / Replace".
    Wire a path/filename and make sure the name ends with the extention .xls
    If you have multiple lines (likely), place aech line in an array and use the "Array to Spreadsheet String.vi" before sending it to "Write to file.vi". Don't forget to close the file.
    Hope this helps..
    JLV

  • How do I create a reference to "this vi"

    how do I create a reference to "this vi"

    Place "current VI path constant" (from the "file i/o.. file constants" palette) and wire it to "open VI reference" from the "application contol" opalette.
    Message Edited by altenbach on 09-23-2008 11:22 AM
    LabVIEW Champion . Do more with less code and in less time .

  • How to APD create on Stock Cube (0RT_C37)??

    Hi,
    How to APD create on Stock cube (ort_c37). Pls help me for APD create on non cumulative???
    Thanks

    As long as the dimensionality of the cube has the same contents (even if it is in a different order), the reports will continue to work in my experience. If you add a new dimension, the report doesn't have a selection set up for that dimension and therefore is now invalid and all reports must be recreated against that cube. Adding new levels above the leaf level of your dimensions and adding new measures should not corrupt their reports.
    I would suspect after a few iterations of losing their reports, your users will learn to test and specify their needs more completely to ensure they have all of the required dimensions.
    Alternatively, you can set up one cube that only consists of calculated measures that has ALL of the dimensions of your AW. Create calculated measures that then point to these other cubes which may not have all of the dimensions. In this case, the report is using the "calculated" measures whose dimensionality does not change even if you add a dimension to one of the underlying cubes.
    For example, if you have Time, Customer, Product, and Geography in your AW, but you choose to only have Time and Product in a cube called YEAR_ITEM_PLAN that holds your targets for the year, and they later decide to do their plans Time, Product and Gegoraphy, you could recreate the YEAR_ITEM_PLAN cube to include Geography and as long as the calculated members cube you created earlier always had geography, their reports should continue to function.

  • How to assign the two values for constant (same key)

    How to assign the two values for constant (same key)
    CONSTANTS: c_pstkey TYPE  bschl VALUE '09',
               c_splgl  TYPE  umskz VALUE 'I',
               c_buzei  TYPE  buzei VALUE '001'.
    using BSCH1 again i have two asign vaue
    can you just let me know
    Edited by: sravya_se38 on Nov 23, 2010 12:14 AM

    You can create a structure for that constant .
    You can define in this way
    CONSTANTS : BEGIN OF c_pstkey,
                             01 TYPE bschl VALUE '01',
                             02 TYPE bschl VALUE '02',
                          END OF c_pstkey.
    and can access using...
    c_pstkey-01, c_pstkey-02 ........

Maybe you are looking for

  • E-Fax Problems

    On my old ibook I downloaded and easily used e-fax messenger to send and receive faxes. I upgraded to a MacBook pro with Tiger 10.4.6 and now when I go to send a fax, OS 10 shuts down and said it shut down unexpectedly and do I want to report it to A

  • CS6 installer in Ukrainian language

    Turned Adobe site and all of download assistants, application managers and download sections upside down, but couldn't find Creative Suite CS6 installer in Ukrainian language. When I try to use application manager / Download Assistant - it gives me R

  • Creative Suite Production Premium - *NO* Manuals

    I unfortunately mis-posted this issue on a thread on another creative suite product. I have Creative Suite 3 Production Premium and a nice large box of manuals. I LOVE the hard copy manuals. They are a nice reference when you need to find something o

  • Can default target naming convention be altered?

    Dear All We are using Oracle EM Grid Control 11gR2 to manage databases in the environment which hosts about 60+ databases in 11.0.1.7, 11.0.2.1 and 11.0.2.2 versions.. More often than not due to application restrictions, we are forced to use the same

  • Function to create DO in Merchandise Distribution

    Hi, Can some one tell me the function which is called during Goods Receipt for Central PO using allocation? I cann find where to debug. I need to see if the DO can be created as per site order. Currently, the DO is created as per warehouse order in F