Jump to content

Problems with Express VI "Write to measurement files"


Recommended Posts

We have some problems with the "saving data" output from this VI. It seems that the output gets the value true as soon as the signal reaches the VI, true?

The problem is that we have chosen the option "Ask user to choose file", and we're not sure what the result of this is, it seems to us that the VI starts writing the data to file before it has prompted for the filename to use. The reason for this suspicion is that we have a timer connected to this output, and it starts counting not from when we say ok after choosing a filename, but as soon as the signal reaches the VI. This causes problems for us in many levels :headbang:

So, is this the case and if so, is there some way to force the output to stay false until the file is chosen and the file prompt dialog box is closed?

Have a nice weekend :)

Link to comment

QUOTE(anor @ Jul 13 2007, 01:50 PM)

The reason for this suspicion is that we have a timer connected to this output, and it starts counting not from when we say ok after choosing a filename, but as soon as the signal reaches the VI. This causes problems for us in many levels :headbang:

That doesn't sound right at all. The wire coming from the output should not have ANY value until the VI finishes executing. I have a feeling you wired something incorrectly and that your timer is not connected to the express VI at all. I suppose it's possible your wires are overlapping and you are seeing something that is not there.

If you can't find the source of this on your own, you should upload the code.

P.S. If you want to see what the express VI does, you can right click it and select Open Front Panel. It will then be converted to a standard VI and you can see how its subVI works.

Link to comment

Thank you! We strongly suspected that the VI had to execute first and it's good to get a confirmation. However, it doesn't work anyway ;)

The timer is properly wired and we have done a lot of attempts to find whats wrong, and we have concluded that it's probably the timer thats faulty (or rather that we use it incorrectly).

Thank you for your help though, we posted another thread in "Application and Design..." about the timer.

Link to comment

Some more questions about the same express VI:

First off, it seems as if the wire really does get a value before the VI executes. We persist in thinking so because the output is first connected to a logical AND together with a paus button before the timer. And when the paus button is not pressed, the timer starts ticking correctly, but when the button is pressed it starts ticking before the dialog box close. It would not start if the logical AND didn't get two ones, which it obviously does. Confusion...

Second, it seems that the VI somehow buffers the values while waiting for the file input. Is there some way to force the VI to NOT start saving before the dialog box has posed its question?

Link to comment

As both Ton and I said, you should post the code. We can't see the problem just from your description.

Also, don't start multiple threads. Choose one thread for your problem. The elapsed time VI posted to the other thread is basically the same as the Elapsed Time express VI, but if it doesn't help you, you should be explicit about what it is you need.

As mentioned, you should probably read a few tutorials about LabVIEW first.

Link to comment

Very sorry about the multiple threads, I'm not sure how to post on the forum yet, I saw it as two different problems seperated from eachother. I'll try to be more specific this time about what I'm asking for. I cannot post all of the code because of copyright reasons, but I've made a copy of a part of the program to try to explain better. Disregard the timerfunction, it really was not the main problem for me.

http://forums.lavag.org/index.php?act=attach&type=post&id=6374

(We are using an A/D-converter to get information on the physical channels)

As can be seen when running the programm and pressing the save button, the dialog box appears prompting for a file name. As far as I can see the VI starts saving the data when the save button is pushed, buffering the data while waiting for input from the user. I wish to know if it it is possible for me to force the VI to start saving AFTER the user have chosen a filename and pressed OK in the dialog box. That is, waiting for the OK button in the dialog box in stead of the saving button. I do not want it to save data while I'm prompting the user for the filename.

I have read several tutorials, and I also have books, and I have consulted LabVIEW help as well as internet, but nowhere have I found this answer.

Link to comment

QUOTE(anor @ Jul 17 2007, 02:16 AM)

I wish to know if it it is possible for me to force the VI to start saving AFTER the user have chosen a filename and pressed OK in the dialog box. That is, waiting for the OK button in the dialog box in stead of the saving button. I do not want it to save data while I'm prompting the user for the filename.

It appears that the Write to Measurements express VI is set up to start saving the data as soon as it is called. This is done by using the "reentrant" property in the VI exexution properties. If you do not desire this behavior (although I can't think of a reason... can you enlighten us as to why you need it to halt your data collection until the file dialog is closed?) you are going to have to call a file dialog before calling this express VI, feeding the resulting file path to it(you can use the "open/create/replace file" VI in the File I/O pallete). This way, you can use the data flow of the error clusters to make the Write to Measurements express VI wait for the file dialog to close.

Link to comment

QUOTE(orko @ Jul 17 2007, 03:27 PM)

(although I can't think of a reason... can you enlighten us as to why you need it to halt your data collection until the file dialog is closed?)

I'm not sure I can explain it very well in english, but the complete program is to measure and analyze ECG signals. Some of these measurements are done according to specific methods that has to be meticulously timed, and some of them is measured for as short periods as 30 seconds. As the program is to be used by doctors I can not depend on them beeing very used to computers, and I don't want them to still be in the dialogbox after 30 seconds only to realise that the measurement has timed out =) Also I don't want the buffer to get too big while chosing a filename. Also since some of the measurements require specific movements or breathingexcercises I don't want them to have to begin supervicing this while still having to interact with the program.

I know there are other ways to solve it, but the request from doctors is a smooth userfriendly program and they want to be prompted for a filenamn when they press save.

Hope that is good enough reply.

I'll try what you are suggesting orko, thank you

Anna

Link to comment

QUOTE(anor @ Jul 18 2007, 02:33 AM)

As the program is to be used by doctors I can not depend on them beeing very used to computers, and I don't want them to still be in the dialogbox after 30 seconds only to realise that the measurement has timed out =) Also I don't want the buffer to get too big while chosing a filename. Also since some of the measurements require specific movements or breathingexcercises I don't want them to have to begin supervicing this while still having to interact with the program.

Your English is very good, actually :yes:

Asking for the file name before calling the Express VI should satisfy your need. Seeing now that this program interacts with not only a doctor but also a patient, I can see why you need the pause before saving. Hmm... you may even want to consider waiting on a "Go" button press after obtaining the file location to give the doctor some time to get his patient ready ( 1. "Save"->choose file; 2. "Go"->start test )? This may involve another click, but perhaps would establish more confidence that the program will start the testing sequence when they tell it to start, rather than after closing a file select dialog box. Just an option to consider.

Good luck!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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