Is OPC UA the best way of change data from many individual systems from several domains? - interop

When I need interoperate several systems, exists different middleware as possibility to support this process. However, in OPC-UA is not clear for me if is necessary apply some one between these systems. Someone can support me, how is made this process in OPC-UA, please.
For example:
Systems A with language C and operational system (OS) windows, TCP-IP, Systems B with language java, OS Linux, UDP, and
System C with language python, OS IOS, TCP-IP
How OPC-UA interoperate these systems, using middleware or they can be connected directly using implementation in interface with OPC.
Thanks

Related

What platforms do Google Protocol Buffers support?

Google state that:
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data
I searched for an explicit list of platforms and/or operating systems officially supported by Protocol Buffers but I couldn't find it. Ironically the closest thing I found was the following information in the Wikipedia page:
Operating system: Any
Platforms: Cross-platform
Is it safe to say that Protocol Buffers support any platform/OS?
Operating system is going to be any mainstream OS. If you're running something esoteric, you might get the same problems that you get with anything else.
Platform is similar; google offer support for a range of platforms, and a much wider list is provided by community owned projects. A list is here: https://github.com/google/protobuf/blob/master/docs/third_party.md
Ultimately, the wire specification is documented and doesn't depend on OS or platform, so worst case if you're using a custom language on a custom OS, then you could still implement your own decoder as long as that language has some mechanism to talk arbitrary binary data or can interop to one of the other prebuilt libraries.

Why is it that we can't write a program that will run on both mac and pc?

Programming languages are platform independent, so why is it that we can't write a program that will run on both a PC and a Mac?
I want to develop a software and I'm on a mac, but I want it to run on a PC also, is it possible to develop such a software without having to require the user to download a special program that will make my program compatible with their computer?
The problem with this is that most software is dependent on the OS to handle some tasks. Yes, most programming languages are compatible with many platforms, but the OS provides a lot of support. When software uses the OS, it is sometimes called making a system call. If you want here is some more information.
Theoretically if you write your program in a 'high level language' it should be portable between two operating systems.
Practically however, the differences start from the very beginning - the API of choice, which works on one and does not on another(Such as, Mac's BSD API is incompatible with Win32 API) and boils down to the very last, which is, executable format, linker and loader. Each operating system has its own quirks.
Then comes the difference between the underlying architecture. Previously Macs ran on PowerPC architecture and Motorola architectures, while PCs used Intel. Since Macs have switched to Intel, there have been attempts at making cross platform executables inside Apple. Most attempts have failed.
There is however a way around your problem. You can use a very high level language such as Python to code and then distribute your python code to your PC friends.(But remember remember, you need a Python interpreter in your PC friends' computers for your program to run). I have successfully ported Python programs from Mac to PC with 0 code changes, and sometimes requiring only 2-4% code changes.
Simple answer: because language per se is not enough to make an application cross-platform. Also the framework it uses must be cross-platform too, frameworks are required for everything: handling data, displaying things, communicate with the hardware, multi threading, etc
This can usually be done:
by choosing a complete solution like Java, which will actually run on both platforms seamlessly and even with the same binary
by using C/C++ and cross platform libraries so that the same program can be compiled for both platforms (keep in mind that you can't distribute the real same binary, you need to compile two in any case)
by writing the logic of your program just using standard libraries and a standard language and then attach whatever you need for a specific platform just to build two different libraries. Of course you will have to wrap as much as you need so that the cross-platform part of your program doesn't know it
Mind that developing cross-platform applications which are not trivial examples like a game (for which there are plenty of cross-platform APIs) without using a complete solution like Java is not an easy task at all. Especially because most of the GUI you can build are strictly platform specific and relies on their own frameworks.
If you want an application to run "anywhere" your best option is a JIT type language which means that it compiles as it runs (Just In Time) for the platform that it's on. Really the language that stands out in my mind is Java (there's others and personally I don't like java). However, it's not quite that simple. For example a Window on a Mac computer has pieces and functions that a Window on a PC doesn't have and vice versa. And other operating systems don't even have windows or anything equivilant yet still run Java like Android or iOS for example or countless Linux Distros. And that's just a very basic example it gets MUCH MUCH harrier. Really the best way to build an application that can be used by anyone on just about any device is going web based.
The lesson is that if it was that simple a lot of people wouldn't have jobs and it never will be that simple, things will always progress and change and not everyone is going to want to do the same thing with their OS as someone else. There's a million ways to skin a cat and there's many more ways to implement something in an OS.
Yes, it is possible. But it is quite tricky. You need to:
Use a cross platform language (this is the easy part, many languages run on different plaftforms)
Avoid using any platform-specific features (usually not too hard, but needs testing)
Ensure you have cross platform libraries for all your dependencies (hard!)
Because of the library issue in particular, there are very few options that work across platforms. Your best options are probably:
A JVM language (like Java, Scala or Clojure) - because the JVM abstracts away from platform specific features, pure Java applications and libraries will run on any platform. Java probably has the best ecosystem of cross platform libraries and tools as a result.
JavaScript - quite a good option if you don't mind running in a browser. There are lots of quirks to deal with, but JavaScript is one of the best cross-platform options because of it's ubiquity.

Easy and efficient language for cross platform parallel port interfacing

I want to use parallel port (LPT) to receive and send data, i have done that before in various language in different OS, like VB in windows, C in linux.
But now, i want to use a language (and a library for LPT access i guess) which is cross platform. So that i can write code in linux and can compile that on my father's windows without changing the code.
The java comm api would be a great choice but official api doesn't support windows and rxtx is 2 years old.
So which language and library will be easier and efficient, i mean, easy to bundle, easy to install etc... and i need linux and windows compatibly.
Parallel port i/o has no standard portable interface. On MSDOS, Windows, and Linux, significantly different paradigms and APIs are used.
The best you can do is write an application which uses an abstract API and then provide that API on each of the target platforms. There are probably already libraries available which does the lower part, but I don't know of any offhand.

How does porting between Linux and Windows work?

If a particular piece of software is made to be run on one platform and the programmer/company/whatever wants to port it to the other, what exactly is done? I mean, do they just rewrite linux or windows-specific references to the equivalent in the other? Or is an entire rewrite necessary?
Just trying to understand what makes it so cost-prohibitive that so many major vendors don't port their software to Linux (specifically thinking about Adobe)
Thanks
this is the point of a cross-platform toolkit like qt or gtk, they provide a platform-agnostic API, which delegates to whichever platform the program is compiled for.
some companies don't use such a toolkit, and write their own (for whatever reason - could well be optimisation-related), meaning they can't just recompile their code for another os.
There are also libraries available that ease, at least on a specific area, the port of Windows API calls to Linux. See the Windows to Linux porting library.
In my experience, there are three main reasons why it's cost-prohibitive to take a large existing program on one platform and port it to another:
it has (not necessarily purposely) extensively used some library or API (often GUI, but there are also plenty of other things) that turns out not to exist on the other platform
it has unknowingly become riddled with dependency on nonstandard features or oddities of the compiler or other tools
it was written by somebody who didn't know that you had to use some oddball feature to get things to work on the other platform (like a Linux library that isn't sprinkled with the right __declspec directives you need for a good Windows DLL).
It's much easier to write a cross-platform app if you consider that a design goal from the start, and I have three specific recommendations:
Use Boost—oodles of handy things you might ordinarily get from platform-specific APIs and libraries, but by using Boost you get it cross-platform.
Do all your GUI programming using a cross-platform library. My favorite these days is Qt, but there are other worthy ones as well.
Build and test every day on both platforms, never provide an opportunity for the code to develop a dependency on only one platform and discover it only too late.
There are many reasons why it may be very difficult to port an application to a different platform, most often it is because some interfaces the application uses to communicate with the system are not available, and one either has to implement them on their own, port a library your application depends on, or rewrite the application, so that it uses alternative functions. Most languages today are very portable across hardware architectures and operating systems, but the problem is with libraries, system calls and potentially other interfaces the OS (or platform) provides. To be more specific:
Compilers may differ in their configuration and the standard functions they provide. On Windows the most popular compiler for C/C++ is Visual Studio, while on unix it is gcc and llvm (in combination with the standard library glibc or BSD libc). They expect different flags, different forms of declaration, produce different file format of executables and shared libraries. Even though C and C++ have standard libraries, they are implemented differently across platforms. There are some systems whose aim is to make compilation portable, such as Autotools, CMake and SCons.
On top of standard libraries there are additional functions OS provides. On Windows they are covered by win32 API, on unix systems these are part of the POSIX standard, with various GNU, BSD and Linux specific extensions, and there are also plain system calls (the lowest-level interface between applications and the operating system). POSIX functions are available on Windows via systems such as cygwin and mingw, win32 API function are available on unix via Wine. The problem is that these implementations are not complete, and often there are minor (but important) differences.
Communication with the desktop system (in order to make a GUI interface) is done differently. On Linux this might be the X Window System (together with freedesktop libraries) or Wayland, while Windows has its own systems. There are GUI libraries which try to provide an abstract interface for these, such as Qt, GTK, wxWidgets, EFL.
Other services the OS provides, such as network communication may be implemented differently. On Windows many applications use .NET libraries, for which there is only limited support on unix systems. Some unix applications rely on Linux-specific features such as systemd, /proc, KMS, cgroups, namespaces. This limits portability even among unix systems (Linux, BSD systems, Mac OS X, ...). Even .NET libraries are not very compatible across different versions, and they might not be available on an older version of Windows or on embedded systems. Android and iOS have different interfaces entirely.
Web applications are usually the most portable, but HTML5 is a live standard, and many interfaces may not be available yet in some browsers/web engines. This requires the use of polyfills, but it is usually much less painful than the situation with "native" applications.
Because of all of these limitations, porting can be a pretty hard work and sometimes it is easier to create a new application from scratch, either specifically for the other platform, using cross-platform abstraction libraries/platforms (such as Qt or Java), or as a web application (potentially bundled in something like Electron). It is a good idea to use these from the beginning, but many programmers choose not to because the applications tend to look and behave differently from "native" applications on the platform, and they might also be slower and more restricted in the way they interact with the OS.
Porting a piece of software that has not been made platform-independant upfront can be an enormous task. Often, the code is deeply ingrained with non-portable APIs, whether 3rd party or just OS libraries. If the 3rd party vendor does not provide the API for the platform you are porting on, you are pretty much forced into a full rewrite of that functionality, or finding another 3rd party that is portable. This only can be awfully costly.
Finally, porting software also means supporting it on another platform, which means hiring some specialists, and training support to answer more complex queries.
In the end, such a process can be very costly, for very little additional sales. Sadly, the decision is easy: concentrate on new functionality on your current platform that you know your customers are going to pay for.
If the software was written for a single OS, a major rework is likely. The first step is to move absolutely all platform-specific code into a single area of the code base; this area should have little or no app-specific stuff. Then rewrite this isolated portion of the code for the new target OS.
Of course, this glosses over some extremely major implications. For instance, if your first version targeted the Win32 API, then any GUI code will be heavily tied to Windows, and to maintain any hope of preserving your sanity, you will need to move all that code to a cross-platform GUI framework like Qt or GTK.
Under Mono, you can write a C# Winforms program that works on both platforms. But to make that possible, the Mono team had to write their own Winforms library that essentially duplicates all of the functions of Winforms. So there is still no free lunch.
Most software is portable to some extent. In the case of a C app - there will be a lot of #ifdefs in the area, apart from path changes, etc.
Rarely windows/linux version of the same software don't share a common codebase - this would actually mean that they only share a common name. It's always harder to maintain more codebases, but I think that the actual problem with porting applications has little to do with the technical side and a lot with business side. Linux has much fewer users that Windows/OSX, most of them expect everything to be free as in beer or simply hate commercial software on some religious grounds.
When you come to think about it - most open source software is multiplatform, no matter what language was used to implement it. This speaks for itself...
P.S. Disclaimer - I'm an avid supporter of Free and Open source software, I don't want to insult anybody - I just share my perspective on the topic.

Linux/Mac OS X equivalents for Windows Communication Foundation

--edit--
What application development frameworks/component models for Linux and Mac OS X are analogous to Windows Communication Foundation & COM, which provide high level IPC mechanisms for manipulating/communicating with software applications?
By high level communication model I mean RPC, publish/subscribe, etc.
I'm writing software for interaction devices which can be bound for manipulation of computation and data within some software. So far instance, I may have a control panel with physical sliders which are bound to various cells within a spreadsheet loaded in Excel, Calculate or Numbers. I have ways to sense events originating from the device, but the interaction subsystems(X11, Explorer, etc.) aren't extensible to handle new types of interaction events, so I need to capture and transport my own events to and from the software to which they're bound.
Also most of the applications I'd like to control cannot be modified to respond to these new types of events. And simulating hot-keys and shortcuts sequences aren't expressive enough, although it would take advantage of existing interaction subsystems. This is why I'm interested in platform specific frameworks, so I can take advantage of pre-existing hooks to control software in the wild.
Since this is for user interaction, it needs to have low latencies. I'd like to have the option of stateless, asynchronous communication also.
I've thought about this question and I realize I needed to ask two questions. One is about high level IPC, and the other is about object component models which allow you call methods on a software object.
--original question--
What communication/component frameworks provide functionality most similar to Windows Communications Foundation on Linux and Mac OS X?
My research group is beginning to develop some type of application development framework for interactive applications which involve new types of devices to manipulate/interact with software applications. We want use an adapter pattern to provide abstractions for device/device application/application or device/application communication so that software built with this framework will be portable across the 3 major OS platforms.
If the Linux apps are modern enough, you might be able to take advantage of D-Bus. It's the offspring of DCop from KDE primarily, and, to a lesser extent, Bonobo from GNOME, so if it's older, you might look one of those things up. Of course, that assumes that it uses one of those toolkits.
If it's even older than that or uses a toolkit without any high-level IPC (e.g. Motif (I think)), you may end up having to resort to pipes, sockets, fifos, and anything else I might have forgotten. That assumes, of course, that the app has some kind of hooks for that stuff.
Here is a list of guides related to networking on Mac OS X It covers different levels of networking from low level socket communications up http://developer.apple.com/documentation/Cocoa/Networking-date.html#doclist
It covers:
Core Foundation networking functions
to work with low-level BSD sockets.
Cocoa stream classes to read data
from and write data to streams.
Web Services client-side frameworks
available in Mac OS X.
Bonjour in Cocoa or Carbon
applications.
URL Loading System to manipulate URLs and transfer
URL contents
Distributed Objects Programming - communication between Objective-C objects in different
threads or different processes
Otherwise Mac OS X is fully Posix compliant unix system so you will find similar IPC system as found on Linux.
Or maybe you are after Mac OS X System Services, system that allows one application to access functionality of another application. Application advertise the services they provide. For more details read linked Apple documentation.
The nearest cousin would be libsoap and equivalent SOAP libraries in your language of choice.

Resources