Port Visual Basic to Visual Prolog

Port Visual Basic to Visual Prolog

Post by Blackbir » Mon, 28 Jun 2004 05:11:22


I'm trying to port the following Visual Basic program fragment to Visual
Prolog 6.1 It opens the serial port for communications, sends a break
command, switches to a specific speed, sends another command, then switches
speed again, and starts listening. Any signal coming in is detected with the
OnCom and displayed on the screen.

This is so totally beyond my Visual Prolog skills that I have no clue how to
even start porting it to Visual Prolog 6.1

Any help is appreciated!!

Merel


Private Sub Command1_Click()

'enable communications
MSComm1.PortOpen = True

'Set the Break condition for 0.1 second
MSComm1.Break = True
Duration! = Timer + 0.05
Do Until Timer > Duration!
Dummy = DoEvents()
Loop
MSComm1.Break = False


'switch to programmer speed
MSComm1.Settings = "19200,n,8,1"
'send pass through command
MSComm1.Output = "0000p"
'wait
Duration! = Timer + 0.2
Do Until Timer > Duration!
Dummy = DoEvents()
Loop


'switch to microcontroller speed
MSComm1.Settings = "1200,n,8,1"

End If

End Sub


Private Sub MSComm1_OnComm()

'get the sensor data from the com1 port and
'display on the screen.

ReadingPin = MSComm1.Input
If ReadingPin <> "" Then
ReadingData = MSComm1.Input
End If

End Sub
 
 
 

Port Visual Basic to Visual Prolog

Post by Blackbir » Tue, 29 Jun 2004 06:51:02


"Blackbird" < XXXX@XXXXX.COM > schreef

I forgot to mention I'm using the free version (the personal edition).

Merel