Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connecting/Interfacing with machines/equipment
Message
From
19/08/2015 12:48:46
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01623582
Message ID:
01623592
Views:
78
>Hi,
>
>What are the "standard" or good practice methods of interfacing VFP application with machines or equipment. For example, say a customer has a process equipment. And the VFP application needs to get the temperature, or pressure, or number of hours the equipment has been running. Any specific features the software operating the equipment should have?
>
>TIA.

It's a while since I've had to do that type of thing but, in general, most devices you might want to 'talk' to send data via a comm interface (hopefully in some easily parsed ascii format). They usually fall into two categories:
(a) Those that send a steady stream of data (similar, for example, to NMEA data on a GPS device)
(b) Those that can be queried for specific data.

In either case you can use the MSCOMM OLE control to listen to the COM port.
For (a) you'll need to continuously monitor the stream and pluck out the data that you are interested in.
For (b) you'll need a two-way connection so that you can ask for the info. that is required.

It's much easier to do this type of thing using the .NET 'System.IO.Ports.SerialPort' class rather than MSCOMM - if it's an available option you might consider creating a C# wrapper to deal with it.

IAC, if you know the hardware you're dealing with the first step is to read the relevant documentation.

HTH....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform