Insertion & decalage ds un tableau labview

bonjour
je galere sur un petit probleme
je voudrai concaténer des élements ds un tableau
g un tableau 2D (4*4 par ex) de booleens et je voudrai mettre tous ces booleens à la suite ds un tableau 1D
j'ai beau essayer à partir d'un tableau 2D, d'un 1D ( 4 tab de 4 elem) ou 16 elements à la suite je n'arrive pas à les enregistrer à la suite ds mon tableau
a chaque fois le nouvel element remplace le precedent
ds l'idéal il faudrait utiliser "array/insert to array" et reboucler la sortie vers l'entrée mais ca passe pas
si vs avez une petite idée
d'avance,merci
bill

Salut,
Voici un exemple très simple (en 7.0) avec tes deux méthodes:
- Avec 4 tableaux 1D de 4 éléments, il suffit de prendre la fonction "construire un tableau" et connecter les 4 tab et c'est tout (clic droit également puis cocher "concaténer les sorties", c'est ça qui fait toute la différence!).
- Avec 1 tableau 2D de 4*4, une boucle FOR, un registre à décalage et la fonction "insérer dans un tableau" (dans mon exemple, il prend ligne par ligne).
A+
Salutations,
Johann.
Pièces jointes :
tab_booléen.vi ‏34 KB

Similar Messages

  • How can I insert a C++ programm in labview 5.1;

    I am using Labview 5.1 to read data from sensors (analog input), but I would like to read data from a serial RS232 port. How I can do this;If I write a C++ program, how can I insert this in labview;

    Ah, I think I understand.
    Your ECU is sending a stream of six bytes...
    FF,data1,data2,data3,data4,data5
    And I guess it just does this continuously.
    So, you probably want to continuously read the data and update a data structure that shows all of your engineering data (such as what state the throttle and other things are in).
    There are a variety of ways you could handle the reading of data. E.g., you could just read all available data and search for 0xff, or you could read one byte at a time until you find 0xff. You could also just set your termination character to 0xff.
    Anyway, once you get your data into LabVIEW as a string, you can use the String to Byte Array function to create an array of int8's. (You could then search i
    n there for a -1 value for your synchronization byte.)
    Once you have an array of int8's, you can index it and use Number to Boolean Array to convert each int8 into an array of Booleans. This will get you the individual bits that come from the ECU.
    Hopefully this makes sense and gets you far enough along.
    Brian

  • Probleme insertion valeurs dans un tableau

    Bonjour,
    Je rencontre un petit probleme sous Labview 7.1.
    J'obtient des valeurs RMS d'un signal. J'aimerai faire une moyenne de 20 valeurs prisent toute les 1/4 ou 1/2 secondes. Le probleme est que je n'arrive pas a inserer ces valeurs dans mon tableau, la valeur precedente est remise a zero.
    De plus, quand j'initialise mon tableau en dehors de ma boucle, je ne peut pas raccorder mon initialized array car le format n'est pas le meme.
    merci.
    Attachments:
    test_file_record_4.vi ‏682 KB

    Pour ne pas perdre la dernière valeur entrée dans le tableau, il faut utiliser un registre à décalage.
    Le pb de connection est du à l'autoindexation  (clic droit sur le point d'entrée...). Par défaut les boucles For autoindexent les entrées de type tableau. C'est l'inverse avec les boucles while.
    J'ai corrigé et fait un peu de ménage dans votre vi.
    Ceci dit, je ne pense pas que vous arriviez ainsi à calculer votre moyenne... il faudra probablement revoir votre algorithme .
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    test_file_record_4[1].vi ‏703 KB

  • Aide tableau labview

    bonjour,
    je suis actuellement en stage, et mon projet est de piloter via carte ni6008 une alimentation delta.
    je suis débutant en labview donc j'ai quelque programme je vous détail mon programme.:
    le but du programme est de :
      -le bouton "lancer" programme' sert à activé le rpogramme.
      -le bouton "quitter" sert à arrété le programme.
      -le bouton "valider" sert a entré le données choisi  par l'utilisateur (Udebut,Ufin,..) dans le tableau
    et à chaque que appui sur "valider" cela rempli une nouvelle ligne suivante dans le tableau.
      -le bouton "effacer" sert à supprimer les données entrer dans le programme.
      -le bouton "charger" sert a ouvrir une fenêtre pour atteindre le fichier excel que l'on veut.
      -le bouton "enregistrer" sert à enregistrer les données du tableau dans un fichier.
      -le bouton "rampe/palier" sert a choisir le mode de saisi; si c'est "palier" cela on a Udebut=Ufin; si "rampe" on choisi comme on veux le Udebut et Ufin.
      -le bouton "phase" indique le temps de durée de chaque ligne au fur et à mesure de l'avancement.
      -le "graphe" sert à présenté les données du tableau.
    je sais que je demande quelque chose de long mais je suis bloqué.
    merci beaucoup d'avance cordialement. 
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    Diagramme de commande_v1.2.png ‏110 KB
    Diagramme de commande_v1.20.png ‏115 KB
    Face-avant de commande_v1.21.png ‏69 KB

    ah d'accord merci je vais essayer de le faire.
    j'ai une autre question conçernant le tableau:
    je veux envoyer des données que je choisi dans les commande(Udebut,Ufin,Heure..) vers mon tableau et je veux qu'à chaque appui sur entré cela envoi les donnée dans le tableau ainsi remplir le tableau( c'est à dire a chaque fois garder les donnée entré avant)
    j'ai réalisé un programme (ci-joint) mais ça affiche que la premiere et a chaque ça la modifie.
    Est ce que tu peux me le corriger ou me donner une astuce STP.
    merci encore et désolé du dérangement.
    Pièces jointes :
    Diagramme de tableau.v1.png ‏42 KB
    Diagramme de tableau.v10.png ‏30 KB
    Face-avant de tableau.v11.png ‏23 KB

  • Programmatically Insert ActiveX/COM Step Using LabVIEW

    Hi,
    I would like to be able to create sequences like the one attached, using LabVIEW.
    This sequence has only 2 steps, a LabVIEW VI call, and an ActiveX/COM Adapter Call.
    I have been able to do this using an adaptation of the code here: https://decibel.ni.com/content/docs/DOC-36337
    However, I am struggling to add the ActiveX/COM step.
    Any help would be gratefully received.
    Thanks,
    Dan
    CLD
    Solved!
    Go to Solution.
    Attachments:
    Valve Control - Test 1.seq ‏6 KB

    Obviously there is a way if you look for it
    Since you have an existing object of the "Step" class you can also get a "Module" object for it. Afterwards you have to specify that this is an ActiveX module. If you do not know that - probably you need to get it from the "Adapter" object somehow... Our case is simplier, so you just cast it to the ActiveX module and ... set some properties like ServerId, ActiveXReferenceExpr and so on.
    I have attached an example for you. Interesting thing is the ServerId - I have just read this chain from the TS for similar step and reused it here so don't ask me how to obtain it automatically
    You still have to fill your "Properties" like "file" - but I will graciously leave this job for you =
    Best Regards,
    CLA, CTD, CLED @ Test & Measurements Solutions Poland
    Attachments:
    ActiveX Step_2.vi ‏24 KB

  • HOW CAN YOU PROCESS AN AUDIO FILE IN LABVIEW?I NEED TO TIME-PITCH SCALE IT

    hello guys.
    can you insert an audio file into labview for further processing?i need to get an audio file (stored on my computer) and further process it for time-pitch scale.does anybody know how?any pointers will much be appreciated.
    regards
    alex

    hi there
    open the "Graphics & Sound" palette from the functions menu to use vis for reading/Writing wavefiles, search the examples shipped with LV for first steps. use the VIs in the "Analyze" functions palette to modify the data.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • VLC and LabView 2009

    I am trying to use the latest ActiveX VLC v1.1.4 in LabView, and every time I insert the VLC ActiveX Object, LabView crashes.  I've read other posts which noted success by either: 1) using a web browser ActiveX object calling VLC or 2)  finding a unique older version of VLC which doesn't cause their particular version of LabView to crash.
    I have yet to find a version of VLC which works with LabView 2009, and I'd prefer not to call a web browser ActiveX component just to play a video with VLC.
    Has anyone had success integrating a VLC ActiveX object in LabView 2009?
    Thanks,
    Stephen McClanahan

    just try the attached vi. Maybe this is what you are looking for.
    attached is 2010 and lv86 version.
    If you don't have Wait Until Next ms Multiple__ogtk.vi  look in the archive or download openg libraries.
    cosmin
    Attachments:
    vlc.vi ‏13 KB
    vlc ver86.zip ‏17 KB

  • Need help for "From concatenate string insert to mysql table"

    Well, most of this problem is a question about SQL syntax. In the VALUES clause you put a comma delimited list of the values to go into the new record. You insert one record at a time. How are the columns defined? Have you done any study on basic SQL?
    Mike...

    i nid to insert values from concatenate string into mysql with using LabSQL, but the result come out from conatenate string is like " 2015-07-08 00:00:00 38.933235E-3" , a logged data of "Date Time Wind Speed(m/s). i nid to put these 3 values into 3 different column in mysql which is Date Time and Wind Speed. How can i pick Date to put inside Date's column, Time into Time's column and Wind Speed into Wind Speed's column in mysql ?
    What i do is
    INSERT INTO wind_speed_data (Date, Time, Wind_Speed) The space in Wind Speed can i put a _ in between Wind Speed? without _ and just put Wind Speed it shows errors.
    VALUES( i have no idea wat to key in at this part ) <--- nid help !
    The Mysql table. Date Time Wind Speed
    The result from concatenate string. Have to insert into mysql.
    My labview program.
    The error i facing.
     

  • Mise en forme d'un tableau

    Bonjour,
    Grâce à un VI j'obtiens deux tableaux (Labview, 2D array of double), que je décompose ensuite en chaîne de caractères avant de les enregistrer dans un fichier txt (pour la suite des manipulations).
    Seulement voilà mon problème: dans la mise en page je n'obtiens jamais la première colonne pour les tableaux ce qui est assez embettant puisque je perds des données.
    Je vous joins une impression écran du VI qui traite les tableaux et un fichier txt "défectueux"  sachant que dans ce txt j'aurai du obtenir 4 colonnes de valeurs et non 3 et 4 lignes et non 3
    Merci d'avance.
    Dark'
    Dark'
    Mines de Douai
    Promotion 2013
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    Vi.JPG ‏34 KB
    000.txt ‏1 KB

    Bonjour
    aie aie aie
    En regardant votre code, j'ai l'impression que c'est bien compliqué pour quelque chose qui somme toute me semble assez simple.
    Vous utiliser la fonction extraire un sous tableau avec nombre de ligne=nombre de colonne = 1
    utiliser plutot index un tableau.
    De plus vous traiter la construction de la chaine texte éléments par éléments. utiliser plutot mon exemple pour tariter le tableau dans sont ensemble. Il n'est pas assez grand pour que cela consomme de la ressource et globalement le code est plus lisible.
    De plus, Attention : vous utiliser des variables sans dépendance ("i=n?"). Il est impossible de statuer quand la valeur sera prise en compte (avant ou apres son rafraichissement par la boucle FOR).
    Ce n'est pas parce que cela fonctionne que cela continuera et que cela fonctionne de la même façon en exe).
    Une fois toutes ces simplifications réalisée je suis certain que vous trouverez le problème.
    PS : Si vous ne désirez pas publier tout le VI, créer un sous Vi dédiée à la construction de la chaine de texte, Cela ne devrait pas poser de problème pour le poster.
    (je vous avouerais que recréer votre VI pour regarder son comportement, .... bof, trop long et trops complexe.)
    Salutations
    EricC
    Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
    Application Engineer / LabVIEW Certified Developer (CLD)

  • LabVIEW module use DLL

    In a teststand sequence file, it uses LabVIEW modules that call .NET DLL.  The DLL cannot be linked to the program.  If I were using LabVIEW only, I know that I can insert the DLL into a LabVIEW project and the VI in the project will know where the DLL are.  However, I am not sure about teststand.  Can someone help?  Thanks!
    Kudos and Accepted as Solution are welcome!

    Are you asking because you want to deploy the system? If yes, you should create a workspace and add the .NET DLL to your project as additional file. You can use the Deployment Utility to include the DLL in a MSI (Microsoft Installer).
    If you are NOT asking in the context of a deployment, please elaborate your question....
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM

    aajjf wrote:
    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM
    You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
    First fixed size arrays in C are inlined inside a structure, so are not a pointer but for the case of your val1 element three doubles.
    Second although not relevant here because of above point: LabVIEW arrays are not the same as C arrays. LabVIEW uses a pointer to a pointer and has the size of the array in elements prepended to the array data. C simply uses a pointer and all the rest is the programmers sorrow. The Call Library Node does convert the top level element of variables you pass according to the type configuration of that parameter but does no conversion of internal elements at all. So passing clusters with anything like arrays or strings is always wrong unless the DLL is aware of the specific datatypes LabVIEW uses.
    Last but not least you can end up with alignment issues. Elements in structures are aligned by every C compiler to a certain value. This value can be defined by the programmer in the project settings or for Visual C through #pragma pack() statements in the C code. The alignment rule says that an variable is aligned to the smaller of the two values that are either a multiple of the variable element size or the alignment setting. Most 32bit code nowadays uses 8 bit default alignment but LabVIEW always uses 1 byte. In your case there is nothing to observe since the large variables are at the beginning. Otherwise you might have had to insert filler elements in the LabVIEW cluster.
    One last thing bool is a C++ type only. Its size is 1 byte and incidentially this is the same LabVIEW uses for Booleans.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • User defined Error Codes

    Hello,
      I am using the "Bundle by Name" VI to insert error info into the Labview Error Cluster.   I am doing calculations and have assigned a -23096 to the error code and during program execution a dialog box pops up stating the following
    Possible reason(s):
    Analysis:  Too many decimal points.
    I am assuming the dialog box is being generated by the system because the -23096 is defined to in the the range for Math errors. So how do I defined my own error codes that Labview will not use and cause unexpected dialog boxes to appear. My approach to handing the errors is the I will check the error status flag and if the error is one of mine I will handle it.
    Regards,
    Kaspar
    Regards,
    Kaspar

    After rereading your last post I think I know what you are getting at. Here is how I create a custom error cluster.
    1.On your front panel lay down a "error in" control cluster found in 8.2.1 at Array Matrix and Cluster.
    2.Switch to your block diagram and right click this control and change it to a constant.
    3.Wire this constant into the top of a bundle by name function. Expand the bundle by name to show the 3 elements. For each element create a constant and enter your information. You can feed the output of this function to any error input of the following vi's or create an indicator and hook it to your front panel connector pane.
    Hope this helps
    Using LabVIEW 2010SP1 and TestStand 4.5

  • Expand a Excel-File

    Hello everybody,
    I want to expand an Excel-File. I want to open it and write data in a new line line.
    I want to do some measurements and write the gotten data to the Excel-file.
    Every measur-data should get its own line. Is that possible. I didn´t find any example in the example finder.
    Could somebody help me please dealing this.
    With kind regards
    Daniel

    If you are using the Report Generation Toolkit go to http://zone.ni.com/devzone/cda/tut/p/id/3178 . This is a pretty good tutorial on how to use it. You might be particularly interested in the design 4 Excel Insert Cells function.
    Using LabVIEW 2010SP1 and TestStand 4.5

  • Why map sensors unable to detect sensor under Measuremen​t category in SolidWorks (SWs)

    In Labview Project Explorer, when I want to add 'map sensors' to the Solidworks model, it only detect the sensor under the 'Dimension' type shown on the FeatureManager Design Tree' on the left side.
    While sensor under type 'Measurement' cannot be detect. Can anybody kindly explain why Labview cannot detect sensor under 'Measurement' type? Thanks in advance.

    I've been trying to map sensors the Measurement sensor. But it could not detect Measurement sensor. It can only detect Dimension sensor.
    I can't use the Dimension sensor because it requires measurement on a plarnar surface, while my model is curved. So I need to use Measurement sensor, point to point measurement to detect the length between the two components.
    It mention in Labview 2014 softmotion help that both Dimension and Measurement sensor are applicable in NI Softmotion.
    But why it only detect Dimension? Do I need to insert any extra command for labview to detect Measurement sensor?

  • 外部DLLを用いて文字列型の2次元を取得したい

    吉田と申します。 はじめまして。
    さっそくなのですが、外部DLLからデータを取得し、
    LabVIEWでデータ変換を行いたいと考えています。
    戻り値としてほしいのは、文字列型の2次元配列なのですが、
    DLLの中で文字列操作の手順がいまいちよく分かりません。
    サンプルプログラムを見ても、コンパイルが通らずお手上げです。
    コンパイルが通らなかったサンプルプログラムは、
    Call DLL.vi内のLStrHandle 文字列で表示されるソースです。
    [strncpy:1番目の引数を'unsigned char[1]'から'char *'に変換できません。]
    と出ます。
    LabVIEWから作ったインターフェース
    /* Call Library source file */
    #include "extcode.h"
    /* Typedefs */
    typedef struct {
           long dimSize;
           LStrHandle elt[1];
           } TD1;
    typedef TD1 **TD1Hdl;
    short testFunc(char arg1[], TD1Hdl *arg2);
    short testFunc(char arg1[], TD1Hdl *arg2)
           /* Insert code here */
    例えば
    「このプログラムにarg1で受け取った文字列を、
    arg2の全ての要素に対して入れる(要素数は変動)」
    処理をしたい場合どのように書けば実行できるのでしょうか?
    お手数ですが分かる方がいましたら教えていただけますよう、
    よろしくお願いいたします。
    以下環境です。
    LabVIEW:8.2.1
    DLL作成:MS VC++ 6.0
    インクルードでcintoolsディレクトリ指定済み
    リンクでlabview.lib指定済み
    使用するランタイムライブラリ マルチスレッド(DLL)指定済み
    構造体アライメント1バイト指定済み

    Say it in English.
    - Partha
    LabVIEW - Wires that catch bugs!

Maybe you are looking for