Lecture message redondant sur un port serie rs232

Bonjour,
J'ai un système qui m'envoie un message sur le port série toutes les secondes.
Donc je viens lire le port série toutes les secondes et j'enregistre les messages dans un fichier texte.
Quand je dépouille le fichier je m'aperçois que des fois j'observe dans le fichier que j'ai 2 fois le même message (or théoriquement c'est impossible).
Est-ce mon système qui m'envoie 2 fois le même message ou alors il existe une configuration de lecture qui permet ceci ou bien c'est l'écriture dans le fichier qui pose problème et qui peut créer ce phénomène .
Merci
Pièces jointes :
exemple.png ‏115 KB

Ouverture port série, flush buffer, lecture de 34 octets, écriture sur disque des octets sur une ligne dans fichier texte. Je pense à la lecture du code que c’est l’appareil qui retourne 2 fois les mêmes données.
Attention à la gestion de l’erreur sur l’écriture dans le fichier texte !
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

Similar Messages

  • Ouvrir un fichier .va et envoiyer sa contenue via un port serie rs232

    Salut, comment parcourir un fichier .var (ou .txt) (ensemble des données séparées par un ' ] ') et envoyer ses données (donnée du position 34) via un port serie RS232 ? merci

    Hello, this question covers 2 different arguments for which I can give some hint. I'm afraid I'm not able to answer in french.
    Step 1: read a text file and parse element by element. This can be done by using either standsrd C commands (fopen, frad, fclose) or by using CVI Formatting and I/O Library commands (OpenFile, ReadFile, CloseFile). In either case, unless the file is huge you can probably read int entirely in memory and proceed next to parsing the resulting string
    Step 2: parsing the file and sending through serial. You can proceed by steps using strtok command. After each token is found you can transmit it over the RS232 with ComWrt command (prerequisite is to open the port with OpenComConfig at the beginning of the process and close it at the end with CloseCom)
    All functions used are well documented and there are several examples that show how they can be used. I suggest you read the online help for each of then: inside the help you will find links to sample programs that demonstrate each command usage.
    Last hint: if you are not familiar with the English language you can repost this question in the french board.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Comment, à parir d'un programme labview peut-on ecrire dans un port serie rs232

    Bonjour,
    je suis actuellement en stage et je cherche à réaliser un programme labview permettant d'imiter un capteur donnant une profondeur et une altitude.
    les informations sont à envoyées à un programme labview sur compact RIO via une liaison RS 232.
    en vous remierciant d'avance,
    cordialement

    Salut,
    Pour écrire sur un port série RS232, il faut utiliser les VIs "VISA Read" et "VISA Write" dans E/S d'instruments => Série de la palette de fonctions du diagramme pour envoyer/recevoir des données. Il faut aussi avant toutes choses configurer le port sur lequel les données vont transiter. Pour cela, utilise le VI "VISA Configure serial port" et "VISA Close" (accéssoirement pour cesser les échanges) dans la même palette.
    En espérant que cela ai put t'aider =)
    @ +

  • Gestion de l'envoi octet par octet par le port serie RS232

    Bonjour,
    Voila je suis dans le cadre de mes etudes en stage en angleterre. Et je dois realiser une communication utilisant le port serie entre un FPGA sur lequel je suis en train de creer l'UART, et une interface Labview que je veux maintenant creer. Le probleme est que je voudrais n'envoyer que deux octets a chaque fois preceder d'un champ sur aussi un octet pour specifier le type de donnees. Je souhaiterais donc pouvoir n'envoyer qu'un seul octet a la fois, et de meme pour la reception, il me faut etre en mesure de recevoir les octets un par un... Je veux donc etre en mesure de n'envoyer que 3 octets lors d'une communication dont je decide du contenu..
    Je viens de passer toute mon apres-midi a chercher, mais je ne rien trouve... Est ce que quelau'un sait si cela est possible? Et si oui comment, parce que je n'ai trouve que la possibilite que d'envoyer des caracteres ou des nombres decimaux par leurs codes ASCII.
    Merci d'avance.

    Bonjour Adrien,
    Afin de t'aider au mieux peux-tu nous décrire quel matériel utilises-tu ? Est-ce un cRIO ?
    Et quelle version de LabVIEW également ?
    As-tu regarder les exemples LabVIEW de communication série utilisant l'API VISA ?
    Si j'ai bien compris, tu souhaites transmettre des informations du FPGA à un périphérique externe via le port série d'un cRIO j'imagine. Pour cela tu envoie ces données-là au controleur temps réel qui lui dialogue vraiment avec le port série.
    Ce que tu veux envoyer étant une trame de 3 octets c'est-à-dire un en-tête puis 2 octets de données. Est-ce bien cela ?
    Enfin, pour information tu es sur une section anglaise du forum. Je te conseille pour maximiser tes chances d'avoir une réponse de la part de la communauté de poser ta question ici en anglais ou alors directement dans la section française -> ici.
    Cordialement,
    Jean-Philippe C.
    National Instruments France

  • [labview 8.2] probleme de lecture sur port serie

    Bonjour, j'ai un probleme avec la fonction "VISA READ".
    J'envois une requette sur la rs232, je regarde le nombre d' octets sur le port (Byte at ports) et lorsque le nombre d'octet  est superieur ou égale à 96, je lance la lecture.
    Or il y a un trame, je ne sais pourquoi, qui n'est pas lu correctement.
    Le "Byte at ports" me renvoit bien 96 (j'ai en plus un analyseur de trame qui me confirme que la trame fait 96 octet) je rentre "en dur" 96 octets à lire à la fonction "VISA READ" et pourtant la trame de sortie ne fait que 13 octets et ceci à chaque fois?
    Merci d'avance de vos solutions.
    Cordialement
    Mathieu R.

    [resolu]
    le probleme venait de l'init du port com dans lequel il y a par defaut le "enable terminaison char".
    Donc mes trames étaient coupées des la reception d'un "0A"

  • Probleme de lecture sur port serie

    Je desire aller lire a une adresse precise grace a ma liaison serie mais je ne trouve aucun VI capable de m'aider comment faire?
    D'avance merci

    Bonjour,
    Pouvez vous précisez votre question ?
    A quoi correspond votre adresse.
    Le protocole série est point à point vous n'aurez qu'un périphérique sur chaque port COM.
    généralement pour dialoguer avec un périphérique sur port COM il vous faut un protocole d'échange qui est puls ou moins complexe. Sans connaissance de ce protocole vous ne pourrez pas dialoguer avec votre périphérique. Ce protocole constitue une suite de caractère à envoeyr dans une ordre précis avec des attribututs de vitesses de transmission et de trame connus.
    Les VIS de la palette VISA doivent vous permettre d'émettre et recevoir n'importe quelle trame sur votre port. Ils vous permettent aussi de gérer le bus en mode HandShake CTS/RTS XON/XOFF.
    J'espères que ces informations vous permett
    ent d'avancer
    Sincères salutations
    Salissou ISSA
    Ingénieur d'applications
    National Instruments France

  • Labview sur ubuntu, utilisation port serie

    Bonjour,
    J'ai installe LabView 2009 sur ubuntu et je voudrais pouvoir communiqueravec le port serie de mon pc.
    J'utilise donc les VI visa serial, mais j'obtiens ce genre de message d'erreur !! 
    "Possible reason(s):
    LabVIEW:  (Hex 0xBFFF009E) VISA or a code library required by VISA could not be located or loaded.  This is usually due to a required driver not being installed on the system. "
    Je suppose que les drivers ne sont pas installés, mais je ne trouve pas comment les installer ???
    Si qq'un peut m'aider SVP
    RP 

    Maxime MULLER a écrit:
    Bonjour,
    Effectivement après une installation il faut toujours redémarrer afin que LabVIEW puisse prendre en compte les nouveaux drivers.
    Pareil...!! 
    Ci cela ne fonctionne toujours pas, alors c'est que les drivers ne fonctionne pas pour Ubuntu en effet, ceux-ci n'ont pas été testés et validés pour cette distribution de Linux comme vous avez pu le voir sur la page de téléchargement des drivers ou sur la page de LabVIEW pour Linux.
    Cordialement,
    pfff, vous me conseilleriez quoi comme distrib a la place d'ubuntu ??

  • Lecture sur 2 ports d'une DIO-32-HS sur front descendant d'une horloge ?

    Bonjour,
    Je voudrais effectuer une lecture sur 2 ports, sur front descendant d'une horloge (Je voudrais faire cela sur 2 ports d'une carte DIO-32-HS, sachant que j'ai préalablement configuré ces 2 ports en entrée digitale, puis je les ai groupés. J'ai aussi généré le signal d'horloge à l'aide d'une PCI-6602).
    Ma question ne concerne donc que la lecture sur les 2 ports : comment puis-je la faire sur front descendant de l'horloge ? Je précise que je voudrais réaliser une lecture de la donnée présente sur ces 2 ports, pour CHAQUE front descendant de l'horloge (et envoyer au fur et à mesure les données dans un buffer).
    Merci d'avance pour toute aide.
    Julien

    Bonjour,
    Pour vous aider dans votre développement de programme, je vous conseille d'utiliser les exemples de la bibliothèque CVI, spécialement celui situé au chemin suivant : CVI\Samples\daq\di et il s'appelle DISingleBufExtTrig653x.prj.
    De plus, je vous joins un document très intéressant concernant l'utilisation des cartes DIO. Des exemples en CVI y sont également illustrés.
    Bon courage,
    Cordialement.
    Attachments:
    32HS&6533.pdf ‏147 KB

  • Probleme Ecriture port serie, quel code envoyer

    Bonjour,
    Actuellement en école d'ingénieur, dans un projet pour une entreprise, je dois réaliser un VI permettant la lecture de données d'un capteur (thermocouple) sur lequel un microcontroleur a été gréffé, puis par la suite on souhaite envoyer des informations au capteur pour pouvoir modifier son gain, son offset.
    Mon problème se situe au niveau de l'envoie d'information.
    L'entreprise travaillait sous hyperterminal. Lorsque que le capteur envoyait les informations, il suffisait d'appuyer sur la touche "a" du clavier pour selectionner le paramêtre à modifier, appuyer ensuite sur "p" pour augmenter ce paramêtre et enfin appuyer sur "echap" pour valider cette modification et sortir du paramétrage.
    Ma question est donc, comment dois envoyer l'information sous labview afin de simuler l'appui sur les touches "a" puis "p" puis "echap".
    Dans un premier temps j'ai pensé a utilisé le code ASCII des touches du clavier, mais cela ne marche toujours pas
    note; le paramêtre associé à la touche "a" est l'offset du capteur.
    Je vous laisse en pièce jointe mon VI.
    Merci de votre aide !
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    port serie ecriture(modif11).vi ‏85 KB

    Je ne peux pas ouvrir ton code, pas ta version de LabVIEW sur mon PC.
    Je te propose quelques pistes :
    > hyperterminal configure le port série (parité, vitesse, ….) tu fais de même, via VISA Open ?
    > il y a peut-être un caractère de fin de commande (CR, LF, …) à ajouter,
    > tu utilises la fonction VISA Write, un des paramètres d’entrée est une chaîne de caractère, ton idée de câbler une constante string « a » ou « p » me semble correcte.
    Je pense donc que ton problème provient de la configuration du port ou d’un caractère de fin de commande ou réception.
    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

  • Issues with processing messages on one receive port causes problems on all the receive ports that are on the same handler

    Greetings,
    An integrator installed biztalk in our environment to process the hl7 message flow between their source application(s) and several receiving applications. We've had problems with this set-up for a while now because some receiving applications sometimes have
    problems processing the messages. Be it either because there's problems with the server that processes the messages of a certain port or because there's problems with the software/daemon/service that needs to process these messages.
    The main problem with this, is that the receiving end of this isn't under our control nor under control of the integrator, but when one receive port isn't processing their messages for a while it causes a problem with all the receive ports that are on the
    same handler. So other receive ports start noticing a slow-down of their incoming messages until after a while nothing gets through anymore.
    What is the best practice to prevent these kind of problems? Should we just create a handler for every receive port? Because that seems a bit overkill.
    Thanks in advance.

    What do you mean exactly with this question?
    "Can you provide some more detail like BizTalk the receiver? "
    The adapters are mainly file and MLLP, the MLLP adapters are already seperated from the file adapters (a handler for MLLP and a handler for file).
    The problem with all the receive ports is that when one receive port isn't processing its messages (usually caused by the software processing the messages) the other receive ports on the same handler receive their messages/files a lot slower. If for any
    reason the problem isn't fixed soon, the other receive ports on the same handler actually stop receiving any messages at all.
    Isolating the receive port that causes the problems like la Cour suggested can work, but next time it might be another port that experiences this issue. So we are looking for a way to make sure the whole message flow isn't hindered by one port (whichever
    port) that can't process its messages. Or rather by one receiving software that can't process its messages.

  • Detection evennement port serie

    Bonjour à tous,
    Je cherche à réaliser une série de test permettant de valider la communication RS avec des instruments.
    La machine état est lancée par un evennement "software" (reception de caractères sur le port COM - valeur numérique).
    Concernant la machine à état lancé par cet evennement, je pensais utiliser une structure producteur / consommateur mais je ne sais pas du tout comment généré le départ des tests.
    J'utilise LV2010...
    Quelqu'un peut-il m'aider?
    Résolu !
    Accéder à la solution.

    Bonjour,
    J'ai bien modifié mon programme en suivant vos conseils, cependant, je rencontre toujours les mêmes problèmes:
    L'exécution du programme se bloque après la fonction Visa Close et la 2ème séquence ne s'exécute pas.
    J'ai placé ma structure event au même niveau que la boucle while principale car autrement, le programme ne pourrait être quitté que s'il y a un événement sur le port série.
    Une autre possibilité serait de placer la structure event dans la boucle while mais le problème est que je ne pourrais déclencher qu'une seule fois l'événement sur le port série.
    J'ai l'impression qu'il y a un conflit entre la fonction événement sur le bouton quitter et la fonction Visa Wait on Event.
    Pièces jointes :
    Top_Main.vi ‏135 KB

  • Comment detecter avec LabView une impulsion sur le port série et traiter l'information?

    Je dois automatiser un banc de test avec LabView 7.0. Pour cela il faut que je récupère une impulsion (1 bit, pas de trame) provenant de la carte à tester. Je dois la récupérer via le port série du PC. Je ne sais comment faire, aidez-moi svp.

    Bonjour,
    Dans LabView, il existe un noeud de propriété visa qui permet de récupérer l'état de certaine line du port serie.
    Pour cela, tu vas dans la palette de fonction Visa>Visa Avancé>Noeud de propriété.
    Une fois le noeud posé sur le diagramme, tu choisis la ligne dont tu veux vérifier l'état.
    Voir lien ci dessous.
    http://digital.ni.com/public.nsf/websearch/022A3C75A1F36DFF86256E6200705996?OpenDocument
    Johan G.
    NIF
    .NIDays2008 {font-family:Arial, Helvetica, sans-serif; font-size:12px; color: #065fa3; font-weight: bold; text-decoration: none; text-align: right;} .NIDays2008 a, a:hover {text-decoration: none;} .NIDays2008 a img {height: 0; width: 0; border-width: 0;} .NIDays2008 a:hover img {position: absolute; height: 90px; width: 728px; margin-left: -728px; margin-top:-12px;}
    >> Avez-vous entendu parler de NI Days ?

  • Err.x c 19a0035 sur HP 7200 series

    err.x c 19a0035 sur HP 7200 series 

    Hello moi13,
    This sounds like an error that this troubleshooting article may help resolve
    An Alphanumeric Code (Example: '0x......' or 'C2......') Displays on the Front Panel When Printing
    If somewhere within the error the words ink system failure also appear you may want to look at this article
    An Alphanumeric Code (Example: '0x...' or 'C2...') or 'Ink System Failure' Error Message Displays on...
    If I have helped you in any way click the Kudos button to say Thanks.
    The community works together, click Accept as Solution on the post that solves your issue for other members of the community to benefit from the solution.
    - Friendship is magical.

  • Error message - The HP Deskjet 1510 Series was not found

    I bought the Deskjet 1514 on 19/07/15 and installed it on my relatively new laptop. It worked ok, then I did the Windows 10 upgrade on 01/08/15. I installed the updated drivers from HP for this device. What ever I do, (have uninstalled software, reinstalled at least 4 times, used the scan doctor, swapped USB cables and ports, cleaned the disk...) I just get the message The HP Deskjet 1510 series was not found, yet when aligning the ink cartridges the scanner will work but I cannot do the test scan in the scan doctor or scan anything using the HP software (which you have to do as there is no proper control panel on the actual device). As bought the device primarily as a scanner, I am not happy and just want the thing to work but haven't a clue how to proceed except to take the thing back to Tesco and get a refund and buy a Canon instead... Please can anyone help as the HP support is useless? The printer part is working fine, which makes it ridiculous.

    Hey , Welcome to the HP Support Forums!
    I understand that your HP Deskjet 1514 All-in-One Printer is not being detected via the USB Cable connection on your Windows 10 computer. I would like to assist you today with resolving this installation and product detection issue. Thank you for including all of the troubleshooting steps that you have attempted prior to reaching out for support. At this time I am going to have you complete some additional troubleshooting steps. We will be repeating the uninstall process for troubleshooting today as it is crucial that we have a nice clean slate to work with. Please complete all of the steps below.   Please disconnect the USB Cable from your printer and computer before proceeding.   Step 1:  Remove Driver:  1. Click on your Start button    2. Type Programs and Features in the 'Ask me Anything' box to the right of the Start button. If you just start typing when the Start screen is open it should automatically start typing in the 'Ask me Anything' section.   3. When Programs and Features opens scroll down the list of populated programs and look for your HP Deskjet. If you see your HP Deskjet listed please click on it and choose Uninstall. Follow the onscreen prompts to complete the uninstall.  4. Next, click on the Start button and type Devices in the 'Ask me Anything' box  5. Click Devices and Printers   6. Under the Devices and Printers window look for your HP Deskjet.  If the HP Deskjet is listed, please right click on it and select 'Remvoe Device' or 'Delete' 7. Next, under the Printers section in the Devices and Printers window, click on any printer that shows once just to highlight it. Click on Print Server Properties at the top of the window.  8. Under Print Server Properties, click on the Drivers tab. 9. If you see your HP Deskjet listed under Drivers, click on it and choose Remove at the bottom. 10. Click Remove Driver Only 11. Select OK 12. Select Apply and OK under the Print Server Properties window 13. Close Devices and Printers. Please proceed to the next step.    Step 2: Clear Temp Files:  1. Click on your Start button   2. Type Run. Click Run to launch the Run dialogue box.   3. In the Run box type %temp% and click OK      4. When the Temp folder opens, select Ctrl + A at the same time on your keyboard. Everything in this folder will now highlight. 5. Select the 'delete' button on your keyboard. The Temp folder contains temporary internet files. No actual files or folders on your computer will be affected by deleting the Temp files. Should a Temp file still be used than you will automatically get the pop up to 'skip' that item. 6. Close the Temp folder once it is emptied 7. Right click the Recycling Bin on your desktop and select Empty Recycling Bin. Please proceed to the last step.    Step 3: Install Device: Please click here to download and run the HP Printer Install WizardOnce the download has completed please follow the steps under the PIW to install your devicePlug in the USB Cable only when prompted by the installerOnce the installation has completed successfully please test printing and scanning to confirm that your product is functioning as per normal. Please respond to this post with the result of your troubleshooting. Good luck!

  • Send Display Message to SPA5xx or SPA3xx Series phones from SIP Server

    I have the program samples to update a CISCO SPA5xx phone via HTTP URI.  Unfortunately that URI is not accessible via NAT.
    I would like to be able to update the display from the Dial Plan (ie as the call routing progresses).  We use FreeSwitch, but really this is just a generic SIP question.  Is there a SIP INFO method or SIP HEADER or other way for the server to signal a display message update to the SPA5xx series of phones via SIP?
    FreeSwitch has a send_display function.  However it has only been coded for SNOM and POLYCOM support.  We can't have that!
    Thanks in advance,
    Sean

    Admin Guide contain the information that text messages have format described in RFC3428 (it mention not only how to disable/enable the feature) and I didn't said just RTFM but copied relevant part of such documentation to my response. But I'm not willing to waste our time with the discussion about "has been RTFM, or not has been RTFM".
    Now I understand you are not interested in format of SIP packets, you are interested rather in code sample that can send such kind of messages.
    The Asterisk can send such messages understood by Cisco Phone. You can call sendtext() application from dial plan. For the source code of it see file chan_sip.c, function declared as static int sip_sendtext(struct ast_channel *ast, const char *text)
    It may help to you.

Maybe you are looking for

  • After "Archive and Install", my printer no longer works

    Powerbook 1.67 GHz PowerPC G4 Mac OS X Version 10.4.11 I recently had some issue with my password, so the Apple Genius people ran an archive and install, reset the user password, and got me back to my original state. However, I've had to run all thes

  • Laserjet pro 400 m401dw slow printing problem

    When my printer gets a job, of say 125 pages, it prints very sporadically. It will print a page and then pause for 10 - 20 seconds before printing another page. It continues this way for the entire document, often taking an hour or more to print the

  • Error when launching Netweaver Developer Studio

    Hi.   can someone help me. I installed Netweaver Developer studio but when I try to launch it. I get this error:   "Problem during startup. Check the .log file in the ".metadata" directory of your workspace" !SESSION Aug 30, 2005 14:50:39.954 - java.

  • Cursor/Window for Zooming in Intensity Graph

    Does anybody know how to create a non-rectangular window (any shape connected by mouse clicks) for zooming (or for data retrieval) if a particular area in the graph is of interest in a intensity graph? Wouldn't it be really cool if we can select edge

  • How to manage source for java project using eclips?

    Hi,We use TFS 2013 and VS 2013 for source control ,now we want to start mobile app using eclips, How to control source of that project,How we can have features of tfs source control on that type of project such a mobile that use eclips. thanks Thanks