Information générale
Catégorie:
Codage, syntaxe et commandes
>Hi Paul,
>
>Use the MSComm ActiveX control. Specify the COM port and its settings. Send the command "ATZ" + chr(13). You should wait up to 2 seconds for a response (which should be "OK")
>
>You can use this control to poll a number of COM ports to find out which, if any, have a modem attached (and switched on).
>
>HTH
>
>Liam
>
>
>
>
>>Hi,
>>
>>Has anyone got any idea how I can test if a modem is plugged into a COM port and is turned on?
>>
>>Regards
>>
>>Paul Robinshaw
I don't understand how to detect the "OK" returning from the modem. I have a USB modem and issue the following code through the MSCOMM32 control:
thisform.olecontrol1.commport = 5
thisform.olecontrol1.portopen = .t.
thisform.olecontrol1.output = "ATZ"+CHR(13)
x = thisform.olecontrol1.input
thisform.olecontrol1.portopen = .f.
=messageb(x)
Is "input" the correct way to grab this response value? How would I "wait 2 seconds"?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement