Record data in array of while loop

The program scan the attachment as I have a question.
1. In the Display section of the program will scan the new row to the size of the array is defined. What should I do to keep the array and display the results until a positive signal to the new row, where the display is unique in that row.
2. The color of a line graph to determine how a single color.
Thank you
Attachments:
วันนี้.vi ‏317 KB

Thank you  for guide me.
I made software program that scans atomic (scanning tunneling microscopy, STM). The image you display it. Is the signal driving the PZT. I have two signal generators to drive the PZT motion function in axis X and axis Y. By scanning in the program will require two signal generators to create a graph.By scanning in the program will require two signal generators to create a graph PZT driving signal is associated with both a scanner and scan back to the picture show
 I asked what program I was doing. I suppose the signal is scanned by the sine generator to the signal as the tip of the PZT to create an image atoms. I want to set the peak of the sine signal to a pixel if I get to 256 cycle. How to create a graph time axis(X) on the graph shows the signal sine wave 256 cycle and the axis Amplitude(Y) was 256 cycle.
Attachments:
Process of STM.png ‏117 KB

Similar Messages

  • Keeping data on graph once while loop exits

    Hi, I have the attached vi where I am reading in Bluetooth data, plotting and saving the data. My inner while loop is the one performing the plotting, where I have the error out of the Bluetooth Read function wired to the boolean control of the loop. If for some reason the connection gets distrupted, the loop exits and the BT automatically reconnects.  The problem here is that one the inner loop stops, the graph plotting the data clears.  I am looking for a way to keep the data plotted on the graph, so once the connection is lost and reconneted again, the data continues plotting from where the connection was lost.  I cannot figure out how to do this, I tried to use local variables to plot the data outside the graph while the loop is running but that didn't work. Can somene provide me assistance?
    Attachments:
    test.vi ‏55 KB

    moderator1983 wrote:
    My bad...!!
    I was working late night and misinterpretate "Write to File" express VI with "Build XY Graph" express VI..!!
    Anyways the attached code should work fine.
    Here, I took care of some of your Rube Goldbergs.
    I'll try to get something written up to show a Queued Message Handler...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    I love clean code more.vi ‏53 KB

  • Question in ABAP syntax, read & insert data from internal table, while loop

    Hi, SDN Fellow.
    I am from Java background and learnt ABAP, I don't usually write much ABAP code.
    I am trying to implement the following logic in a RFC now.
    I have one z-custom database table, the structure as the following:
    It has two columns, with these sample data.
    Says datable table is ZEMPMGRTAB.
    EmployeeID,ManagerID
    user10,user1
    user9,user1
    user8,user1
    user7,user2
    user6,user2
    user5,user2
    user4,user2
    user2,user1
    The logic is this:
    I have a input parameter, userid. I am using this parameter to have a select statement to query the record into export table,EXPTAB 'LIKE' table ZEMPMGRTAB.
    SELECT * FROM  ZEMPMGRTAB
      into table EXPTAB
       WHERE  EMPLOYEEID  = USERID.
    Say, my parameter value, USERID ='USER4'.
    Referring to the sample data above, I can get the record of this in my EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    Now, I want to iterately use the EXPTABLE-ManagerID
    as the USERID input in SELECT statement, until it has no return result. Then, insert the new records in
    EXPTAB.
    In above new loop case, we will get this table content in EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    I kind of think of the pseudocode logic as below:
    (These may not be a valid ABAP code, so I need help to convert/correct them)
    DATA:
    IWA TYEP ZZEMPMGRTAB,
    ITAB
    HASHED TABLE OF ZZEMPMGRTAB
    WITH UNIQUE KEY EMPLOYEEID.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = USERID.
    *Question 1: I cannot insert a internal table to export table, it is *incompatible type, what is the alternative way fo this?
    *Question 2: How can I access thedata of the internal table like this,ITAB-MANAGERID? As if I can, I would do this:
    * IWA-EMPLOYEEE = ITAB-EMPLOYEEID. IWA-MANAGERID = IWA-MANAGERID. INSERT IWA INTO TABLE EXPTAB.
    * Question 3: Is the 'NE NULL' - 'not equal to NULL' is right syntax?
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    * Question 4: Is my WHILE loop setup right here? And are the syntax right?
    WHILE ITAB NE NULL.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = ITAB-MANAGERID.
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    REFRESH ITAB.
    ENDWHILE.
    Assume all the syntax and logic are right, I should get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    If I have a new entry in datable table,ZEMPMGRTAB like this:
    user1,user0
    My pseudocode logic will get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    user1,user0
    I truly appreciate if you can help me to validate the above syntax and pseudocode logic.
    Thanks in advance.
    KC

    Hi,
    FUNCTION ZGETSOMEINFO3.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(USERID) TYPE  AWTXT
    *"     VALUE(FMTYPEID) TYPE  AWTXT
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      APPROVERT STRUCTURE  ZTAB_FMAPPROVER
    *"      ACTOWNERT STRUCTURE  ZTAB_FMACTOWNER
    DATA: T_RESULT TYPE STANDARD TABLE OF ZTAB_FMAPPROVER.
    **Question 1: For this line, I got an error says "Program ''USERID" *not found. Is the syntax right, as the USERID is a parameter for the function.
    perform add_line(USERID).
      ENDFUNCTION.
    form add_line using i_user type ZTAB_FMAPPROVER.EMPLOYEEID
                        changing T_RESULT TYPE ZTAB_FMAPPROVER.
    data: ls_row type ZTAB_FMAPPROVER.
    * Get record for i_user
    select single * into ls_row from ZTAB_FMAPPROVER
    where EmployeeID = i_user.
    if sy-subrc NE 0.
    * Do nothing, there is not manager for this employee
    else.
    * Store result
    QUESTION 2: I am still got stuck on this line of code. It still *says that "T_RESULT" is not an internal table "OCCURS n" *specification is missing. I thought the line: "T_RESULT TYPE *ZTAB_FMAPPROVER" means declare internal table, T_RESULT as type of ZTAB_FMAPPROVER". Am I understand it wrongly?
    append ls_row to t_result.
    * Call recursion
    perform add_line using ls_row-ManagerID
                              changing t_result.
    endif.
    endform.
    Thanks,
    KC

  • How do we save three 1D arrays in while loop as an excel file? I used build array, waveform. I could not make it work.

    I have three separate 1 dimensional arrays in a while loop. I need to combine these arrays and save as a excel file outside the loop.
    My second question is that is there any emergency STOP button in Labview so that when I press that button, it cuts all the power going to the system. Thanks...

    Just a comment on the Stop button.
    It's not really a good idea to rely solely on a software emergency shutdown. Especially if the shutdown is to prevent some type of hazardous condition to the people running the test. The problem is that if your application or PC in general is having some type of problem, it may not be able to shut everything down as needed.
    You should always have a mechanical �Big Red Stop Button� that you can hit to cut power to everything. In addition to the button, I usually do have LabVIEW monitor things and if conditions are not looking good, have it automatically shut things down. This has always worked good, and I can�t remember any time I�ve actually had to use the big button, but it�s nice to know it�s there.
    VERY IMPORT
    ANT:
    Using the �Abort� button on the LabVIEW toolbar is NOT the thing to do. This stops your application where ever it is in its execution and does not allow it to finish or execute any shutdown code you might have put in. A �Kill� button on the front panel works well. I�ve put a single Boolean terminal in its own little While loop to monitor it. It usually writes to a digital line that�s holding a relay on that will cut the power.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Dynamically passing data into a running while loop from a DAQ assist. in an ouside while loop

    Hello,  I'm currently a student working on a senior project and I'm trying to do a state machine that will turn off and turn on a compressor depending on time and coprocessor failure. 
    In the run state, wich is #1 on the case structure box I placed the DAQ assist.  Which takes in data from an accelerometer.  If the accelerometer's value is above the limit four times it will end the loop or if the time runs out it will end the loop. 
    The problem I am having is that i need to run four compressors.   I was thinking about having four case structures all within the outside loop, but I can only have the DAQ assist in one location.  This means that I now have to move the DAQ assist out of the run loop or run all four compressors in the one case structure.  If i remove the DAQ assist.  I can only get it take in data once when the loop starts and never again.  I understand why, but is there a way to dynamically pass data froma  DAQ assist.  into a running loop? 
    Also on a side note, i can't find a tutorial on how to really create a state machine using Enums.  Does any one know where to find this. 
    I have attached my curent program.
    Thank you for your help,
    Ryan
    Attachments:
    TEST STAND STATE MACHINE 2-28-07.vi ‏288 KB

    in labview choose file->new... then pick standard state machine and there are instructions.
    you can create a custom control and either use an enum, text ring or menu ring.  Edit the values and then save the control and drop into your vi and you can wire this to your case structure
    - James
    Using LV 2012 on Windows 7 64 bit

  • Can not pass data after while loop

    Hello.
    I have created a VI for my experiment and am having problem passing data outside a while loop to save on an excel file. The VI needs to first move a probe radially, take data at 1mm increment, then move axially, take data radially at 1mm increment, then move to the next axial position and repeat. It would then export these data to an excel file. The VI is a little complicated but it's the only way I know how to make it for our experiment. I have tested it and all the motion works correctly, however I can not get it to pass the data after the last while loop on the far right of the VI where I have put the arrows (Please see the attached VI ). Is it because I'm using too many sequence, case, and while loops?  If so, what other ways can I use to make it export data to the excel file?
    Any help would be appreciated. 
    Thank you,
    Max
    Attachments:
    B.Dot.Probe.Exp.vi ‏66 KB

    Ummmm .... gee, I'm not even sure where to begin with this one. Your VI is well .... ummmm... You have straight wires! That's always nice to see. As for everything else. Well... Your fundamental problem is lack of understanding of dataflow programming. What you've created is a text program. It would look fantastic in C. In LabVIEW it makes my heart break. For a direct answer to your question: Data will not show up outside a while loop until the while loop has completed. This means your most likely problem is that the conditions to stop that specific loop are not being met. As for what the problem is, I don't even want to start debugging this code. Of course, one way to pass data outside of loops is with local variables, and hey, you seem to be having so much fun with those, what's one more?
    This may sound harsh, and perhaps be somewhat insulting, but the brutal truth is that what I would personally do is to throw it out and to start using a good architecture like a state machine. This kind of framework is easy to code, easy to modify, and easy to debug. All qualities that your code seems to lack.
    Message Edited by smercurio_fc on 08-17-2009 10:00 PM

  • How come my local variable is not updating it's value with respect to what's happening in the while loop?

    Hello,
    I am trying to extract data out of a while loop as my declarations update with respect to the iteration number. I have attempted to use both local variables and shift registers, but with no luck.
    I have also done the following example: http://www.ni.com/white-paper/7585/en and it works like a charm.
    I attached the PNG file with local variable declaration circled in red. Will attach a VI in the next respnose.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Local Variable.png ‏366 KB

    OK, looking at the code...
    Can you explain what it is supposed to do? What's the purpose of the value property node read which only seems to update an indicator.
    The inner while loop should proably be a FOR loop, because the number of iterations is known before the loop starts.
    Your use of formula nodes seems overly complicated.
    LabVIEW Champion . Do more with less code and in less time .

  • While loop termination...

    So I have this long sequence of frames and I have an while loop which runs outside of the sequence. I want to to terminate the while loop after the last frame of the sequence  has completed. I tried to wire a logic true constant from the last frame to the  while loop but it does not  work because the while loop seems to terminate prematurelly.  Could someone sugguest  a way of dealing with it? I can' figure out a solution for some reason.

    Then the answer is, as with the other case, data dependency. If you wire a value out of your sequence frame into the while loop you've established a data dependency for the while loop since the while loop needs to know what the value of that wire is before it can execute, and the value is not set until the sequence frame ends.
    Since your while loop houses an event structure, generate an event at the end of your sequence frame to stop this parallel loop. A crude solution: Wire a True value to the "Value (Signaling)" property of the "Stop" control, and change the event case from "Mouse Up" to "Value Change". You should make sure to initialize the "Stop" button to False at the start of your program, and to change the mechanical action to "Switch When Released":
    Attachments:
    Example_VI_BD6.png ‏6 KB

  • SqljCircle &JdbcCircle Class(while loop)

    Have compiled and run these two clsses but it only seems to be inserting one record from a RADIUS_VALS table into an AREAS table when it should be looping three records, any ideas why the while loop does not seem to be working??
    Philip

    Do not compare String contents with "==". Use equals().

  • How can I write waveform data from a while loop?

    Alright, I have a NI-5122 high speed digitizer that I need to acquire 10,000 waveforms. I am currently using the NI example code "niScope EX Multi Record Fetch More Than Available Memory.vi" to do this and then onto that later. I set the Number of Records to 10,000, min record length to 8192, and the min sample rate to 100M (S/s). On the Fetch vi,  I set it to get a 1D Dbl array and then send it to the while loop edge for auto indexing. What I want is to take each waveform and write it to a file next to the previous waveform not append it to the bottom of the previous one. I can do 100 and sometimes 1000 waveforms with my current setup and then use "write measurement to file.vi" to save the data, but at 10,000 it says that the memory is full. I have 256 MB on the NI-5122 and 4G of memory on my host computer. My reasoning is that if the NI-5122 can hold all that data then why can't my host computer. I have tried to fetch using 2D Dbl and transpose that matrix and send the data to "write measurement to file.vi" inside the loop and append the data that way, but when I do this the card does not acquire any data. Which seems like a software problem. I know this is probabaly worded poorly, so just post a response if further explanation is needed.
    Thank you.

    Hello,
    It sound like you might have received a LabVIEW: Memory is full message.  Are you also graphing this data as it is being acquired?  Are you building an array inside the loop?  At the 100 MS/s rate, you are using a lot of memory to acquire, graph, build and transpose array data, and then write to file.  If you are saving to file and do not necessary need to see the data, I would suggest taking the graphical indicator out of the code.  Please review some of the KnowledgeBases linked below about the LabVIEW: Memory is full.
    KB 36QD14V3: Why Do I Receive a "Memory is Full, VI Stopped at Loop Tunnel 0xXXXX" Error?
    KB 3ZNDGRS9: LabVIEW "Memory is Full" Error
    Samantha
    National Instruments
    Applications Engineer

  • Convert "1D array of dynamic data" to "Dynamic data" after auto-indexing with loop

    Hi -
    I have a question about how exaclty auto-indexing works with the Dynamic Data type when exiting a while loop. I'd like to use the DAQ assistant to record data through an analog input (on the MyDAQ) and then replay that data through an analog output. This works fine if I use the DAQ Assistant to record data for a set amount of time:
    However, I run into trouble when I try to use a While loop with a stop button to record data for an arbitrary amount of time. I set the dynamic data tunnel out of the While loop to "Indexing", but then when it exits the loop, it becomes "1-D Array of Dynamic Data" instead of just "Dynamic Data", and get a broken wire when I try to connect it to the input of the DAQ Assistant. I've also tried converting the dynamic data to Array and Waveform data types inside the loop, but have the same issue (they become 2D Array and 2D Array of Waveform respectively when leaving the loop). Try as I might using blocks like Convert to/from Dynamic Data Type, or Array Subset, I'm unable to get them back down to just Dynamic Data or Waveform, which will be accepted by the DAQ Assistant:
    One other small note - I'm not sure if using the "Build Array" function with a shift register accomplishes exactly the same thing as just auto-indexing an array out of the loop - so I've tried both, but still have the broken wire issue.
    I'm assuming this is just a simple issue of using the right block to convert "1D Array of [Something]" to just plain [Something]. Any help appreciated.
    Attachments:
    PWM_FlatSequence.vi ‏101 KB
    PWM_FlatSequence_While.vi ‏129 KB

    I have been facing problem for all temperature values placing the Write to Measurement File outside the Loop. 
    In Error message it says" Source: 1D array of dynamic data and Sink: Dynamic data".
    Is there any means of convering 1D array of dynamic data to dynamic data?
    I would highly appreciate any help.
    Attachments:
    Temperature Logger.vi ‏110 KB

  • While loop and data acquisition timing worries

    Hello everyone, 
    I apologize in advance if this is a silly question, but I could not find the answer around here. 
    I have made a VI to record continuously from 64 analog channels at a 5kHz sampling rate. I then stream this data to a tdms file. The data acquisition and write functions are in a while loop. 
    I the same loop, I have a bunch of other loops, that each run on their own wait timers to help limit the amount of memory they take up. I am now worried that this may somehow affect my data acquisition timing.
    If I put a bunch of timed loops within another loop, does the outer loop run at the same pace as the slowest of the inner loops? And could that mess up my sampling rate?
    I have attached my VI, in case what I just wrote makes no sense at all. 
    Thanks for any tips...
    Attachments:
    Record_M8viaDAQv3.vi ‏237 KB

    Well, looking at your code you will only write to your TDMS file one time. You have multiple infinite loops within the main/outer loop. That means that the main loop will only run a single iteration because it cannot complete an iteration until all code within it completes. With at least two infinite loops inside the loop it will never complete. Not too mention the only way to stop your code is to hit the stop/abort button. NOt a very good way to stop your code. As someone once said using the abort to stop your code is like using a tree to stop your car. It will work but not advised.
    As Ben mentioned try to understand data flow better. You have unnecessary sequence frames in your code where normal data flow will control the execution sequence.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How should I set up my VI so that I can use the linear fit coefficient data analysis program, when my values are coming from while loops within a sequence structure?

    I'm attempting to create a calibration program, using the printer port, and a Vernier Serial Box by modifying a calibration program designed for the serial box.
    There are six calibration points, and to collect them, I have it controlled by while loops so that the numbers are taken when a button is pushed, and this is inside a sequence structure so that I can get the six different points. I feed these numbers into two different arrays (for x and y values) and then try to use the linear coefficient analysis on these points, but the values for the slope and intercepts it returns are not correc
    t.
    If I cut out the array and coefficient analysis, and feed the same numbers in directly without the while loop and sequence structures, it produces the proper values... I don't know why the numbers it is producing are different, and I'd really like to know.
    Thanks,
    Karinne.

    I would use a data manager sub-vi that would be called by each from of the sequence structure that produced a data point. The data manager sub-vi could auto append new items or could place items in a specific entry of an array. Later on when you want to calculate the linear fit, call the sub-vi to return the array of values.
    Stu

  • Iteration Speed issue when Indexing 3D array wried to a while-loop

    Brief Description of my Program:
    I am working on the real-time signal generation by using LabView and DAQmx (PCI-6110 card). My vi reads the big data file (typically 8MB txt file containing about 400,000 samples (complex double precision). Then, the signal is pre-processed and I end up with a huge 3D array to feed while-loop (typically 3D array dimension is N x 7 x M where N & M >> 7). Inside the loop, that 3D array is indexed and processed before the results are written to the DAQmx outputs. I have a speed issue when indexing the large 3D array (i.e, 3D array having a large sub-array size). My while-loop could not run fast enough to top-up the DAQmx AO buffer (at the output rate of 96kHz). It could run faster only if I use smaller 3D array (i.e, smaller-sized sub-arrays). I do not quite understand why the size of 3D sub-array affects the rate of looping although I am indexing same sub-array size at each iteration. I really appreciate your comments, advices and helps.
    I include my 3D array format as a picture below.
    Question on LabView:
    How does indexing an 3D array which wires to the while-loop affect the speed of the loop iteration? I found that large dimension of sub-arrays in the 3D array slows down the iteration speed by comparing to indexing the same size of sub-array from smaller-sized sub-arrays of the 3D array to perform signal processing inside the while-loop. Why? Is there any other way of designing LabView Program to improve speed of iteration?
    attachment:

    Thank you all for your prompt replies and your interests. I am sorry about my attachment. But, I have now attached a jpg format image file as you suggested.
    I had read the few papers on large data handling such as "LabVIEW Performance and Memory Management". Thus, I had already tried to avoid making unnecessary copies of data and growing arrays in my while-loop. I am not an expert on LabView, so I am not sure if the issues I have are just LabView fundamental limitations or there are any other ways to improve the iteration speed without reducing the input file size and DAQ output rate.
    As you request, I also attach my top-level vi showing essential sections such as while-loop and its indexing. The attached file is as an image jpg format because the actual vi including Sub-VIs are as big as 3MB in total. I hope my attachment would be useful for anyone who would like to reply my question. If anyone would like to see my whole vi & llb files, I would be interesting to send it to you by an e-mail privately and thus please provide your e-mail address.
    The dimension of my 3D array is N x 7 x M (Page x Row x Column), where N represents number of pages in 3D array, and M represents the size of 1D array.  The file I am currently using forms 3D array of N = 28, & M = 10,731.  Refering to the top-level vi picture I attached, my while-loop indexes each page per iteration and wrap-around.  The sub-VI called "channel" inside the while-loop will further index its input (2D array) into seven of 1D arrays for other signal processsing.  The output from that "channel" sub-VI is the superposition of those seven arrays.  I hope my explaination is clear. 
    Attachement: 3Darray.jpg and MyVi.jpg
    Kind Regards,
    Shein
    Attachments:
    3Darray.jpg ‏30 KB
    MyVI.jpg ‏87 KB

  • How do I make one while loop that runs 1 piece of data at a time?

    I have a question about a while loop.  Currently, I have 4 or 5 dynamic data lines that I would like to run through a while loop that will tell me if the data is within a certain range or not.  However, the ranges are different for each piece of data, and I dont know how to do each one separately.  Do I have to make 5 different while loops? Thanks!

    pg22aw wrote:
    I have a question about a while loop.  Currently, I have 4 or 5 dynamic data lines that I would like to run through a while loop that will tell me if the data is within a certain range or not.  However, the ranges are different for each piece of data, and I dont know how to do each one separately.  Do I have to make 5 different while loops? Thanks!
    Do you want to compare the value with a defined value and also the ranges for the 5 data is different?. What are you doing in the while loop. If the data is in an array of dynamic data you can seperate the amplitude value and check the whole array of value with the ranges that is also build same as the data theh you will get the output as a boolean array.
    The best solution is the one you find it by yourself

Maybe you are looking for

  • Syncing to Creative cloud automatically from my desktop

    Hi, I've read online that there is an app that will syn from a folder on my desktop automatically to the cloud, without me having to move the files over manually. When I follow the link to download the app it bring me here:   https://creative.adobe.c

  • Generating images (GIF) from iViews

    Hi, I am looking for a way to generate GIF images from my iView. If I use a regular servlet as a portal component and set the response type to "image/gif", I get an empty HTML page. Another approach would be to use a normal AbstractPortalComponent. B

  • HT5622 I'm trying to trim a video

    Hey Guys, i'm using UIImagePickerController, and i'd like to know if using _UIImagePickerControllerVideoEditingEnd my app will be rejected or no? If it'll be rejected, which class should i use to trim the video? Thanks in advance, F

  • Smartview VBA - Using HypCreateConnection to connect to different Providers

    Hello, I am currently working with Smartview 11.1.1.3.500. I am trying to build some code that will allow me to switch between our production and test environments that are on different APS URLs, rather than having to go into the options and typing i

  • JDBC THEME-MAPVIEWER-05517 Request string is too long for Oracle Maps' non-

    hi, if I need a quite complex query to be added to dynamic JDBC theme I get this error: [MAPVIEWER-05517] Request string is too long for Oracle Maps' non-AJAX remoting. -why? I am using Oracle Maps JS API so it is AJAX remoting, or not? -what is the