Jump to content

mross

Members
  • Posts

    532
  • Joined

  • Last visited

Everything posted by mross

  1. That is a great start. You definitely need to be able to lay out your goals like that. The next step is to start eating the elephant one bite at a time. Each task has some code that causes it. You can write subvis for these tasks and test them as you go . You also want to put together your front panel UI early - even if you don't actually have subvis to feed them.. This way you work through what your user inputs and program outputs will be. To the extent that you can simulate the various worldly activities your code chuncks will be less trouble as you assemble it all into one functioning whole. I see this is your first post. You can't really expect someone to lay a vi on you that does what you want. It is too much. It will be a fair amount of work and we all have to pay our own way wherever we are. I can't do that on your program, nor can many of us. You need to start working and come back with smaller questions as you go. Also you should let us know what hardware you are using: OS, and DAQ equipment PNs at the least. It could be importatnt to know the transducers you will have. You should become acquainted with the User Event Driven Producer/Consumer architechture. This has a loop that watches for user inputs and a loop that runs at machine speed, doing daq, analysis and other execturive operations. It is possible to have several machine speed loops. It uses the "queue" functionality to sequence the actions based on user input. I am partial to the architecture becasue it gives a nice organization to the code. Good luck, Mike
  2. I have always been curious about this but I don't have any pressing cycle time issues so I never worried about local versus prop node. Truth is I use prop nodes almost eclusively to change values, mostly boolean indicators, if that makes a difference. I realize that I will miss the error in and out if I start using locals. Mike
  3. You have a While Loop. You need to use For Loops that run contingent on the Count Terminal or in the case of the final For Loop it automatically looks at the array size wired into the loop (with indexing enabeled). There are probably a lot of other ways to do this with more or less work. You need to study how data flows in a labview block diagram. The small light bulb icon runs the VI in a step through mode so you can wahtch and learn how it functions. Data flow means each functional element runs when all the input data wired to it arrives, including the loops. It is not a sequential programming language unless you force it to be so. You can also right click on wires and create probes wich show a realtime monitor of the value of a wire, or you can create indicators on the wires. Probes are visble in front of the block diagram so that is useful for learning. It is helpful to create a VI in a step by step manner - adding probes and indicators as you proceed to make sure you are getting the results you want. In the VI I provided I created 3 array indicators, two intermediate arrays, and the final result. I would find it very difficult to compose VI's without this technique. Finally, in using these internet forums it is alway best to explain the overall goal of the programming task. You will receive much better advise this way. What is the use of this interleaving process? What will you do with the final array? Perhaps we could give you a better solution if we knew what task is to be achieved. In our experience what you asked for seems not useful. It looks like a small, insignificant and probably incorrect part of a larger problem. Mike Download File:post-48-1144503998.vi
  4. Sounds more like a homework problem than real work, but I will give it to you. You will want to use the standard "Interleave 1D Arrays" function. Each row is "deleted" (by Delete from Array) from the original 2D array and interleaved with itself. A shift register of the outer For Loop is used to build the resulting interleaved arrays back into the form you like. That is the plan. I will let you work out the details. Prove you aren't just cheating on your school work (explain why this is important to you) and I can show you how it is done. Mike
  5. That seem like a card that should be able to do as you require. NI would be interested to know that it doesn't work and you might want to ask them what they know about it. Their tech support is very good. Unfortunately, mine is not where DAQmx and AO are concerned.
  6. I think it it is important for us to know what hardware you are trying to use.
  7. In the array functions pallette is the Max and Min of array function. It returns the max and min of what ever you feed it and their indexes. That seems so simple that I must be misunderstanding your question. Are you wanting to find all the local maxima and minima? That is trickier. I suppose you would need to define "local." There must be a function or example to do that but I haven't used it. Mike
  8. There is no substitue for a dasabase to do database work. I use MySQL (open source) and LabSQL (open source). It works well and is free stuff. Once you know how to use them together LV and MySQL are good tools in your arsenal.
  9. Strain has units of length as does location. Perhaps you are measuring stress or force, not strain? If you are measuring strain then I do not understand where location comes in. You could certainly calculate location from strain... At any rate assuming you are taking "strain" with respect to time, and "location" with respect to time. If you have two different transducers, then it is normal procedure to monitor multiple channels channels simultaneously. You just make the proper input to tell the VI to read 2 channels. If you desire to plot "strain" vs"location," then you simply pull those paired data out of the resulting array of readings and plot tem using an XY graph. Most analog acquisitions are taken as a timed series which are clocked by the on board clock of the DAQ board (as opposed to a series of one shot readings). The clock is more accurate than timing repeated loops of a one shot routine. Look at buffered acquisitions. You specify the rate of acquisition and how many points to take. The possible disadvantage is that you have to guess how long to run the test, where as you can use a stop button with looped one shots.
  10. Why do you think you need .NET? What sort of work do you anticipate? I have been using LV for acquisition and analysis for 4 years now and have never needed .NET. If you are just starting out, I think you should concentrate on other core skills first. Best thing I ever learned after how to aquire and process data was the producer consumer form of event driven queued state machines. Mike
  11. I am glad I asked. I didn't know there are 2 data structures that work to feed an XY graph. Attached image. I have been doing it the hard way for some reason I can not recall. Mike
  12. WMassey, Can you do that in LV8? Feed it 2 arrays? All the XY graphs I have used require arrayed[clustered( ordered pairs)] Mike
  13. Rigth click on the XY graph and go to Visible Item check the Plot Legend. Then right click the plot legend that comes up. You get to choose whether it is a line graph, bar chart, etc. I don't savvy SR. You need to understand the data structure that it takes to run an XY graph. I cannot stress that enough. You can look at the example I sent you. You can make an ordered pair by placing a cluster on the Front Panel (FP), then drop 2 numeric control into it. To make a plot you put an array control on the FP and drop the previous cluster into it. To make a multi plot put another empty cluster on the FP and drop the plot into it. Then put an empty arrary on the FP and drop the clustered plot into the array. Stated differently the XY Graph wants an array of clustered piars of numbers. A multi plot XY Graph wants an array of clusters, in each claster is a plot (which is an array of clstered points). The easy way to create the "prototype" of a data structure is to go to the XY graph indicator on the Block Diagram (BD), right click on the input terminal and pick out Create/Constant or Contro or indicator. You will get the correct data structure for any of those. In my example that is how I created the constant that initializes the shift registers. Do you understand shift registers? You will need to understand these to get your charting to work. All that is in the example I sent. If you want to watch the example in highlight mode you will want to lower the delay for the loop which I set to 400ms. (The little metronome icon.) I hope I am not offending you by assuming you just cracked LV for the first time. It is maybe faster to just go all the way click by click. I can't know what you DO know. Mike
  14. This is what an XY graph does: You give it a SEQUENCE of ordered pairs and it plots them. If you want lines drawn between ADJACENT points then it will do that. All you have to do is get the sequence in the correct order. The only way you can get a chart like you describe from voltage and current is if ALL the current data is exactly a particular increment apart and ever increasing. Is that how your data looks? If the current EVER is less than the voltage then the graph will double back on itself. How could it be other wise? You can do that and get a scroll effect in this way: In a while loop you have your XY graph and the single point aquisition function fetching from the two channels, one for voltage and one for current. Every time the loop runs you get a new ordered pair of current and voltage. There is a shift register on the loop (I am going to let you figure out the data structure on your own - if you are going to use XY graphs you need to learn that). Every iteration of the loop adds the new data to the shift register and the XY graph gets its data from that shift resiter. This way everytime you get new data the data is added to the plot of the XY graph and the graph updates immediately. Now, here is a question. What is the point of watching the graph build point by point? If there is no good reason, as in you need to make some real time decision based on the readings, then don't do it this way. Simply gather the data in a buffered read and plot it afterward. I have a feeling that you have not actually plotted anything in an XY graph yet. It would be a good idea to mess around with it if you haven't. Create a data set with a random number generator ands experiment with the XY graph a bit. You can plot the data from to randoms as oredered pair and XY that. Then try to get multiple plots on the same graph. Then you will understand what I am getting at completely. On second thought attached is an example that makes XY and "clusterrays" them into a multiplot. Download File:post-48-1134692338.vi
  15. "does not chart," does not compute for me. What exactly do you mean? If I guess what you mean... The XY graph will graph properly formed ordered pairs. You can plot multiple plots, but I won't try to describe the details of that data type in words, you can look it up. If you want an XY to update with new data you can give it new data. Put it in a loop and it looks like it is growing. The point of XY is that you are not forced to have ever increasing x data as with "waveforms." A wave is by nature a temporal phenomena thus the x is always increasing by some increment. Waveform data does not even require x data - instead you give it an intial value and the increment. With an XY you can do tricks like draw a circle around a particular datum programatically or introduce max and min lines, lisajous plots, and so on. Are you with me? Mike
  16. I am a bit suprised that a small software team has time to write coding standards. Usually the need to produce billable work trumps that. There are ni docs on coding style. You could refer to that instead of getting bureaucratic. Also, friendly interaction between team members can help develop a mutually acceptable style. Because LabVIEW is so visually different than text code, and because so much information is encapsulated in the elements of the code, there is more need for some agreement on style points and somewhat less need to document the bits of code that are prepared by ni as functions.. If you could get every one to use vi descriptions, tips and other built in documentation features you would go a long way. Dropping text notes in to describe what blocks of code do is nice. Overall I think rather than a coding standard, a process standard is more useful. A pact among the group to do planning up front and adhere to it. No mad coding dashes of into the ether, without talking it over. If you all plan the software reasonably well and follow that, it will get you more than a standard the likes of which I think you are talking about. Mike
×
×
  • Create New...

Important Information

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