Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting/Interfacing with machines/equipment
Message
De
19/08/2015 13:39:19
 
 
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:
01623598
Vues:
35
>>>>>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 :)).

A typical production department will be very reluctant to allow a direct connection to critical production equipment. Even if it's possible to make a direct connection and you only want to record/monitor current information, what will be in the production manager's mind:

- the machine controller software is designed to do the job reliably, not offer fine-grained access control. There may be no security at all, so if you connect you have full privileges. If your software makes a mistake it could affect production

- in that circumstance can your software be guaranteed to not affect production reliability or worker safety?

- even if your software has no errors, what happens if the computer it's running on crashes or hangs, or the computer or comms cable suffers an electrical spike or other damage in an industrial environment?

With that in mind, your "[an]other approach" is almost certainly the way to go, assuming all you really want to do is log information. Many machine controllers recognize the need to log production data and offer some way to output it in some sort of standard format. VFP could be a pretty good choice to consolidate and analyze those logs.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform