08-21-2009 12:37 PM
And I was also wondering if you could alter the amount of time it takes for a loop to iterate, that way, if I wanted it to save every five hundred miliseconds, I could make it save every, say, ten iterations, and make the loop iterate every fifty ms.
Im running LV 8.5.1
Here is my code;
08-21-2009 12:47 PM
08-21-2009 12:51 PM
As you may have inferred, I know very little about LabVIEW, and am a very new user;
I dont know what '
you simply do quotient&remainder of iteration count with 10, when remainder=0 then save...' means...
and regarding the second thing you mentioned (I dont know the exact words) I got the waveform part of this VI from a pre-made template, all I want it to be able to do is save the waveform data (In X Y form, of course) multiple times per however much time I want...
Could you possible post a pic. of what I must do?
Thanks
08-21-2009 01:20 PM
08-21-2009 01:31 PM
Hm, now that I did that, I cannot make the saving happen (because the other boolean took the '?' input on the case structure) so now it doesn't save anything...
Is there something horribly wrong with my code?
08-21-2009 01:54 PM
The example has the save functions in the zero case and nothing in the 1, default case.
I don't know what you mean by the ? took the other boolean. What other boolean?
If you want it to be every 10th iteration AND when the save button is pressed, do when the blue wire coming out of the Q/R is =0 AND the Save button is True and wire that into the case selector.
Your code has a data dependency I don't think you want. Your stop button is in the lower loop and has a wire coming out and going into the upper loop. That means the upper loop won't run until the lower loop is finished.
08-21-2009 02:14 PM
The '?' was the case selector and what I meant was when I plug the QR into the case selector, I can no longer plug in the switch.
I think you tried to remedy this;
'If you want it to be every 10th iteration AND when the save button is pressed, do when the blue wire coming out of the Q/R is =0 AND the Save button is True and wire that into the case selector.'
But I dont really know what you were trying to tell me, I'm far from savvy with the LabVIEW lingo, a picture would be incredibly useful.
Yes, I've had a lot of trouble with the 'Stop' button, I have no idea what to do with that, it just doesn't cooperate with me...
Thank you very much
08-21-2009 02:29 PM - edited 08-21-2009 02:31 PM
I know what the question mark is. I don't know what the "other boolean" you were referring to is.
See the attached file.
Double check the file. I took the VI you posted in message #1, but it seems to be an older and incorrect version (problems with the reference wire being the datatype for the queue and a feedback node thrown in as well) that didn't match the image you have posted in message #1.
08-21-2009 02:34 PM
Ah, thanks.
Anyway, so I did that, and it still only saves one time... The objective of all of this is so that the VI can save intermittently at a rate the user decides.
08-21-2009 02:48 PM
That's because your not using the file I/O properly. You are just using the File Write. If a file exists, it overwrites the current file.
(See this part of Help on the function:
file can be a refnum or absolute file path. If you wire a path to the file input, the function opens or creates the file before writing to it and replaces any previous file contents. If you wire a file refnum to the file input, writing begins at the current file position. To append to an existing file, set the file position to the end of the file by using the Set File Position function. The default is to display a file dialog box and prompt you to select a file.
)
You want to explicitly open the file (with open or create option), move the file pointer to the end, then use this function to write to the file, then close the file