Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting/Interfacing with machines/equipment
Message
 
 
À
19/08/2015 12:57:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01623582
Message ID:
01623596
Vues:
37
>>>>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....
>>
>>First, thank you for the message. Since I am just exploring this approach, doing it in C# sounds more reasonable for me than in VFP (will help me to learn C# better). I have no idea what hardware I will have to deal with (this is a potential customer). But if I were to create this interface in C#/VS, would you suggest doing it with Win Forms or another type of application?
>
>Probably best as a class in its own project - that way you could plug it in to whatever (WinForms, WPF, Console, etc - or even VFP)

Thank you. Another approach (as far as I know) if for the "other" software do drop a text or an xml file into a set folder with values. And my VFP or WinForms program to periodically check this folder and get the data from it. But I will see what the prospective customer wants to do (if anything :)).
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform