Hi Gary,

I believe you need to read the Input value.  Here's some code I have for 
reading data from a scale/balance:

TRY
    WITH THIS.oleComm
        * for some reason I seem to need to run this twice to get the value
        FOR lnCount = 1 TO Balance.NumTimes &&Balance is a DBF with the 
various settings in for the Balance
            .OUTPUT = Balance.OUTPUT    &&"P" + CHR(13) + CHR(10)
            DOEVENTS

            lnStart = SECONDS()

            WAIT WINDOW NOWAIT "Reading weight from scale..."
            DO WHILE SECONDS() - lnStart <= Balance.WaitInt
                DOEVENTS
            ENDDO

            lnBufferCount = .inBufferCount
            lcString = .INPUT
            IF lnBufferCount > 0 AND FILE("debug.txt")
                WAIT WINDOW "Weight from scale..."+'[' + lcString +']'
            ENDIF

            WAIT CLEAR
        ENDFOR
    ENDWITH
CATCH

ENDTRY


Gary Jeurink wrote:
> I am handicapped and I am using my foxpro database to control my house by
> sending commands to a stargate house controller via the com port. Its
> working very good but I want to go a step further and get data back from the
> port. Below are examples of sending simple command lines.
>  
> IF mediaindex.fan  
>   *turn fan off
>   Thisform.Olecontrol1.output = "##%2b02060a010000" + Chr(13)
>   REPLACE mediaindex.fan WITH .F.
> ELSE
>   * turn fan on
>   Thisform.Olecontrol1.output = "##%2b02060a020000" + Chr(13)
>   REPLACE mediaindex.fan WITH .T.
> ENDIF
> THISFORM.REFRESH
>  
> I can have stored phone messages with...
>  
> *play all new messages
> Thisform.Olecontrol1.output = "##%9408000001" + Chr(13) 
>
> How do I recieve the returned message on the COM port? I have a reference
> manual to know what to expect and how to interpret it but I need to capture
> the message.
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>   text/plain (text body -- kept)
>   text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to