LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Erreur création de fichier/dossier // folder/file creation error

Bonjour

Mon programme que je suis en train de réaliser est assez complexe mais je vais tenter d'être clair et concis.

Rôle de l'interface
- Affiche un live de l'objet que nous filmons (écran supérieur)
- Affiche la dernière image sauvegardée par le travailleur. (écran inférieur)
- Fonctions réalisées avec une seule caméra

Fonctionement
- Partie centrale gauche : paramètrages de la caméra
- Partie basse gauche : création des paramètres "date & horaire"
- Boucles "For" permettant d'incrémenter le nombre d'images enregistrées et le nombre de bobine
- Partie grosse boucle "For" : permet l'enregistrement d'une image, demander la validation du travailleur et créer un fichier texte avec les paramètres de "date, horaire et valide".
- Partie supérieure : permet de créer une adresse pour le fichier parler précédemment et permet aussi de créer un dossier avec une adresse.

Ci-joint deux VI, la version quatre fonctionne parfaitement. La cinquième a les problèmes suivants:
- erreur 10 pour la création d'un dossier (raison : chemin double)
- erreur 1059 pour la création d'un fichier (raison : type de fichier inatendu)

Merci de votre aide

 

Hello My program that I am making is quite complex, but I will try to be clear and concise. Role of the interface - Displays a live view of the object we are filming (upper screen) - Displays the last image saved by the worker. (lower screen) - Functions performed with a single camera Operation - Left central part: camera settings - Lower left part: creation of "date & time" parameters - "For" loops allowing to increment the number of recorded images and the number of reels - Large "For" loop part: allows the recording of an image, request the validation of the worker and create a text file with the parameters of "date, time and valid". - Upper part: allows you to create an address for the previously spoken file and also allows you to create a folder with an address. Herewith two VI, version four works perfectly. The fifth has the following problems: - error 10 for the creation of a folder (reason: double path) - error 1059 when creating a file (reason: unexpected file type) Thank you for your help

Download All
0 Kudos
Message 1 of 6
(1,569 Views)

Hi c.,

 


@c.thomas wrote:
Herewith two VI, version four works perfectly. The fifth has the following problems: - error 10 for the creation of a folder (reason: double path) - error 1059 when creating a file (reason: unexpected file type) Thank you for your help

On v4:

Why do you create a filename with suffix ".jpg" when you save the images in BMP format?

 

On v5:

Why is there no error handling for the CreateFolder function? Why do you want to create a folder which already exists?

Which function gives that "error 1059"? Why would it claim "unexpected file type" when it should create a new file?

Did you check the filepath ("chemin complet") you create with your implementation?

 

To summarize:

When v4 is working "perfectly" and v5 gives errors then your changes to the code must be the reason… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,541 Views)

Hello,

 

On V4:

Why do you create a file name with the suffix ".jpg" when saving the images in BMP format?
The programming block requires adding a file extension, then I can change it, it's not really a problem, it's more of an inconsistency.

 

On V5:

Why is there no error handling for the CreateFolder function? Why do you want to create a folder that already exists?
In fact, I am trying to create a file with the name "the order number" followed by the "step number" in the "manufacturing" file. (I added error handling)

 

What function gives this "error 1059"? Why would it claim an "unexpected file type" when it should create a new file?
This is a point that I do not understand, indeed, I ask him to create a file with the given path.

 

Have you checked the file path ("full path") you are creating with your implementation?
I am able to acquire and save the images if I remove the errors.

 

To summarize:
I know perfectly well that it is the additions that generate these errors, that's why I'm asking the questions about these two errors

 

Best regards,

0 Kudos
Message 3 of 6
(1,535 Views)

Hello,

 

On V4:

Why do you create a file name with the suffix ".jpg" when saving the images in BMP format?
The programming block requires adding a file extension, then I can change it, it's not really a problem, it's more of an inconsistency.

 

On V5:

Why is there no error handling for the CreateFolder function? Why do you want to create a folder that already exists?
In fact, I am trying to create a file with the name "the order number" followed by the "step number" in the "manufacturing" file. (I added error handling)

 

What function gives this "error 1059"? Why would it claim an "unexpected file type" when it should create a new file?
This is a point that I do not understand, indeed, I ask him to create a file with the given path.

 

Have you checked the file path ("full path") you are creating with your implementation?
I am able to acquire and save the images if I remove the errors.

 

To summarize:
I know perfectly well that it is the additions that generate these errors, that's why I'm asking the questions about these two errors

 

Best regards,

0 Kudos
Message 4 of 6
(1,524 Views)

Without being able to run your code (because there are dependencies missing), all I can do is give my best guess...

 

Error 10 is most likely happening when you try to create the C:\fabrication folder and it already exists. Recommendation: add a "check if file or folder exists.vi" to check if it exists before creating it. If you happen to have OpenG, they have a nice little function called "Create Dir if Non-Existant" which does that already.

 

Error 1059 is most likely happening because you added some stuff to make a text file and that stuff is just all jacked up. The error is actually happening at the "open/create/replace file" function because you are giving it a folder path instead of a file path (again, best guess). But then you don't have the refnum of that function going into the "write to text file" function. the "file" input of "write to text file" can accept either a file path or a refnum created by the "ocr file" function. See the images.

Spoiler
FireFistRedhawk_0-1630587929455.pngFireFistRedhawk_1-1630588002432.png

 

 

 

Recommendation on that one: Give your "open/create/replace file" function a .txt file path, wire the refnum out of that, oh and just a general recommendation: improve your error handling! There's no reason to be dividing the error wire into 4 different error streams like that.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 5 of 6
(1,526 Views)

Hello,

 

excuse me I had forgotten the addiction, here it is

 

Best regards,

Download All
0 Kudos
Message 6 of 6
(1,520 Views)