Home > Archive > Prolog > July 2004 > Where are the real gurus?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Where are the real gurus?
|
|
| Blackbird 2004-07-02, 3:58 pm |
| 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 (the free version).
Any help is appreciated!!
Blackbird
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
| |
| student 2004-07-03, 4:08 am |
| Blackbird wrote:
> 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 (the free version).
>
> Any help is appreciated!!
>
> Blackbird
>
>
>
> 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
>
>
http://discuss.visual-prolog.com/ubb/faq.html
| |
| Andrzej Lewandowski 2004-07-03, 8:56 am |
| On Fri, 2 Jul 2004 21:33:09 +0200, "Blackbird" <no@mail.com> wrote:
>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 (the free version).
"real gurus" don't use Visual Prolog. They rather use Prolog.
A.L.
| |
| Andrzej Lewandowski 2004-07-03, 8:56 am |
| On Sat, 03 Jul 2004 03:47:09 GMT, student <not@a.b.c.dINVALID>
wrote:
>
>http://discuss.visual-prolog.com/ubb/faq.html
Somwehere in some FAQ it is stated that if you write single line
response, you don't quote 3 pages of the question.
A.L.
| |
| Blackbird 2004-07-03, 3:57 pm |
|
"Andrzej Lewandowski" <alewando_tego_nie@oddpost_tego_tez_nie.com> schreef
> "real gurus" don't use Visual Prolog. They rather use Prolog.
>
> A.L.
I'm flexible, I'll settle for a 'regular' Prolog solution !
Blackbird
| |
| Paul Tarau 2004-07-03, 8:56 pm |
| "Blackbird" <no@mail.com> wrote in message news:<cc6eht$hlp$1@news3.tilbu1.nb.home.nl>...
> "Andrzej Lewandowski" <alewando_tego_nie@oddpost_tego_tez_nie.com> schreef
>
>
> I'm flexible, I'll settle for a 'regular' Prolog solution !
>
> Blackbird
Well, real gurus never convert programs, they just let their programs
talk to each other :-) Here is a quick solution:
- get Jinni 2004 .NET edition from http://www.binnetcorp.com/Jinni
- make sure your Visual Basic program works :-)
- call it from Jinni using Jinni's Reflection based interface
(adapt the code fragment in directory "csharp" for a call to C# -
VB should be quite similar)
Paul Tarau
| |
| Blackbird 2004-07-03, 8:56 pm |
|
"Paul Tarau" <ptarau@yahoo.com> schreef
> Well, real gurus never convert programs, they just let their programs
> talk to each other :-) Here is a quick solution:
Yeah, they just might :))
> - get Jinni 2004 .NET edition from http://www.binnetcorp.com/Jinni
At 295 $US that's a rather expensive solution just to read some data from
the com port. So perhaps conversion is not the guru but still the cheapest
solution!
Blackbird
| |
| Cesar Rabak 2004-07-04, 8:57 pm |
| Blackbird escreveu:
> 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 (the free version).
>
> Any help is appreciated!!
>
> Blackbird
>
>
>
[snipped]
Isn't the answer from Yuri Ilyin to the poster Bert van Dam in June 30
in the Visual Prolog Forum helpful for you?
--
Cesar Rabak
| |
| Blackbird 2004-07-05, 3:57 am |
|
"Cesar Rabak" <crabak@acm.org> schreef
> Isn't the answer from Yuri Ilyin to the poster Bert van Dam in June 30
> in the Visual Prolog Forum helpful for you?
>
> --
> Cesar Rabak
No, buying the commercial version or rewriting mscomm is not a solution, at
least not for me. Getting another free Prolog version would be a possible
solution, if what I want is possible with that version. Or linking VP to a
VB .dll or....
Blackbird
|
|
|
|
|