08-31-2016 07:30 AM
Hi everybody, I am having some problems in my labview code,
I am runing a Triax320 from Horiba and I want it the program to save a file with the data from it every time it takes data. I want it to put the data files all in the same folder and with the date and time as file name.
I have managed to add the saving part to my code but, I get a promp every time asking for the file name and the folder.
Obviosly I am doing something wrong but I don`t know how to solve this problem.
Can you help me please?
I am attaching a jpg image of the code and the vi.
Thank you
08-31-2016 07:42 AM - edited 08-31-2016 07:50 AM
Hi Laura,
- clean up your VI
- delete local variables and replace them by wires - especially when the terminals aren't used anywhere else!
I have managed to add the saving part to my code
I guess you talk about this code in the frame you show in your image!?
You are saving data from "Collected Data 2" indicator, but this indicator doesn't get any data written to!
Did you just copy the code (without knowing what you are doing here)?
I get a promp every time asking for the file name and the folder.
Which function is asking your for that data? Did you try to debug your VI?
Obviosly I am doing something wrong but I don`t know how to solve this problem.
You can solve it by learning LabVIEW! 😄
Most important advice: THINK DATAFLOW!
08-31-2016 09:57 AM
Dear GerdW,
Obviously you think you are really smart and funny, making fun of a new person trying to learn a new programming language, but you are´t
If I am asking for help maybe is because I need it.
The VI I am sending is a part of a bigger VI. That is the reason why there are "terminals that aren´t used anywhere else!". Also, the "Collected Data2" is not collecting the data as is part of a different VI.
Anyway, all of that is not helping me with the question I am asking.
In the part of the code I am showing in the image, I am asking the program to save a file. My only concern is that I want to save it in an specific folder with a specific name and that the part I am asking for help.
I did not "copy the code without knowing what I was doing here", the code is bigger than the piece I am showing you and I wanted help with a specific point.
08-31-2016 10:01 AM - edited 08-31-2016 10:08 AM
Hi Laura,
as you didn't answer my question I will repeat it:
I get a promp every time asking for the file name and the folder.
Which function is asking your for that data? Did you try to debug your VI?
The VI I am sending is a part of a bigger VI. That is the reason why there are "terminals that aren´t used anywhere else!".
You should mention such things when you attach a VI. We can only analyze VIs with the information you provide!
Also, the "Collected Data2" is not collecting the data as is part of a different VI.
Then how do you transfer the data?
In your VI you read a key from an INI config file and use the content of that key as input for OpenFile.
Did you check the correct reading of the key?
making fun of a new person trying to learn a new programming language
I'm not making fun of you - all those comments are meant serious! (Keep in mind the limited information you gave about this VI.)
Did you check the content of the key?
Did you debug your VI? (I have to ask again…)
making fun of a new person trying to learn a new programming language
I'm not making fun of you - all coments are meant serious! (Keep in mind the limited information you provided.)
08-31-2016 10:09 AM - edited 08-31-2016 10:11 AM
Create File path Control or File constant and browse for path and connect to Open Create Replace Vi and see if it works.
Edit: All the previous comments by GerdW are to help you of the upcoming pitfalls you might face in future (Been there done that).
08-31-2016 11:50 AM
Dear GerdW,
I would try my best answering your questions:
There were no bugs in the code (as far as I understand, it had a white arrow, not broken grey one), so the code was working as it was ment to, the problem was I wanted it to do something different.
I tried to get rid of the local variables where possible and clean up the code, the result is much more clear.
The function asking for data (file name and location) was the "open_create_replace File.vi" as the prom terminal was connected to a string asking for it and the folder path was not determined.
I would realy apreciate your help.
Best regards,
08-31-2016 11:52 AM
And the promised VI attached
08-31-2016 11:56 AM
Dear Udka,
I have tried creating a file path constant as suggested (can be seen in my previous post) but I hasn't work completely.
08-31-2016 12:03 PM