09-25-2020 04:55 AM
Get the list for each file type, then combine them in a single array.
09-25-2020 07:21 AM
@GerdW wrote:
When it is your first day with LAbVIEW you should start with the Training resources offered in the header of this LabVIEW board!
@JackRen3 wrote:
I started looking on the documentation but I was hoping anyone here could help me to understand how to perform this task.
GerdW directed you to the LabVIEW Training resources because you're likely to better understand the answers and reach the end of your project sooner with the help of some training. The help that you receive here will be of much more benefit, and you will understand how to perform the task much quicker, with the training resources.
12-06-2020 02:56 PM - edited 12-06-2020 02:59 PM
When I start the algorithm, I select the file to convert and it gives me this error:
How can I solve this?
I have also an additional question: I have to convert a lot of files into .txt format and the file's names are in different formats, such as:
1_good
2_good
3_bad
3_badop
They change the title after the underscore symbol.
How can I make my LabView program iterate over the files inside the folder that I select, and to convert all of them in .txt?
For example, I run the LabView algorithm and it lets me select the folder and after that, it starts converting all the files inside of it. Could you help me?
I've been trying to figure it out for months how to make it work...I was asked to do this file conversion, but LabView is not my field and this is just one step that I need to overcome for a project.
You'll find my script in the attachments.
Thank you so much.
12-07-2020 01:51 AM
Hi Jack,
@JackRen3 wrote:
I have to convert a lot of files into .txt format and the file's names are in different formats, such as:
1_good
2_good
3_bad
3_badop
They change the title after the underscore symbol.
How can I make my LabView program iterate over the files inside the folder that I select, and to convert all of them in .txt?
For example, I run the LabView algorithm and it lets me select the folder and after that, it starts converting all the files inside of it. Could you help me?
Don't use a pattern like "*_good*" when you want to process filename with a pattern like "*_*"!
(You could use an array of possible patterns like [*_good*, *_bad*, *_badop*]. Then use a FOR loop to find all files for your conversion task. Keep in mind: searching for "_bad" will also find files of the "_badop" pattern…)
@JackRen3 wrote:
When I start the algorithm, I select the file to convert and it gives me this error:
How can I solve this?
You try to use Waveform files and save them into spreadsheet (TXT) files. Are those files really waveform files?
Can you attach a file where you get that error message?
To get rid of the error dialog you only need to handle the error programmatically!
12-07-2020 04:18 AM
Thank you so much for your answer.
@GerdW ha scritto:
Don't use a pattern like "*_good*" when you want to process filename with a pattern like "*_*"!
(You could use an array of possible patterns like [*_good*, *_bad*, *_badop*]. Then use a FOR loop to find all files for your conversion task. Keep in mind: searching
for "_bad" will also find files of the "_badop" pattern…)
How can I do that? Sorry for the request, but can I ask you how to achieve this? I'm new to LabView, I will have to use this program just once, since this is not my field. I've been struggling for months on how to do this and on how to make it work.
You try to use Waveform files and save them into spreadsheet (TXT) files. Are those files really waveform files?
Can you attach a file where you get that error message?
To get rid of the error dialog you only need to handle the error programmatically!
Yes those are waveform files, I attached a folder of example.
12-07-2020 04:53 AM - edited 12-07-2020 04:53 AM
12-07-2020 05:57 AM
I was able to replicate most of what you showed me, but I couldn't find the outer structure "Kein Fehler". Also I couldn't find the very external green element on the right of your sketch.
@GerdW ha scritto:
Hi Jack,
a simple approach:
Here is my replica up to now, my constants array is dimmed, should I activate something?
12-07-2020 06:11 AM - edited 12-07-2020 06:12 AM
Hi Jack,
@JackRen3 wrote:
I was able to replicate most of what you showed me, but I couldn't find the outer structure "Kein Fehler".
Did you ever use a case structure before? Do you know you can connect an error wire to its selector input as I did in my snippet? Did you implement some error handling before at all? ("Kein Fehler" is German for "no error"…)
@JackRen3 wrote:
Also I couldn't find the very external green element on the right of your sketch.
Did you ever create any frontpanel elements? Do you know their representation in the block diagram is called "terminal"? The loop creates a path array on its loop border, so the indicator to the right is an array of path…
@JackRen3 wrote:
Here is my replica up to now, my constants array is dimmed, should I activate something?
In my snippet that constant is an array of strings: why did you create an array of cluster of strings?
12-07-2020 07:10 AM - edited 12-07-2020 07:37 AM
Thanks GerdW, you're being extremely helpful, I'm struggling with this process since September.
Unfortunately this is my first time with LabView, I'm not an expert because it doesn't belong to my field. I just need to get this done for a project, but I cannot go on if I'm not able to convert these signals.
Still, I wasn't able to create the green element at the very end.
I followed this guide but it didn't help me: NI HELP
@GerdW ha scritto:
Did you ever create any frontpanel elements? Do you know their representation in the block diagram is called "terminal"? The loop creates a path array on its loop border, so the indicator to the right is an array of path…
After creating the green element on the right, I should add the 2 blocks for the conversion from analog to txt? Right?
Thank you so much again for your help.
12-07-2020 07:57 AM
Hi Jack,
@JackRen3 wrote:
Thanks GerdW, you're being extremely helpful, I'm struggling with this process since September.
More than 2 months should be a lot of time to take the training resources offered in the header of this LabVIEW board!
@JackRen3 wrote:
After creating the green element on the right, I should add the 2 blocks for the conversion from analog to txt? Right?
I used a "conditional output tunnel" at the FOR loop! Use the context menu of the tunnel (aka right-click menu) to set it to "conditional": each filename is checked in the loop and added to the output when the condition is met…
The loop gives you an array of valid paths: you need to use a loop to autoindex each element in this array and do the conversion. (You might also do the conversion inside my FOR loop, based on the condition evaluated in the loop! I just made that snippet to show a solution to your current problem: programming also means to be able to split a big problem into smaller problems and solve them one by one…)
The different modes of "loop tunnels" and "autoindexing arrays" are very very basic LabVIEW stuff: you really should have learned that in the last 2 months!