Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RS232 communication & cursor control DLL's ?

15 views
Skip to first unread message

Erik

unread,
Jun 6, 2004, 3:11:39 PM6/6/04
to
Hi,
I'm looking for Fortran code that allows me to communicate with the RS232
port.
Also, I'm looking for advice on how to control the position of the
mouse-cursor, based on input from the RS232 port.
All of this preferably in combination with Powerpoint.

I'm more or less a novice as far as computers are concerned - got some
experience in writing Fortran code and compiling it as a DLL. I'm kinda
hoping the things mentioned above can be done by calling a (known or
to-be-written) DLL

thanks a lot
Erik


William Asher

unread,
Jun 6, 2004, 5:57:11 PM6/6/04
to
Erik wrote:

Erik:

Is there a particular reason you want to do this in fortran and not use
VBA? There are lots of serial communication packages for VBA out there.
I like fortran, but doing a serial communications application in
powerpoint using fortran seems like a difficult way to go about things.
Sort of like going into a machine shop and making a special tool to
loosen a hex-head bolt.

--
Bill Asher

see.si...@hicest.com

unread,
Jun 7, 2004, 8:48:27 AM6/7/04
to
Eric,

Try HicEst (http://www.HicEst.com), a Fortran based interpreter.

The following example is a complete script that
1. gets data via COMport 1
2. interprets the data
3. calls your DLL (if you still need it)
4. plots the data
5. files the data
6. gets the coordinates of a mouse click in the xy graph
7. starts Powerpoint with your data

HicEst is free for short scripts like this, there will be occasional
reminders to register while running longer scripts.

Have fun,
Georg Petrich (mail to: firs...@HicEst.com)

CHARACTER received*1000/'data like 1,1.123,-4.9,4.5 binary or ASCII'/
CHARACTER SomeFileName='SendToPPT.txt'
REAL :: xyz(1000)

WINDOW(WIN=echoHandle, Title='Receive serial port echos', y=1)
WINDOW(WIN=graph, Title='to plot the xyz received', x=1, y=1)
! plot mouse sensitive xy graph with a minutes:seconds x-axis:
AXIS(WIN=graph, Scroll=1, T='mm:SS', MSC=Callback, MouseX=X, MousY=Y)
OPEN(File=SomeFileName)

! port=1, 9600 Baud, odd parity, 8 DataBits, 1 StopBit, echo ON:
COM(Comport=1, Bds=9600, Pty='Odd', Dbits=8, Sbits=1)

DO try = 1, 1E300 ! almost "forever"
! send '?', wait 500 msec for '!', 8Bit checksum, get string,
! evaluate the checksum, send 'OK'
! if any error occurs, execution restarts with item 1:
COM(OnErr=1, Echo=echoHandle, Send='?', Tim=500, Wait='!',
CheckBits=8, Receive=received, ChkSum, Send='OK')

! no error occured, evaluate received string:
READ(Text=received, Items=n) xyz ! list directed, n items received
IF( n > 0 ) THEN
! do whatever you like, e.g. call your DLL or write to file:
result = DLL(Name="yourDLL.dll", Fnc="anything", Arg=n, A=xyz)
TIME(TO, Excel=day) ! MS formatted day with time as fraction
LINE(x=MOD(day,1), y=ReceivedData) ! n data points vs time
ALIAS(xyz,1, ReceivedData,n) ! "dynamic equivalence"
WRITE(File=SomeFileName) n, ReceivedData
ENDIF
SYSTEM(Wait=300) ! 300 msec, give it a little time
ENDDO

END

SUBROUTINE Callback() ! called when xy graph area is clicked
! without USE or dummy parameters: all names global

AXIS(WIN=graph, Scroll=1, Time='mm:SS', MSC=Callback, MSX=X,MSY=Y)
rc = DLG(Txt=X, T=Y, Button='&OK', Btn='2:&PowerPoint') ! dialog
WRITE(File=SomeFileName, Flush=1) ! flush data to disk, dont close
! call Powerpoint:
IF(rc == 2 ) SYSTEM(Shell='POWERPNT.EXE', CMD=SomeFileName)
END


William Asher <gcn...@yahoo.com> wrote in message news:<Xns95009807D...@140.142.17.40>...

0 new messages