mscomm32.ocx
Hi all,
my goal is to send (commands) and receive (data) to/from scales (4) through
a serial port. I'm using de mscomm control and so far what I could get is
to send commands, but still I cant get any data from the scales. I don't
know what I'm doing wrong:
*init event
this.settings="4800,N,8,1"
this.commport=1
this.inputlen=0
this.rthreshold=1
this.handshaking=2
this.sthreshold=1
this.portopen=.t.
this.output=">01qD2"+chr(13) && the scale reads succesfully this command
*oncomm event
if this.commevent=2 && never fired
wait wind this.input && just to see what's in the buffer
endif
Can anybody tell me what am i doing wrong?
thanks alot!
Guillermo
[755 byte] By [
Guillermo] at [2007-11-10 12:50:16]

# 1 Re: mscomm32.ocx
Hi Guillermo,
Take a look at _VFP.AutoYield in the VFP help. See if changing the setting
corrects any problems.
HTH.
--
Larry Miller
MCSD, Microsoft MVP Visual FoxPro
Bifrost Solutions
"Guillermo" <griso_62@hotmail.com> wrote in message
news:3f15d481$1@tnews.web.dev-archive.com...
>
> Hi all,
> my goal is to send (commands) and receive (data) to/from scales (4)
through
> a serial port. I'm using de mscomm control and so far what I could get is
> to send commands, but still I cant get any data from the scales. I don't
> know what I'm doing wrong:
> *init event
> this.settings="4800,N,8,1"
> this.commport=1
> this.inputlen=0
> this.rthreshold=1
> this.handshaking=2
> this.sthreshold=1
> this.portopen=.t.
> this.output=">01qD2"+chr(13) && the scale reads succesfully this command
> *oncomm event
> if this.commevent=2 && never fired
> wait wind this.input && just to see what's in the buffer
> endif
> Can anybody tell me what am i doing wrong?
> thanks alot!
> Guillermo
>
# 2 Re: mscomm32.ocx
Hi Larry,
I was looking at this property, but I couldn't find where is at, now You
gave me a clue _VFP.AutoYield, so I'll try again. It's pretty weird, I can
send a command to the scale but can't receive any data...
thanks alot...
Guillermo
"Larry Miller" <LMiller3@bellatlantic.net> wrote:
>Hi Guillermo,
>Take a look at _VFP.AutoYield in the VFP help. See if changing the setting
>corrects any problems.
>
>HTH.
>
>--
>Larry Miller
>MCSD, Microsoft MVP Visual FoxPro
>Bifrost Solutions
>
>"Guillermo" <griso_62@hotmail.com> wrote in message
>news:3f15d481$1@tnews.web.dev-archive.com...
>>
>> Hi all,
>> my goal is to send (commands) and receive (data) to/from scales (4)
>through
>> a serial port. I'm using de mscomm control and so far what I could get
is
>> to send commands, but still I cant get any data from the scales. I don't
>> know what I'm doing wrong:
>> *init event
>> this.settings="4800,N,8,1"
>> this.commport=1
>> this.inputlen=0
>> this.rthreshold=1
>> this.handshaking=2
>> this.sthreshold=1
>> this.portopen=.t.
>> this.output=">01qD2"+chr(13) && the scale reads succesfully this command
>> *oncomm event
>> if this.commevent=2 && never fired
>> wait wind this.input && just to see what's in the buffer
>> endif
>> Can anybody tell me what am i doing wrong?
>> thanks alot!
>> Guillermo
>>
>
>
# 3 Re: mscomm32.ocx
"Guillermo" <griso_62@hotmail.com> wrote:
>I was looking at this property, but I couldn't find where is at, now You
>gave me a clue _VFP.AutoYield, so I'll try again. It's pretty weird, I can
>send a command to the scale but can't receive any data...
That property is set at the form level that contains the control.
Set it to False at that form and set it back as you wish.
_VFP.AutoYield = .F.