Écrire dans un path control d'une IHM quelconque

Bonjour,
Je travail sur un banc de test qui dispose d'une IHM 1 à plusieurs fenêtres développer sous Labwindows/CVI. Cette IHM 1 est figée, je n'ai pas accès à son code source, il n'y a que l'exécutable et le fichier .uir. Ce que je cherche à faire, par l'intermédiaire d'une autre IHM 2 que je développe aussi sous Labwindows/CVI, c'est écrire dans un path control(chemin d'accès d'un fichier)  de l'IHM 1, afin que l'utilisateur n'est pas à le chercher, grâce à un bouton sur l'IHM 2. Est-ce possible?
Est-ce également possible de simuler un clic sur un bouton de l'IHM 1 grâce à un bouton de l'IHM 2?
Cordialement

Bonjour, Labwindows/CVI je ne connais pas. Je vais juste proposer une solution à
Titas a écrit : Est-ce également possible de simuler un clic sur un bouton de l'IHM 1 grâce à un bouton de l'IHM 2?
http://www.siteduzero.com/informatique/tutoriels/la-programmation-avec-autoit
wikipedia.org/wiki/Autoit : AutoIt est aussi utilisé pour simuler des applications utilisateurs, par lequel un script AutoIt pilote une application en lieu et place d'un contrôle manuel pendant le test d'un logiciel.
Luc Desruelle | Voir mon profil | LabVIEW Code & blog
Co-auteur livre LabVIEW : Programmation et applications
CLA : Certified LabVIEW Architect / Certifié Architecte LabVIEW
CLD : Certified LabVIEW Developer / Certifié Développeur LabVIEW

Similar Messages

  • [LabWindows] Créer et écrire dans un fichier texte

    Bonjour !
    J’ai quelques problèmes pour une chose qui doit être simple. Cependant en cherchant un peu partout, les solutions proposées en C ne marchent pas et j’ai l’impression que l’aide CVI est incomplète voir incorrecte.
    Je cherche à loguer un historique d'une communication CAN dans un fichier texte.
    Donc ce que je souhaite faire c’est :
    Créer le fichier texte ou l’ouvrir s’il est existant.
    Ecrire dedans (avec fprintf ou fwrite selon le cas le plus adapté)
    Le fermer et bien entendu le retrouver.
    Un exemple de ce que j'ai testé. Faux actuellement effectivement mais voilà sur quoi je suis parti.
    FILE *file;
    //on ouvre le fichier et verifie si on y arrive 
    if((file = fopen("fichier.txt", "r")) != NULL)
       fprintf("blabla\n"); // Ici je marque dans le fichier ce que je désire.
    fclose(file);
    Dans cet exemple j’ai une erreur avec fopen. J’ai donc plusieurs questions :
    1- Comment se fait il que fopen me retourne une erreur me disant « No such file or directory », puisque selon l’aide CVI, fopen ouvre OU créé le fichier s’il n’existe pas ?
    2- Dans quel dossier se trouver le « fichier.txt » créé ? Sachant que j’ai également essayé en mettant le lien complet de mon fichier texte que j’avais préalablement créé.
    3- Mon fprintf est il adapté dans le cas que je souhaite faire ?
    Voilà si vous pouviez m’éclairer sur ces points là ce serait sympa car je me suis formé sur le tas en CVI et c'est pas forcément évident !

    Bonjou
     fopen("fichier.txt", "r") va ouvrir le fichier en mode lecture (r : read), donc dans ce cas précis vous ne pourrez pas écrire ni créer de fichier. Ce qui explique surement l'erreur puisque dans ce mode on s'attend à ouvrir un fichier existant.
    Si vous souhaitez créer / ou modifiez un fichier existant j'utiliserai plutôt le mode "append" : a+  fopen("fichier.txt", "a+").
    Dans ce cas le fichier que vous allez créer se trouvera dans le même dossier que votre exécutable en mode debug ou release si mes souvenirs sont bons.
    Au pire vous pouvez faire comme cela :
    char repertoire_courant[MAX_DIRNAME_LEN];
    char chemin_fichier[MAX_PATHNAME_LEN];
    GetProjectDir(repertoire_courant);
    MakePathname (repertoire_courant, "fichier.txt", chemin_fichier);
    chemin_fichier contiendra alors le chemin absolu du fichier exemple : C:\projet\fichier.txt.
    Cordialement,
    Da Helmut

  • Je voudrais commander un petit moteur pas à pas à partir du port LPT dun boitier de commande . mais je ne sais pas quel programme écrire dans labview

    bonjour !
    je suis débutant dans l'utilisation de Labview.je dois commander une table de déplacement 3D ,je voudrais commander un petit moteur pas à pas chargé du déplacement suivant les axes(X,Y,Z) à partir du port LPT dun boitier de commande . mais je ne sais pas quel programme écrire dans labview

    Bonsoir Max,
    Le point de départ serait de consulter le site du constructeur de l'équipement (table trois axes) pour voir s'il n'existe pas déjà un driver existant (des fonctions à utiliser directement dans LabVIEW). S'il n'existe pas de driver, récupére la doc de l'équipement et prend ton courage à deux main, il va falloir se l'écrire, ce driver.
    Brut de pomme, deux liens:
    How Do I Use the Parallel Port in LabVIEW?
    Can VISA Communicate with Parallel Ports?
    Plus précisément: NI-VISA est une surcouche logicielle qui permet d'avoir une interface de programmation (API) commune pour différents types de bus (série, USB, PCI, und so weiter). Il est possible de l'utiliser pour adresser un port parallèle. Il y a aussi d'autres méthodes proposés (Cf.How Do I Use the Parallel Port in LabVIEW?, méthode 2, In Port.vi et Out Port.vi). Ceci constituerai la solution 'bas niveau' pour envoyer une commande et relire la réponse de ton équipement - fabriquer les fonctions LabVIEW / le driver de ton équipement, à partir de la documentation, en espérant que la doc mentionne les commandes de l'équipement ("comment-que-j'y-cause-à-mon-boitier-pour-qu'il-fasse-ce-que-je-lui-ai-demandé")
    Bon courage,
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • Choix de structure pour une IHM

    Bonjour,
    Je m'essaye actuellement au Xcontrol et tente une IHM un peu poussé que mes habituelles.
    Comme vous pouvez le voir dans mon programme j'utilise les splitters pour passer d'une "fenêtre" `l'autre lorsque l'on appuie sur les graphiques.
    Ma question est la suivante : faut il que je gère aussi ces mouvements comme des Xcontrols ? dans ce cas cela signifierait gérer tout la face avant en tant que Xcontrol non ? ou dois je tout laisser comme avant ?
    Je cherche juste à partir dans la meilleure direction pour la suite de mes développements.
    Merci d'avance !
    (normalement toutes les pièces se trouve dans le dossier)
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    IHM.zip ‏435 KB

    Salut,
    il n’y a pas l’ensemble du code, mais si je comprends bien tu veux faire un effet « slider » « swipe screen », pour décaler ta page avec un effet de mouvement et tu veux le gérer avec des splitters.
    Je réponds non à la question : je gère aussi ces mouvements comme des Xcontrols 
    Pour info, pour le principe, je pense qu’il y a plus simple, tu as une fenêtre, qui a une origine, tu changes programmatiquement l’origine. Je te conseille de regarder le projet de
    http://chrislarson.me/content/chris-larson/labview-vi-ipad-style-page-swiping
    même si l'ensemble du code n'est pas à prendre en exemple.
    J'ai codé une IHM qui gére plusieurs pages avec une gestion tactile, comme le soft de Chris.
    La gestion n'est pas un objet graphique, de type XControl, mais un process (ou actor ou acteur ou programme informatique) qui gére, en parallèle du reste du code, les actions (états, message) que lui produit ue autre structure.
    Donc structure producteur-consommateur, avec un structure "event" dans le code IHM du Main, qui produit sur détection d'actions de l'utilisateur sur l'IHM, par exemple par FIFO, à une deuximée boucle while en // (le deuximème process) des actions. Sur les actions, la deuxième boucle va gérer le "déplacer l'origine" de la fenêtre".
    Tu peux le coder facilement sur un base de QMH (ou QDMH), cf les templates de projet de LabVIEW.
    J'ai commencer, il y a quelques temps, à encapsuler le code de gestion "swipe" dans un code autonome, type Actor de l'actor framework, mais je n'ai pas terminé, par manque de temps, mais il faudrait... si je le termine je te le donne...
    A+
    Luc Desruelle | Voir mon profil | LabVIEW Code & blog
    Co-auteur livre LabVIEW : Programmation et applications
    CLA : Certified LabVIEW Architect / Certifié Architecte LabVIEW
    CLD : Certified LabVIEW Developer / Certifié Développeur LabVIEW

  • écrire dans un fichier texte existant

    Bonjour à tous!
    J'ai une petite question qui parait simple mais qui me pose un petit probleme.
    Dans mon projet, je créé un fichier .txt qui est sous la formes suivante :
    --> entête
    --> type de composant testé
    --> tests réalisés
    --> commentaires
    Cependant, je souhaite maintenant que si l'opérateur et la date sont les mêmes et que l'opérateur effectue des tests sur un autre composant, ces tests soient ajoutés à la suite des  premiers tests. Cela donnerait la forme suivante :
    --> entête
    --> type de composant 1 testé
    --> tests composant 1
    --> commentaires 1
    --> type de composante 2 testé
    --> tests composant 2
    --> commentaires 2
    Voilà j'espère avoir été clair.
    Merci pour votre aide
    Résolu !
    Accéder à la solution.

    julienDCNS a écrit :
    Bonjour,
    [...] pour ce cas, je ne vois pas comment synthétiser le diagramme, puisque c'est tout simplement la rédaction ligne par ligne de mon Procès verbal. Et beaucoup de lignes y figurent donc forcément beaucoup de texte à concaténer.
    Ca reste néammoins une suite de chaîne de caractère à écrire dans un fichier, il n'y a pas grand chose à comprendre
    Alors il faut repenser le déroulement du programme ! Si le texte du procès-verbal doit un jour être modifié, la maintenance du vi deviendra un vrai cauchemar, au point qu'il sera préférable de le re-écrire à partir de zéro !
    Un vi peut généralement être décomposé en plusieurs sous-vi (par exemple date, introduction, texte, conclusion, signature...). 
    L'ensemble du texte pourrait être placé dans une seule chaine de caractères  (qui pourrait être un fichier), écrite sur plusieurs lignes. Ensuite, le traitement consisterait à créer à partir de la chaine initiale un tableau de chaines (une ligne = un élément), et à utiliser une boucle pour utiliser un élément après l'autre.
    Si vous utilisez Word, vous devez aussi savoir qu'il existe une famille de vi qui permet de générer des rapports de manière automatique : on utilise un "modèle" et on rempli les champs... C'est rapide et propre.
    Trois idées qui devraient chacune conduire à un bloc diagramme tenant facilement sur l'écran...
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How to force the File Path Control Browser button to the RT Target instead of the host machine?

    I am building an application on a RT PXI system, and for one of the functions I would like the user to be able to use the browser button of the File Path Control to choose a directory on the PXI. However the browser button seems to only want open a file on the host PC, even though the application is fully deployed on the target. Note that I am controlling the PXI from a host PC.
    If anyone has any suggestions that would be great. Thanks.

    Hi,
    Unfortunately, there is not a VI to do this. Are you browsing to these files from your host VI? In order to access the files on your PXI RT target, you'll need to FTP in and browse to them that way. You could programmatically do this, but there is not a simple VI to do so.
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • File path control - browse button colour/color

    I can't change the colour of the browse button on a file path control. I'm using LV 8.5, but I think I have the same problem on 7.1
    Is the only way to change the colour to customise the control? Every other part of it seems to take colours from the tools palette.
    Thanks for any pearls of wisdom.
    Jon.

    I am able to change the path browse button color in 8.51 are you trying to change the button color or the color of the folder on the button.  To change the buttoin color use the paint tool and make sure you hit the space bar so you are painting the left color (Background color I cant remember which is which).  This probably doesnt work on system buttons.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • "File Path Control" default Value

    Hi - How do we set or change the default value for "File Path Control" (Control --> String & Path ---> File Path Control)?
    I typed the default path into the control field on the front pannel and save the VI file.  The value gone when I reopen the file.

    jimmy.chretien wrote:
    [...] difference between Not a path and Empty path... Why?
    Not a Path is a specific value for the path (<Not a Path>).
    Developers should use this to prevent situations in applications, where a user has to select a path before performing an action (e.g. saving a file). If the user skips the path selection, the application still has "Not a Path" and can prevent errors and tell the user to select the path (error handling!).
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • File Path Control question

    Simple question: How do I invoke the Open command in the File Path control? My reason is of my user hasn't supplied a file, then I want to force the user to select one.
    Solved!
    Go to Solution.

    Most file related vi should prompt if there is no file path. If for some reason you are not getting that you could check to see if the file path is empty and add a prompt see below:
    Tim
    Johnson Controls
    Holland Michigan

  • File path control-how to avoid the user to change the path string

    Hi all,
    I'm using "File path control" to chose file name. I don't want the user to write the path in the control directly (by typing) but only to choose the file via the button on the right.
    I can implement this behaviour with path indicator and button of course. But I belieave that it can be done more elegant - only disable the part with the string - not the whole "File path control". But how? I tried to customize the control but not success.
    Is it possible?
    jochynator
    LV 8.0.1, WinXP Pro
    Attachments:
    Path.vi ‏44 KB

    The way I've done it is to make the path part of the control tiny and hide it behind a string indicator.  Then whenever the path control changes value (by pressing the Browse button), I populate the string indicator with the path value.  Here's a sample VI demonstrating this method, saved in LabVIEW 8.0.
    Hope this helps,
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    path_browse.vi ‏12 KB

  • File path control: invoke file browser activation

    Hi there,
    on the front panel of a vi I want a file path control to open automatically the file browser window when the user clicks into the path control. Is there any way to do that programmatically after the mouse down event has been fired? I couldn't find a suitable method so far.
    Thanks for any hint,
    Peter
    Solved!
    Go to Solution.

    I should point out that the mechanism you (I am referring to the OP) are proposing is counter-intuitive. Web browsers have started to do this, but they do it claiming security issues. Frankly, I think the security concern is small compared to the annoying change in normal behavior, but that's my just my opinion - I can't change the way Firefox or IE works.
    Do you not have the Browse button visible for the control? Clicking this displays a file browser. This is normal and expected behavior. 
    Message Edited by smercurio_fc on 07-03-2009 09:21 AM

  • Send path control or reference to path control to sub vi

    Hello! I have a question of how to build correct labview structure. I have a path control in my main vi and want to check if it is correct in a sub vi. If not correct, ask the user for a correct one in the sub vi. I see two different options of how to do it and I think no one is realy good.
    1. Draw a wire from the path control to the input of the subvi. The answer from the sub vi is connected to a local of the path control. This uses locals that I should not use.
    2. Draw a reference from the path control to the input of the sub vi. In the sub vi change the value of the reference if path is not correct. No output is needed. Using reference you do not see where variables changes.
    How should I solve a problem like
    this?
    Please help me!
    TJ

    Thomas Json wrote in message news:<[email protected]>...
    > Hello! I have a question of how to build correct labview structure. I
    > have a path control in my main vi and want to check if it is correct
    > in a sub vi. If not correct, ask the user for a correct one in the sub
    > vi. I see two different options of how to do it and I think no one is
    > realy good.
    > 1. Draw a wire from the path control to the input of the subvi. The
    > answer from the sub vi is connected to a local of the path control.
    > This uses locals that I should not use.
    Local variables are fine. Don't worry about using them.
    Paul Cardinale

  • Path control dialog on FP

    How do make my path control pop-up say "Open File" instead of "Save File".  My path control dialog always opens with a dialog titled "Save As" in the pop window title. When the user clicks on the path control browse button I would like the title on the pop window to say Open File. My path control is not wired to anything I use a reference to read its value and send the path to an external application.
    I notice if I wire the open-file vi to my path control the pop-up will show "Open File" but wiring the path control is not necessary in my app.
    Thank ahead of time for responding
    Rich J

    OK, I can answer my own question. I put a File open vi on block diagram, create a file open control and replaced my path control (Save file) with the File open control. walla
    Rich J

  • Selecting Multiple File Types With Path Control

    My application uses a file path control for the user to specify an output file.  This output file can have two different formats (.csv or .mbf) which is unknown until the user specifies it through the file dialogue.  However, when the user inputs a file name with a .mbf extension (test.mbf, for example), the file path control automatically appends the typed-in name with a .csv extension (test.mbf.csv).  Given that the Pattern field on the control is written like this: *.csv; *.mbf., it seems that the control is simply taking the first file pattern listed and appending it to whatever is typed into the File Name field in the file dialogue box.  Selection Mode is set to "Files" and "New or existing".
    Anyone know a way to smarten up the file control to recognize the appropriate file type?
    Using LabVIEW 8.6.1.
    Thanks!
    Andrew
    Solved!
    Go to Solution.

    Instead of using the file path control, try using the Fial Dialog Express VI. This will bring up the same dialog box but will allow you much more flexibility. Replace your file path control with a button ("Specify Path" in my example code):

  • Browse Path Control: Selections Not Found or Displayed

    Selecting the multiple Pattern: *.xls:*.xlsx below from Path Properties does not produce the required files I am looking for, can someone point me in the right direction?  As you can see from the attached, Only selecting 'All Files (".") delivers the result I am looking for.  I have already pursued the following link with the same results. http://forums.ni.com/t5/LabVIEW/Add-multiple-selections-for-pattern-label-in-file-path-control/m-p/2....  I have also tried using the File Dialog Express.vi and Open/Create/Replace File.vi.
    Thank you for helping me address this issue.
    Solved!
    Go to Solution.

    Using a semicolon instead of a colon works for me.

Maybe you are looking for

  • Why can't I change the Top Sites on Safari?

    Seem unable to get Safari to save my website choices to Top Sites.  I have tried deleting preloaded ones & loading and pinning my choices but reverts back when Safari closed down.

  • How can you tell if an image's preview exists?

    OK, I actually needed to get some work done on my PB, so I turned off "New projects always generate previews" to make the fan shut up. Since then I've been making previews on a project-by-project or image-by-image basis. Now I can't remember which pr

  • Can I use russian licence for english CS4

    Hello! We bought a russian version of CS4 design standart. Can we use our licence for english version? Or how we can get an english interface by legal methods?

  • Fast battery drain

    Mavericks seems to be draining my MBA's battery faster than Mountain Lion ever did. Anyone else having this issue?

  • QT - "Buffer overrun detected", Wind XP

    hi all, I install QT normally on my Wind XP and after some days of use, one day, these window appear on my screen , http://img527.imageshack.us/img527/3997/quicktimeix2.jpg and Itunes dont work too. I already has the same problem on anothers versions