Labview : Communicat​ion série avec un périphériq​ue

Bonjour,
Sous Labview, j'essaie de communiquer via un port série à un périphérique. En parallèle, j'essaie de recevoir et d'envoyer des données. Je voudrais me placer en mode écoute (Activer la réception sur ce port : Visa read) puis envoyer une commande (Visa write). De ce fait, en se plaçant en écoute avant l'envoie de la commande, je suis sûr de recevoir la réponse du périphérique.
Je veux donc envoyer un caractère tout en écoutant sur le même port com la réponse de mon périphérique (J'ai déjà un doute à ce sujet. Avec un port série, on peut lire et écrire en même temps ? )
Mon problème est le suivant : En lançant ce programme sous Labview, il se place en écoute mais n'envoie pas le caractère de commande (montage en parallèle). Après le timeout de l'écoute (Visa read), le programme écrit bien le caractère (Visa write) comme un fontionnement série.
Comment réaliser des tâches multiples en parallèle sur LabView ? Auriez-vous un exemple ou plus d'information à ce sujet ?
Merci,
Jérémy

Bonjour,
je confirme le fait qu'un UART ne peut pas travailler en "parallèle".
Pour dialoguer avec un équipement, il faut envoyer une commande "Write" si besoin, pour que le produit te réponde.
Tu récupères ensuite la réponse avec un "Read".
Pour dimensionner le nombre de données à lire, plusieurs méthodes par la suite se présente à toi.
- Attendre un certain temps : Interruption de la lecture sur timeout
- Attendre un caractère de terminaison \A : 0xD par défaut.
- Lire un certain nombre d'octet : Utilisation du noeud de propriétés nbre de bytes sur la liaison fortmeent conseillé.
Si après une manipulation simple, tu ne relies pas de données, n'hésites pas à mettre une temporisation de 100 ms entre ta requête et ton écoute, il n'est pas rare d'avoir des équipements avec un temps de réponse de l'ordre de 50ms sur port série (spécification présente dans la documentation de l'équipement en général).
Bonne journée,
Michael

Similar Messages

  • Labview communicat​ion balance ohaus

    Bonjour,
    Je travaille sur labview 7.1 et je n'arrive pas à communiquer correctement avec ma balance (ohaus arc120).
    Pour comuniquer j'utilise un cable rs232 croisé que j'ai fabriqué à partir d'un cable droit et un adaptateur usb/rs232.
    Lorsque je récupère les données de la balance via le bouton print de la balance, tout marche, j'ai la bonne valeur.
    Mais lorsque je la commande avec le pc, je n'ai pas toujours de signal. Lorsque j'en ai un, la valeur que je recois est éronnée. le nombre d'octets lu n'est pas constant et il y à des erreurs de cadrage: il manque une partie de la valeur (ex: 2,3g au lieu de 2,83g) ou m'indique totalement autre chose ( caractères spéciaux, lettres...)
    De plus je ne recois aucun signal si dans mon VI je ne répète pas 7 fois l'instruction écrire dans une boucle. Pour la tare c'est pareil, je dois répété l'instruction 5 fois.
    Pour réussir à écrire puis à lire il faut que j'ouvre un session visas pour écrire, que je la ferme, puis que j'en ouvre une nouvelle pour lire. Sinon il n'écrit pas.
    J'ai aussi essayé de communiqué directement en rs232. je recois la bonne valeur en appyuant sur le bouton print, mais je n'arrive pas commander la balance.
    J'ai vérifié les paramètres de transmissions, ils sont correctes.
    Pouvez-vous m'aider ?
    Merci beaucoup
    Cordialement
    Solved!
    Go to Solution.
    Attachments:
    arc120.pdf ‏129 KB
    balance avec deux sessions visas.vi ‏129 KB
    capture d'écran.doc ‏79 KB

    Try this PIN out for RS232 cable :
    Below are the two cable configurations that will work with 9 pin and 25 pin serial ports. You will notice that pins 2 and 3 are not crossed in the 9 pin but are in the 25 pin. In any case pins 5 and 6 have to be shorted at the balance end of the cable. One cable type will work with both balances.
    Ohaus Part number - AS017-09 Used with AP, AS, C, CT, E, G, GT, I5, TP, TS, MB200, Adventurer, Explorer, Voyager, Navigator and Scout.
    Cable - balance to PC
    9 pin(F) to 9 pin(F)
    Balance pin -----to----- PC pin
    PIN 2 (TXD) -----to----- PIN 2 (RXD
    ) PIN 3 (RXD) -----to----- PIN 3 (TXD)
    PIN 7 (GND) -----to----- PIN 5 (GND)
    For balances other than Adventurer pins 5 & 6 must be shorted together at the balance and NOT connected to the computer. This is not required in the Adventurer balances.
    CLA 2014
    CCVID 2014

  • Communicat​ion ethernet crio avec un modem wireless

    Bonjour,
    je souhaite envoyer des données sur un server FTP via un modem 3G connecté par câble ethernet sur mon compactRIO.
    Le problème est que je suis débutante dans la programmation labview et que je n'ai aucune idée comment réaliser cette fonction.
    J'ai paramétré le modem et le cRIO avec une IP fixe dans une même plage pour qu'il puisse discuter ensemble.
    J'ai recherché des exemples sur NI pour m'orienter dans une direction de programmation, mais je n'ai rien trouvé.
    Si quelqu'un pouvait m'aider..
    Cordialement,
    Julie

    Merci d'avoir épondu si vite.
    Je ne sais pas faire du FTP filaire, pour l'instant j'essais de voir comment fonctionne les VI FTP sur labview, mais j'ai beaucoup de difficultée à avoir un résultat.
    Je n'utilise pas le toolkit NI FTP, devrais je?
    Pour ma connexion 3G j'utilise un modem de chez Sierra Wireless le raven Xe connecté en ethernet sur le cRIO.
    Les paramètres que j'ai configuré sont les suivant:
    cRIO: port ethernet 1: IP 192.168.13.102
             masque de sous réseau: 255.255.255.0
             port ethernet 2: IP 192.168.13.104
             masque de sous réseau: 255.255.255.0
    mon ordinateur : IP 192.168.13.101
    masque de sous réseau: 255.255.255.0
    et le modem IP 192.168.13.102
    masque de sous réseau: 255.255.255.0
    Merci beaucoup pour votre aide
    Julie

  • Siemens S7 300 PLC and Labview Communicat​ion

    Hi,
    I am attempting to communicate between Labview 7 and a Siemens S7 300 (CPU 314) PLC. I would prefer the communication to be over Ethernet or RS 232. Could you help me out with this implementation and let me know what additional hardware/software I may require for doing this.
    Thanks,
    Shameek

    Shameek wrote:
    I am using a CP-343 communications processor to connect the S7 300 to industrial ethernet.
    Now can I commnicate directly from Labview to the PLC?
    I still havent figured out where the OPC server comes in and whether it is an option or a necessity.
    Using OPC is an option.
    Siemens has an the add-on ($$) library/FB  that includes code for enabling Modbus communication with S7 300 CPUs. I've never used it, but info is here.
    <snip>
    Our solution
    With its MODBUS function block (FB) and the CP343-1 and CP443-1 SIMATIC S7 communications processors, Siemens can supply a proven solution for the integration of SIMATIC automation systems into other system landscapes. This function block enables data to be exchanged easily between MODBUS-compatible devices from different manufacturers and SIMATIC S7 stations from S7-300 and S7-400 systems.
    </snip>
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • Local SQL Database & Labview communicat​ion

    I created an sql database with sql server 2008 R2. I wish to be able to insert data to this database locally. Can someone please tell me if this can be done, and if it is possible, could someone give me the steps I have to follow?
    Thanks.
    Solved!
    Go to Solution.

    Another source of information would be a 3 part series on databases (check the link in my signature). The process is largely the same regardless of the DBMS you are accessing.
    With SQL Server you will need a user I'd and password. Did you install the SQL Server yourself?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Numéro de série avec un produit étudiant

    Bonjour, j'ai acheté la série Creative Suite 6 Design Standard étudiant. En ouvrant la boite, je constate qu'il n'y a pas de numéro de série et qu'il faut que j'aille sur le site internet pour m'en procurer un. Hélas, la page web ne marche pas. J'ai mon numéro de produit mais qui ne fonctionnement pour activer mes logiciels.
    J'aimerais qu'on puisse m'aider à me donner un numéro de série avec le numéro de produit que j'ai avec ma boite.
    Espérant qu'un vrai technicien puisse passer par ici.
    Contacter moi -> Deliaku

    Contact your regional S&T support by web chat or phone. Nobody here can do anything in such matters.
    Mylenium

  • Communicat​ion USB

    Bonjour ; 
    S'il vous plais ;  je developpe une interface LabVIEW pour controler un variateur de vitesse (0-100hz ) et affiche la frequence courante , j'ai pas compris ce qui manque ce programme  (Attachments: ci join )? , il m'affiche ERROR à chaque fois  !  
    Attachments:
    question furom.png ‏59 KB

    Help >> Explain error >> -1073807346
    Il semble donc qu'il y a un soucis avec le port sélectionné ou avec le périphérique.
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Modifier paramètres de communicat​ion port série

    Bonjour a tous,
    Je souhaite réaliser un programme sous Labview pour communiquer avec un système à l'aide d'un port série. Pour cela, j'ai besoin de modifier certains paramètres de connexion cf ci-joint :
    IOCTL_SERIAL_SET_QUEUE_SIZE: Set queue size
      InSize=1024 *******               
      OutSize=1024 *******
    IOCTL_SERIAL_SET_TIMEOUTS: Set timeouts
      ReadIntervalTimeout=4294967295
      ReadTotalTimeoutMultiplier=0
      ReadTotalTimeoutConstant=0
      WriteTotalTimeoutMultiplier=0
      WriteTotalTimeoutConstant=65000 *******
    IOCTL_SERIAL_SET_BAUD_RATE: Set baud rate
      Baud Rate=9600
    IOCTL_SERIAL_SET_RTS: Set RTS
    IOCTL_SERIAL_SET_DTR: Set DTR
    IOCTL_SERIAL_SET_LINE_CONTROL: Set line control
      WordLength=7
      StopBits=1 stop bit
      Parity=Even parity
    IOCTL_SERIAL_SET_CHARS: Set special characters
      EofChar=0x0
      ErrorChar=0x0
      BreakChar=0x0
      EventChar=0x0
      XonChar=0x11
      XoffChar=0x13
    IOCTL_SERIAL_SET_HANDFLOW: Set handshake information
      ControlHandShake=1 *******
      FlowReplace=64 *******
      XonLimit=10 *******
      XoffLimit=10 *******
    IOCTL_SERIAL_SET_HANDFLOW: Set handshake information *******
    Les lignes contenant des étoiles correspondent aux paramètres que je n'arrive pas à configurer. Pour les autres, j'utilise les noeuds de propriété. Je suppose qu'il en est de même pour les paramètres manquants mais impossible de trouver. Quelqu'un aurait-il une idée ?
    Merci bien.
    David

    Tu peux utiliser un Noeud de propriété.  Voir les images ci-dessous:
    Attachments:
    serialSettings1.PNG ‏29 KB
    serialSettings2.PNG ‏19 KB

  • Using existing c code for usb-hid communicat​ion in labview

    Hello,
    I want to write a simple temperatrue logger using labview and a external hardware which communicates over usb-hid. The external hardware uses an ATMEL 90USB162 µC and DS18B20 sensors.
    Link to the hardware:
    http://www.diamex.de/dxshop/USB-Temperatur-Sensor-​Tester-fuer-DS18B20
    The source of a a simple command line tool is available (see attachement), which reads out the temperature value of the connected sensors.
    Is it possible to include this c-code in the labview application to simplify the communication?
    Thanks a lot and best regards,
    Michael
    Solved!
    Go to Solution.
    Attachments:
    CMDLINE.zip ‏17 KB

    I'm not that experienced at this personally (in terms of compiling C code into DLLs), but I believe the process you need to go down to call your C code in LabVIEW is to compile the C code into a DLL which you can then call from LabVIEW using a Call Library Function node (or you can try to use the "Import Shared Library" wizard to automatically generate SubVIs).
    There's more information here:
    http://digital.ni.com/public.nsf/allkb/DCB90714981​A1F148625731E00797C33
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • PLC Communicat​ions with Labview

    How do I view and record data from my plc to labview, currently we are using autmation directs DL205 with the 260 processor

    If the DL 205 communicates through the Modbus protocol, you could use the Modbus library. This library consists of a bunch of VIs which can be used for Modbus communication. Think of them as advanced Serial read/write VIs. However, if you are looking into monitoring, datalogging and controlling the registers, then I would recommend the LabVIEW Datalogging and Supervisory Control Module. Using shared variables, you can then easily bind, control and talk to the registers and most of the work is taken away from you.
    If the DL 205 doesn't communicate throught the Modbus protocol, then you would need an OPC server (like the NI Industrial Automation OPC Servers) and the LabVIEW DSC Module. You can then communicate from the LabVIEW DSC Module with the OPC server.
    Message Edited by Adnan Z on 03-15-2007 10:27 AM
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Serial Communicat​ion problem in LabVIEW 7.0

    I recently upgraded my test computer from a 450 Mhz machine to a
    Del 2.8 Ghz Pentium 4processor with 512meg's of ram using Windows 2000 for the operating system running LabVIEW 7.0.
    I use the serial port to communicate with a piece of hardware,
    Rs232, 115200 baud, 8 bits, 2 stop bits. NO hardware or software handshaking
    The hardware is capable of receiving data from the computer at a full 115200 baud up to 65k transfers at a time with no extra delays.
    The problem that the serial data coming from the new Dell computer will send out 2 bytes then waits 2 to 3 milliseconds and sends 2 more bytes.
    I generated a separate serial VI that will jest shove data out the serial port.
    The VI is a VISA configure serial po
    rt, into a while loop that contains 6 VISA Write VI
    And on the backside of the wile loop a VISA close.
    The above VI will generate the serial data stream as stated above
    EXCEPT when I put a PROBE on each of the ERROR OUT of the 6 writes, then the serial port will generate a continuous serial data stream with no millisecond breaks.
    I have changed the FIFO Buffer settings (all the possible combinations) of the serial port in Windows 2000, and that has hade no effect.
    Any help would be greatly appreciated
    James Zumstein
    E-mail [email protected]
    Attachments:
    Serial_Test_1.vi ‏45 KB

    Greetings!
    Serial port commucations problems can be a real joy, can't they? Have you tried communicating with your instrument with Hyperterm? Usually Hyperterm is capable of operating with almost no overhead, so you can see if there's any strange symbols being transmitted that might be holding things up. There might be an extra CR being inserted, or something like that, which will show up as heiroglyphics in Hyperterm. See if all your symbols coming back are valid. This is where I usually start.
    Hope this helps.
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • Problème avec communicat​ion TCP

    Bonjour à tous,
    J'essaie de faire communiquer 2 PCs (un serveur et un client) par TCP via LabVIEW mais ça ne marche pas.
    J'aurais voulu donc vous montrer ce que j'ai codé afin que vous me disiez s'il y a des erreurs de codage.
    Pour l'instant je veux envoyer la commande NULL qui interroge le PC
    serveur sur son état. Celui ci renvoie alors normalement un message de
    statut (écrit en XML) par TCP au PC client sur lequel se trouve LabVIEW.
    Lorsque j'exécute mon code le logiciel sur le PC serveur (qui doit
    normalement me renvoyer le msg de statut) sort une erreur : "Une
    opération a été tenté sur autre chose qu'un socket. Could not process
    the command NULL".
    Ma question est alors est : y a-t-il un problème avec mon code LAbVIEW
    ou est ce un problème de configuration réseau sur le PC Serveur ?
    Merci beaucoup,
    A++
    Attachments:
    test3.GIF ‏17 KB

    Malheureusement, je n'ai pas d'experience avec LabVIEW et l'utilisation de sockets.
    Je craint que cela ne soit pas facilement possible, suite de la lecture de cette proposition d'idee:
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Acce​ss-to-sockets-other-than-TCP-UDP/idi-p/1481952
    Cependant, voir cette discussion qui inclus un exemple:
    http://forums.ni.com/t5/LabVIEW/Implementing-Data-​Sockets-and-Ports/m-p/45775

  • What communicat​ions protocols does LabView support?

    A customer of mine is using LabView.  He has asked me if I can communicate to it using a PLC.  Either GE Fanuc or Allen-Bradley.  I need to know what methods of communication that LabView has available to talk to these PLC's.

    The short answer is: whatever protocol you want to talk...
    I have developed applications talking to AB stuff, modbus (which will cover most PLCs) and even TI's old proprietry PLC protocol. There are lots of tools for making the connection in lots of ways.
    What are they specifically needing--or do they know yet?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Comment créer une communicat​ion entre labview et "usb-1208l​s"

    Je viens d'installer le logiciel de "USB-1208LS" sur mon ordinateur mais j'ai envie et j'airéussi à voir des signaux mais seulement j'ai envie de communiquer entre mon logiciel et labview en gros j'ai envie de récupérer ses données sur labview je ne sais pas comment procédé mais je sais quand même qu il est compatible avec labview. Merci!

    Hello,
    You're in the english part of the forum, next time make sure your posting on the french forum.
    To acquire Data from your USB-1208LS device with LabVIEW, you'll need to install the driver API for LabVIEW here:
    ULx for NI LabVIEW
    http://www.mccdaq.com/daq-software/universal-libra​ry-extensions-lv.aspx
    And there a link to learn how to use it with LabVIEW :
    DAQ-Software-Quick-Start
    http://www.mccdaq.com/PDFs/Manuals/DAQ-Software-Qu​ick-Start.pdf (refer to p29)
    And another documentation to implement different functionnality and programming in LabVIEW
    Getting Started with NI LabVIEW Student Training
    http://zone.ni.com/devzone/cda/tut/p/id/7466
    Hope you'll find every information you need
    Best regards
    Victor F. | Application Engineer
    Certified LabVIEW Developer | Certified TestStand Architect
    National Instruments France

  • Communicat​ion lecteur RFID et labView

    Bonjour je travaille sur un projet RFID je viens de commencer je veux savoir comment se programme un lecteur RFID à partir De LabVIEW? quelle est la structure des trames et le mode de dialogue PC/lecteur avec labview merci

    Salut,
    Tu trouveras la réponse à ces questions dans la datasheet de ton lecteur RFID.
    Reg

Maybe you are looking for