Jump to content

marius

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by marius

  1. Hi Marius,

    I must commend your willingness to learn. Here are some basic resources for learning LabVIEW:

    http://www.ni.com/academic/lv_training/how_learn_lv.htm

    http://forums.lavag.org/knowledgebase.html&showarticle=3

    After this, you will want to pick up a good book, like Jim Kring's LabVIEW for Everyone. Of course, monitoring these forums and participating in the discussions is invaluable as well.

    Good luck!

    -Khalid

    Hello Khalid and thank you very much for your comments and info. Very appreciated.

    Marius

  2. Local variable = 15 times slower than Terminal

    Property node = 653 (!!!) times slower than Terminal

    The above is from the following post: http://forums.ni.com/ni/board/message?boar...essage.id=90261

    Depending on how long you will be working with LabVIEW, you may want to stop thinking in terms of C and VB, and start thinking in terms of data-flow programming.

    Regards,

    -Khalid

    Khalid,

    I thank you for your pertinent remarks and for your time spent for me. I really appreciate it.

    Even before, starting with LabVIEW I've felt that something is wrong with my approach and mostly that I need to change the way of thinking in this environment.

    I am an old dog, frozen in text code and dos approach where I worked for years. I don't have enough Windows programming experience.

    I will try to upgrade my thinking. Can you recommend a good manual for this issue?

    Thanks,

    Marius

  3. Hello Omar, Aristos, hello all,

    Your comments are helpful to me and I think that now I understand more. Probably you need to know that most of my experience is in text code (C, QB), under dos and VB under windows.

    Now, I need to complete this project in LabVIEW and I have fully read the user manual, but I find it not very hepful.

    I will attach here the following files, making a very simple example that doesn't work and I don't know why.

    - save-03A.vi

    - sub-save-02.vi

    The first vi calls the second one, as a sub.

    What save-03A.vi supposes to do (but it doesn't) is to allow to the user to fill an array of two clusters, to specify a path and when it presses on "save", the sub has to save the array.

    Unfortunatelly it doesn't save and the program stops after one iteration, with no error shown.

    Can you please explain me where I should repair and why doesn't work?

    I am very obset with it, since in other languages would take minutes to accomplish such a simple job, but I have to use this LabVIEW which I like it for its capability to build GUIs.

    A quick and clear answer will be highly appreciated.

    Thank you very much,

    Marius :wacko:

    Download File:post-5076-1165343915.vi

    Download File:post-5076-1165343938.vi

  4. :oops:

    To get the output from a subVI into its caller VI, the most staright-forward option is to create an output terminal on the subVI, and use that in the caller VI.

    Hope this helps.

    -Khalid

    Hello Khalid, all,

    Thank you for your quick answer.

    How I understand the situation until now is:

    - if you have a sub and you want to pass a parameter to it, you assign a CONTROL of this sub to a collector of the sub and that collector becomes an INPUT. Later on you can connect a CONTROL from the main program to it.

    - if you want to get a parameter from the sub, you assign an INDICATOR of this sub to a collector of the sub and that collector becomes an OUTPUT. Later on you can connect an INDICATOR from the main program to it.

    Now, my problem is little different:

    I want to pass the pointer (address) of my array to the sub, so that, WHITIN the sub, I will be able to:

    1. save the array on the file. In this case I use the pointer above as an INPUT. No array modification. Just get it from the main and save it.

    2. Load new values into array, from a file. In this case I use the pointer above as an OUTPUT.

    Questions:

    How to correct my sub attached in my first "e-mail" here, so that it responds to the above 1,2 ?

    How to address the sub from the main, once the sub corrected?

    A quick answer will be greatly appreciated,

    Thank you very much,

    Marius

  5. Hi Marius,

    I looked at the VIs. I am not sure what the task is. May be you can describe what you are trying to achieve, i.e, the functionality desired -- without going into the implementation details. This should help us program it.

    Regards,

    -Khalid

    Hello Khalid, hello all,

    save-02A.vi has two tasks: Saves the array under the default name (see the path - here if you want to make it run, you need to write another path, valid in your computer) and Loads the array by calling the same default path. save-02A.vi calls the subprogram sub-save-02.vi. The problems here are: 1.this subprogram, when called, doesn't work. 2. When you try to use it for saving the logic is ok, you send the array in the subprogram. But when you want to load the array, you need to have the array back from the sub, as a returned value, and I don't know how to do it. In other words, I need to send the pointer (the address of the array) in the subprogram, so I can use the array there for saving, or for modifying it (in case when I load it from the file), so I got it modified back in the main program.

    To note that I already tried the same code, by incorporating all into a main program, no subprogram, and it works fine. So the problem is with the passing the parameters to and from the subprogram.

    Can you or somebody else help?

    I badly need to know how to do this, because I need to use it in other applications right away.

    Can you or anybody else help me?

    Thank you very much,

    Marius

  6. Hello,

    I have the following problem in my project: Because of the size of my code and not only, I have to use subs.

    The attached file save-02A.vi uses the sub sub-save-02.vi. This sub has three inputs: two booleans, LOAD and SAVE and an array of clusters.

    My problem is with the array of clusters: When I send it in sub to save it is logically ok (however save-02A doesn't work and I don't know where is the error), but when I do a load in sub, how can I get the new array content from the sub? In other words, how can I send the pointer of this array in sub, so that I can use the same memory space for save and for load? How can I pass not a copy of the array in sub, but its address? I know how to do it in other languages, it is easy, but in Labview documentation I did not find this explanation.

    Thank you very much.

    Marius

    Download File:post-5076-1165199023.vi

    Download File:post-5076-1165199044.vi

  7. Error 1 means invalid input (as the description should tell you). This probably means you typed your path into the path control and something about it is invalid. It would be better if you use the browse button to select the file you want.

    If you want to create a new file, you should right click the path control and change the browsing options to a new file. Also, since your files have a specific extension, you can configure that in the browsing options as well.

    thanks again for the help, it is very appreciated.

    now, in the attached, i created a routine (has a sub, that is why there are two files) which creates a second file when a first is created.

    my big trouble is that i cannot read properly these two files. i want to do it in the same way i write them, and i got an error while reading. i don't know how to deal with this error, i have tried and i have tried.

    need a little help, please.

    thanks,

    marius

    Download File:post-5076-1151981102.vi

    Download File:post-5076-1151981131.vi

  8. Download File:post-5076-1151934065.vi

    The Open/Create/Replace VI has a File Path input. All you have to do is wire a file path into it and you won't get the dialog. To get the actual paths you can use the File Dialog VI from the File I/O>Advanced palette for one file and then strip the extension and use the same name for the other file.

    To write a file without saving simply wire a path into the File Path input.

    In general, your program would probably be better off with an event structure and less locals and sequence structures. I suggest you go searching for some LV tutorials to learn more.

    Thank you for answering so quickly.

    Because I am not an advanced LabView programmer, I tried this code, attached, very simple and I still have err 1 when I run it. I don't understand. Can somebody help me?

    thank you very much,

    Marius

  9. Download File:post-5076-1151864452.viHello,

    I need to save/write two files with only one file dialog and I cannot do it.

    The exercice is to give a file name, save it as *.PRD file, then right after save another file *.PRS with the same name.

    The same thing for load.

    Another thing that I don't know: How to save a file without a dialog, when the file name is pre-defined.

    Need a little help, because I am jamed and I need to go on.

    See the attached file in LabVIEW 7.1. (don't have 8).

    Thank you very much,

    Marius

  10. Download File:post-5076-1148182891.vi

    On the Write File node wire the input "Write Header" to True

    I just got back to this forum because it happened to find a solution. Probably is not the only one.

    I've found your recommendation and I thank you very much. I am planning to pay attention to this aspect in the future.

    I attach this solution it here. I have tested with several save and load and it seems reliable. Do you find it reliable and robust? any weakness?

    The attached file is just a trial for a bigger subprogram that I need to write with an array of 10 rows, each row being a similar cluster of 23 various variables with variable content from row to row.

    Any comment will be very appreciated.

    thanks,

    Marius

×
×
  • Create New...

Important Information

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