IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB 6 et antérieur Discussion :

comment utiliser le port com a mes application?


Sujet :

VB 6 et antérieur

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau membre du Club
    Inscrit en
    Juillet 2006
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Juillet 2006
    Messages : 5
    Par défaut comment utiliser le port com a mes application?
    la paix a tout
    je veut fair une application d'un compteur des feuilles imprimees par un recepteur infra rouge et je veut utiliser le port com pour entrer les donnes de compteur a mon PC.
    avec chaque signal compte une feuille
    comment je peut fair?????

  2. #2
    Expert confirmé
    Avatar de Mat.M
    Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2006
    Messages
    8 532
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2006
    Messages : 8 532
    Par défaut
    ?
    Y'a un OCX mscomm il me semble.
    Dans menu>projet>composants fouiller et trouver le bon controle.
    ( mscomm32.ocx)

    Sinon en dynamique avec un dim et set new cela doit fonctionner
    Voir le MSDN pour l'utiliser

  3. #3
    Expert confirmé
    Avatar de Mat.M
    Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2006
    Messages
    8 532
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2006
    Messages : 8 532
    Par défaut
    MSComm Control


    The MSComm control provides serial communications for your application by allowing the transmission and reception of data through a serial port.

    Syntax

    MSComm

    Remarks

    The MSComm control provides the following two ways for handling communications:

    Event-driven communications is a very powerful method for handling serial port interactions. In many situations you want to be notified the moment an event takes place, such as when a character arrives or a change occurs in the Carrier Detect (CD) or Request To Send (RTS) lines. In such cases, use the MSComm control's OnComm event to trap and handle these communications events. The OnComm event also detects and handles communications errors. For a list of all possible events and communications errors, see the CommEvent property.


    You can also poll for events and errors by checking the value of the CommEvent property after each critical function of your program. This may be preferable if your application is small and self-contained. For example, if you are writing a simple phone dialer, it may not make sense to generate an event after receiving every character, because the only characters you plan to receive are the OK response from the modem.
    Each MSComm control you use corresponds to one serial port. If you need to access more than one serial port in your application, you must use more than one MSComm control. The port address and interrupt address can be changed from the Windows Control Panel.

    Although the MSComm control has many important properties, there are a few that you should be familiar with first.

    Properties Description
    CommPort Sets and returns the communications port number.
    Settings Sets and returns the baud rate, parity, data bits, and stop bits as a string.
    PortOpen Sets and returns the state of a communications port. Also opens and closes a port.
    Input Returns and removes characters from the receive buffer.
    Output Writes a string of characters to the transmit buffer.

  4. #4
    Membre émérite Avatar de avigeilpro
    Homme Profil pro
    Ambulancier
    Inscrit en
    Janvier 2004
    Messages
    880
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Creuse (Limousin)

    Informations professionnelles :
    Activité : Ambulancier
    Secteur : Transports

    Informations forums :
    Inscription : Janvier 2004
    Messages : 880
    Par défaut
    Bien sûr il te faut aussi connaître le protocole de communication avec le périphérique qui se trouve sur le com
    La connaissance seule ne suffit pas. La vraie compréhension vient de la mise en expérience.
    Règles|FAQ|Tuto

Discussions similaires

  1. Comment utiliser le port série avec WxWidget
    Par LOMA.fr dans le forum wxWidgets
    Réponses: 1
    Dernier message: 28/10/2007, 16h45
  2. Réponses: 3
    Dernier message: 18/09/2007, 14h54
  3. Réponses: 6
    Dernier message: 04/10/2006, 18h40
  4. [COM] Comment utiliser l'objet COM ?
    Par splinternabs dans le forum Bibliothèques et frameworks
    Réponses: 9
    Dernier message: 14/04/2006, 11h58
  5. Utilisation du port COM
    Par chourmo dans le forum Composants VCL
    Réponses: 10
    Dernier message: 13/06/2005, 11h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo