Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Guide me in mscomm32
Message
From
23/03/2004 06:56:59
 
 
To
23/03/2004 01:14:56
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00888289
Message ID:
00888792
Views:
12
Hi Reza,

Not much info on the net, but give this a try:

Assuming scale commands and data use the same comm port:

Create a form. Add a property "scaledata"
Drop an instance of the mscomm32.ocx on the form, name it "scalecomm"
Set the "Settings" property to "2400,7,E,1", and the "Commport" property to "2".
Drop a command button and timer on the form.
In the command button "Click" method add:
THISFORM.Timer1.Enabled = .T.
THISFORM.scalecomm.output = "The_command_to_interrogate_the_scale"
substituting the proper command for the scale, of course.

In the timer's "Timer" method add:
THIS.ENABLED = .F.
THISFORM.scaledata = THISFORM.scaledata + THISFORM.scalecomm.input
In the form's Init add:
THIS.scalecomm.portopen = .T.
THIS.scaledata = ""
In the form's Destroy add:
THIS.scalecomm.portopen = .F.
You may need to adjust a few other things depending on the scale's requirements. The scale data should accumulate in the form's scaledata property for your use. If it takes more than 1 second for the scale to respond, increase the timer's "Interval". You could add an editbox and bind it to the scaledata for display while testing. Let me know if this gets you started.

>Dear Jim
>Thanks for your reply.
>Here is some information about our instruments :
>
>Leon Engineering weighindicator, model LD5218
>
>it show weight and stop . i want to get this when i press a command botton .
>i see this setting : com2 2400,7,E,1
>
>thank you very much for your attention.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform