Using Visual Basic sample code, the following application demonstrates the use of the RFAuxPort object and its methods. Both applications will configure a RF device’s serial port with generic UART settings then send the string AS1T to the device connected to the serial port. The application will then wait ten seconds for a carriage return, then return any response.
' VB Sample Code
' RFAuxPort Object Demo Application
'
dim wlaux as new RFAUXPORT
dim sAns as String
dim nPort as Integer
nPort = 0 ' COM1
Dim nError As Integer
' You MUST set up the port before first use
if wlaux.ConfigurePort
(nPort,BAUD19200,DATABITS7,STOPBITS1, _
PARITYEVEN,HARDWAREFLOWCTL) = False Then
' Error Can't set port
end if
.
.
.
sAns=wlaux.QueryPort(nPort,0,13,-1,10,"AS1T")
nError = wlaux.RFGetLastError
If nError <> WLNOERROR Then
GoTo ExitApp
Else
' process sAns
Was this article useful?
The topic was:
Inaccurate
Incomplete
Not what I expected
Other