Port Visual Basic to Visual Prolog

From: Blackbird (no_at_mail.com)
Date: 06/26/04


Date: Sat, 26 Jun 2004 22:11:22 +0200

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



Relevant Pages

  • Where are the real gurus?
    ... Prolog 6.1 It opens the serial port for communications, ... command, switches to a specific speed, sends another command, then switches ... This is so totally beyond my Visual Prolog skills that I have no clue how to ...
    (comp.lang.prolog)
  • Re: Where are the real gurus?
    ... >command, switches to a specific speed, sends another command, then switches ... >This is so totally beyond my Visual Prolog skills that I have no clue how to ...
    (comp.lang.prolog)
  • Re: Newbie problem
    ... Later I decided to develop an GUI ... I mean, if I use it on the prolog console it works, ... how command (and obviosuly it doesn't give the variable Objective the ...
    (comp.lang.prolog)
  • Re: Where are the real gurus?
    ... Blackbird wrote: ... > Prolog 6.1 It opens the serial port for communications, ... > This is so totally beyond my Visual Prolog skills that I have no clue how to ... > Private Sub Command1_Click ...
    (comp.lang.prolog)
  • Re: Where are the real gurus?
    ... Blackbird escreveu: ... > Prolog 6.1 It opens the serial port for communications, ... > command, switches to a specific speed, sends another command, then switches ... > This is so totally beyond my Visual Prolog skills that I have no clue how to ...
    (comp.lang.prolog)