Jump to content

ahlers01

Members
  • Posts

    63
  • Joined

  • Last visited

Posts posted by ahlers01

  1. hello again smile.gif,

    yesterday i learned, how to pass parametres from a sub VI to the executing VI.

    Now i am asking me, how i can pass a connection ID of a connection, which was setup in the subVI.

    i thought, maybe i could convert the ID to a string or something, but I didnt find anything to do so.

    Is there a way, to pass the conID to the executing VI?

    Thanks in advance

    Ben

    5428[/snapback]

    put a 'TCP Network Connection Refnum' indicator on the subVI's front panel and wire it on the block diagram. Then wire it in the connector pane of the subVI as explained yesterday and you'll have access to the connID in the calling VI

  2. HI!

    Does anybody know a program, which calculates the derivative from X,Y points??  :unsure:

    Best regards,

    Peter

    5427[/snapback]

    - convert your (X,Y) points into two arrays [X] and [Y]

    - use LV's 'derivative.vi' to calculate arrays [dX] and [dY]

    - divide the two to get [dY/dX]

    (this assumes that the points (X,Y) are sorted with respect to X)

  3. Hi guys.

    I'm a student at Cal Poly and our teacher gave us this Labview assignment without teaching us anything about Labview. Any useful tips would be appreciated. If anybody has any actual codes for things like this they are more than welcome to send them.

                                                                              -Thanks                :headbang:

    P.S. The actual Labview instructions are on the last page of the attached PDF.

    5425[/snapback]

    On page 2 of the same .pdf document it says:

    "CHEATING & PLAGIARISM:

    1. Cheating is the act of behaving dishonestly for personal gain. Cheating in ME 435L will result in immediate failure of the course and the violators will be reported to the university administration.

    2. Plagiarism is the act of taking the intellectual property of another and claiming it as your own.

    3. Evidence of such misappropriation of other people

  4. Thank you all.

    I just to prove this probability.

    My real problem is that I want to design a vi to simulate a menu(a single level), but if the menu has a multi level, i must call this vi more times.

    However, Labview permit only a instance of vi at one time, if I set the vi as a reentrant, it can't show FP and doesn't respose to any EVENT.

    Someone say I could duplicate the vi as many as the level of menu,,which may be take more memory.

    Anybody has a better solution?

    5197[/snapback]

    If you save a VI as a template (with the extension .vit) you can create at runtime copies of it using VI Server methods. Basically you use 'Open VI Reference' to instantiate a new VI as a copy of the template. Then you use 'Set Control Value' or 'Set Control Value[Variant]' methods to pass parameters to the newly instantiated VI. Then use 'Run VI' method to run the new VI and finally 'Get Control value' (or 'Get Control Value[Variant]') to retrieve the results. At the end use 'Close VI Reference' to remove the new VI from memory.

    There is even a method to programmatically create a new VI completely from scratch and do similar as above. This works with unsupported LV functions, however. In the 'scripting' sub-forum of LAVA you'll find more about it. Or look at an implementation example under http://forums.lavausergroup.org/index.php?...findpost&p=1850

    Finally, as a help for your real task of creating a menu hierarchy, look at the thread http://forums.lavausergroup.org/index.php?...&hl=right+click in the 'User Interface' sub-forum. The implementation of context-sensitive right mouse click pop-up menus is discussed there and you'll find lots of ideas.

    -Franz

  5. There are several threads about factorial VIs on NIs Developer Exchange LabVIEW forum. Some show this example but there used to be a challange at some point which showed the other aproach which can calculate !3000 without taking 100ds of MBs and half of the life of the universe to get the result. ;-)

    Rolf Kalbermatter

    5184[/snapback]

    There was a Labview coding challenge some time ago and the guys there really showed how fast one can do math with big integers in LV. I also took part in the competition and thought that my calculation of 10000! within 95 msec was fast. Three others were still faster, though, and the winning solution by Bruce Ammons calculated 10000! in 57 msec !

    You can download his solution from http://www.ni.com/devzone/lvzone/codechallenge6_results.htm

    -Franz

  6. Richard,

    I just answered in NI's forum to the same posting. Besides pointing to the same clipboard.ddl as swainedonald, I there recommended activex and excel.

    The topic http://forums.lavausergroup.org/index.php?...c=1396&hl=excel in the LAVA forum is maybe something that helps, but at least the topic's author will know better than me what to do to communicate with excel

    This is another possibly helpful link:

    http://sine.ni.com/apps/we/niepd_web_displ...034080020E74861

    (Searching for 'labview excel' on NI's homepage gives you lots of good hits)

    -Franz

  7. Hi,

    I have a 1D array of I32 numbers (about 25 elements), I need to rotate this array and separate each number with a comma (converting it into a string in the process).  So the final result will look something like this....

    123,66,125,166,148,6,226,200,5201

    Any help (or sample code) would be really appreciated!

    Many thanks,

    Cooky

    4921[/snapback]

    Use the 'Array to Spreadsheet' function:

    post-833-1117885439.png?width=400

  8. Oh, I forgot!

    Some NI rep told me about some way you could make two loops that operated independently of each other... one loop controlled the GUI, and the other loop did all the machine interfacing and junk. That way, you could let the user do things while something else was working in the background.

    What's that all about?

    4817[/snapback]

    Go to www.ni.com/devzone and enter 'design patterns' in the search field. You'll find a lot of good resources on advanced concepts there, also tutorials. State machines are explained as well as the master/slave pattern and many others..

    -Franz

  9. How do I make array type 1D double instead of the default 2D double in the vi "Spreadsheet String to Array" vi?

    4740[/snapback]

    Just connect a 1D array of DBL to the 'array type' input of the "Spreadsheet String to Array" function.

    One can, BTW, also connect arrays of string to the array type connector, which is a sometimes overlooked feature. See examples below:

    post-833-1116009678.png?width=400

  10. Hi All,

    I am new in LV. Generally writing my codes with Borland C++ Builder 5 (BCB). Some of my friends asked me to possibility of conversion from LV to BCB.

    I really wonder is it possible ?

    Thanks,

    4337[/snapback]

    Generally everything (well, nearly everything) is possible. BUT if you translate a poem from Chinese to English it will not sound the same. So why do you want to translate from LV (which you do not even 'speak') to C++?

    Stay with C++ if you can solve your programming problems with it. It is object oriented while LV is not (yet). That is a definite advantage of C++.

    Change to LV if you are interested in measurements and real world solutions. BEWARE though: it opens your eyes for a whole new world of programming and you might never want to go back to C++ any more...

  11. Hey there,

    What i meant was to plot Frequency in the Y-axis against Real time in the X-axis. instead of the normal Amplitude vs Frequency for the frequency graphs, it is shown in Real time :) any idea?

    4340[/snapback]

    Since frequency f is defined as events per time ( f = 1/t) you would get a hyperbola if you plot y (= f = 1/t ) vs. x ( = t ). What is so interesting in plotting a hyperbola?

  12. you wrote:

    i want to plot frequency against time domain but what i can only get is the individual time and frequency plots. how do i plot them? its in Real time by the way. All help will be much appretiated :)

    4332[/snapback]

    I do not understand what you mean by 'frequency against time domain'. Do you want to plot a Signal S in dependence on frequency, S(f), and the same (or another) Signal in dependence on time, S(t), in one plot? That would make little sense, since the x-axes of the plot would be two different quantities.

  13. You may want totry the following Labview case structure (which is a more or less literal translatino of you pseudo code to LV graphical code:

    post-833-1111670659.png?width=400

    post-833-1111670660.png?width=400

    post-833-1111670585.png?width=400

    post-833-1111670587.png?width=400

    post-833-1111670588.png?width=400

    post-833-1111670589.png?width=400

    post-833-1111670590.png?width=400

    post-833-1111670591.png?width=400

    Sorry, there are two errors:

    a) some pictures are missing. But you can reconstruct from the visible frames what's in the missing frames..

    b) it should read translation, not 'translatino' (whatever that is)

  14. Hi,

    I have a senior project on Anaylzing Sleep EEG with REM & NREM. I need to apply FFT transform to the EEG signal to view in frequency domain.

    But I cant do it cuz' I'm new to Labview and I do not have any idea of the programme.

    Can anybody help me with fft applications?

    My EEG signal is saved in a txt format. I import the values to Labview but I dont know how to make an fft.

    Please Help Me!  :headbang:

    4313[/snapback]

    It is actually quite simple, but maybe difficult to explain to a LV novice...

    If you post an example data text file I'm sure someone will write an example VI for you to get started...a program says more than 1000 words!

  15. ...My first post would be asking anyone who know how to display the current (computer) time in the x-axis of a chart.

    So far, I always get the LV default time (1/1/1904). ...

    3782[/snapback]

    You can use the "Get Date/Time In Seconds" function to set the "XScale.Minimum" property of the waveform chart as shown in the attached image.

    -Franz

    post-833-1107713583.png?width=400

  16. i prefer typdefed enums, simply to eliminate the possibility of mis-spelling ;-). My experience is that the "most used way" is not allways the best way (what ever best way does mean ...)

    but it does not really make a difference, you can use numbers if you want. i think it's just a "oppinion" and a kind of approach what is "perfect code"

    3307[/snapback]

    There are indeed many ways to label the states of a state-machine. But the string or enum approach make the code much more readable than just numbering the different states.

    I prefer the strings over the enums for two reasons:

    - it is (a bit) easier to add a new state when you use strings (the danger of mis-spelling is reduced if there is a default case in the state machine which generates a run-time error like e.g. 'invalid state')

    - when a menu event occurs, I just pass the menu tag string into the queue which drives the state machine loop. No need to map the menu tag to an enum. This can be done in the simple QSM (queue driven state machine) or in the ESM (event driven state-machine, producer-consumer pattern).

  17. ...The instrument drivers open the driver VI by reference, and pass a function enum, as well as a main cluster, which contain refs to all the relevent information of the system....

    ... my overall cluster is getting pretty complicated, and each time I put it on the front panel it takes up a huge space...

    One advantage of the encapsulation provided by an OOP approach is that you don't need to pass ALL RELEVANT INFORMATION to the objects. Each objects 'knows' what it needs to know. Of course you need to pass parameters when calling a 'method' of an object (the 'method' is one of the VIs which comprise the functionality of a class). But these parameters should contain just the information the 'method' needs to know in order to perform its task.

    Do you run the risk of race conditions as you update information on the whole system state, or do you have specific read/write routines to access the overall system parameters?

    I use specific read/write routines to access the system parameters. When a measurement is running, the main panel is not responsive to user input and system parameters cannot change. (Exception: the user can stop a running measurement or batch job. The status of the main (Idle/Measuring) is indicated in the main's titlebar
    My main isn't queue-driven, I basically have an event structure that captures all relevent front-panel events and process them.  As I'm only in the starting stages, I don't know if this approach will be too limiting later on.  Do you suggest using queued state machines?  Or does the event structure help make it easier to work without those?  IIRC, the event structure has queueing built into it?  Of course the benefit of your approach is batching looks the same as user interactions. 

    I use a simple QSM since the program dates back to LV 4 or 5. I didn't find the time (nor the motivation) to change it to the event machine driven consumer-producer design pattern mentioned by Michael Ashe and Michael Aivaliotis. For new projects I prefer (and recommend) their approach.

    I've made further progress on using HDF.  The basic synopsis so far - it's a real pain in the arse to use so far...

    3286[/snapback]

    Thanks for that info, I guess I'll wait with the HDF stuff until someone makes it work less painful...

×
×
  • Create New...

Important Information

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