11-01-2023 10:37 PM
Hello!
I have created the attached VI, it is an illustration to system that I have.
The system will be running and measuring several data every 1 second, there will be several SET points during the test, and for each SET point I need to collect 20 data ( that means for 20 seconds)..
-I need for each test point, to open a new file (CSV) to collect the 20 data, and then close it. When I switch to the another SET point, I will need to open a new file (CSV) and save the new 20 data on it... how can I do that ? what should I add to my VI to be able to do that ?
Please not that I cannot stop the VI and re-lunch it, because the system I'm measuring is being controlled using the same VI.
Best Regards,
Ata Alkhatib
11-02-2023 05:59 AM - edited 11-02-2023 06:00 AM
Hi Ata,
@ataalkhatib97 wrote:
When I switch to the another SET point, I will need to open a new file (CSV) and save the new 20 data on it... how can I do that ? what should I add to my VI to be able to do that ?
You need to create the filepath inside your loop when you want to change the filepath. Creating it once before the loop does not fit to your requirements.
You can even automate that step by using a case structure with the selector connected to your "new setpoint" condition!
You should also cleanup the VI and downconvert it to an older LabVIEW version when you need more help. (I prefer LV2019…)
When you attach images (which is fine here) then please don't scale them in weird ways.
11-03-2023 12:17 AM
Thank you for your comments.
I made the below adjustment base in your advice, but it didn't work.. I reconfigured the take new setpoint mechanical action to "Switch Until release" and it opens two files "I have to pick two files" and then when I press "Take readings" it keep on opening the files again and again.
I added a Snippet, it may work
11-03-2023 01:58 AM - edited 11-03-2023 02:00 AM
Hi Ata,
@ataalkhatib97 wrote:
Thank you for your comments.
I added a Snippet, it may work
You forgot to downconvert as I asked for…
@ataalkhatib97 wrote:
I reconfigured the take new setpoint mechanical action to "Switch Until release" and it opens two files "I have to pick two files" and then when I press "Take readings" it keep on opening the files again and again.
On your snippet:
11-03-2023 04:33 PM
GerdW,
I'm still new to the LabVIEW, I figured out what do you mean by clean up a VI, I did it, But I don't know how to downconvert a VI. Sorry
I followed your comments, and the VI works perfectly ! Thanks.
- I changed the 'Create new Setpoint' mechanical to 'Latch when pressed'
- Included the shift registers.
Now, I can create multiple files and save the readings whenever I want.
But one issue I noticed is that, when ever the 'Select file Window open' when I want to open a new file, the complete VI freezes, that means that the continues signal controls I have in the system will stop for multiple seconds...
Is there anyway to solve this issue ? or I have to import the data collection strategy to a separate VI ? If I have to do that, how the TWO VI will be running in the same time ? Knowing that I'm using 2 cDAQ - 9185 Chasse for the system.
Best Regards,
Ata