Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with multiple com ports
Message
From
23/03/2006 13:35:27
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
23/03/2006 13:25:38
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01107002
Message ID:
01107088
Views:
20
Mark,

What I would do is create a launcher program that starts the com server that monitors each serial port. Then you can instantiate each com server and then set the com port to monitor. You will have to create a collection class to do this or you could do the same thing with an array. The key is to store an object for each comm port.
for lnx = 1 to 6
  this.oCommCollection.add(createobject("mycom.server")
  this.ocommCollection.setComport(lnx)   
next 
>>Fox is single threaded so you may have problems depending on your situation. MSComm will store data in its buffers so you could do some type of polling to handle each comm port separate. Or, you could create a com server and have one com server for each part. That would mean having 6 instances of VFP running at the same time.
>>
>>>I am working on a solution to accept data from multipe comm ports.I have an executable that has one form. A client program starts that remote server and adds containers, one for every port. I am 'listening' to a port using MScomm activex control. I can I have up to 6 ports/containers running in the same time. I have scanners attached to these com ports. It is very possible that all 6 scanners scan in the same time. Each container uses same form's code to process the scan. That means that potentially multiple containers will call same form's method in the same time. Do I have a problem here? How Fox handles such situation?
>>>
>>>Thanks for any idea.
>Yeah, I thought about it too. I will have to have as many projects as many ports I have. Recompile each project every time I change code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform