Bonjour
Je souhaite faire l'acquisition de la température d'une étuve par RS232. Il existe un logiciel proposé par le fabricant mais il me parait cher env 200€... et je voudrais essayer de communiquer sans ce logiciel.
J'ai demandé les parametres de communication, les voila:
baudrate : 9600
data bits : 18N1
Parity : Half Duplex
Pinning : terminal connections RS232
Pin 2 Red wire = RX from controller terminal 10
Pin 3 Green wire = TX from controller terminal 9
Pin 5 black wire = Gnd from controller terminal 11

Débutant en VBA j'ai trouvé un code qui je crois peut faire l'affaire:
http://www.pencomdesign.com/support/...re_example.htm

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Private Sub CommandButton1_Click()
    On Error Resume Next    'Error handler
 
    If MSComm1.PortOpen = False Then  'check if the serial port is open
        MSComm1.PortOpen = True       'check if the serial port is open
    End If
    If Err Then MsgBox Error$, 48     'Display error in message box
 
    'Set all outputs to High (serial relay card commands)
    MSComm1.Output = "A" + "H" + "0" + Chr$(13)
 
End Sub
 
Private Sub CommandButton2_Click()
    On Error Resume Next    'Error handler
 
    If MSComm1.PortOpen = False Then  'if the serial port is closed
        MSComm1.PortOpen = True       'open the serial port
    End If
    If Err Then MsgBox Error$, 48     'Display error in message box
 
    'Set all relays outputs to low (serial relay card commands)
    MSComm1.Output = "A" + "L" + "0" + Chr$(13)
 
 
End Sub
 
Private Sub UserForm_Terminate()
    On Error Resume Next    'Error handler
 
    If MSComm1.PortOpen = True Then    'check if the serial port is open
        MSComm1.PortOpen = False       'close the serial port
    End If
    If Err Then MsgBox Error$, 48     'Display error in message box
 
End Sub
En ayant au préalable définis les propriétés de MSComm suivant l'exemple



Il me faudrait donc juste modifier la ligne Settings en 9600,n,18,1
Mais je ne vois pas ou mettre dans les propriétés qu'il faut utiliser "Parity : Half Duplex".
est ce important? Si oui quelle ligne dois je modifier?
Merci d'avance