LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pharlap ETS DLL and Driver Questions

Solved!
Go to solution

Hi!

 

I have a couple questions regarding developing NI Real Time on my system running Pharlap ETS.

 

1. Can I use any version of Visual Studio to develop dlls for my system? Some users were recommending version 6.0, but can I use 2013?

 

2. I assume that if I am running Pharlap ETS, I should have all of the drivers available to use e.g. VISA, TCP/IP etc. Is this correct?

 

3. Are the system dlls in Pharlap ETS the same as in Windows? If not, is there a manual of them somewhere? I couldn't find one.

 

Thanks.

0 Kudos
Message 1 of 12
(7,386 Views)

Your questions about LabVIEW RT and PharLap sounds wrong to me.  Just as LabVIEW on a PC is Version-specific, my experience with PharLap (on a PXI system) is just as Version-specific.  I've always used MAX to not only download the appropriate version of PharLap, then used MAX to download the version-specific Drivers (as specified by MAX) to the device.

 

I've not tried to download any "foreign" DLLs to the PXI.

 

Bob Schor

0 Kudos
Message 2 of 12
(7,352 Views)

Thanks for the reply.

 

What I mean to ask is what IDE can I use to develop my own C DLLs that I can call using the "Call Library Function Node" block in LabVIEW? For example, I used Eclipse IDE to develop an IPv6 .so for my Linux RT cRIO; whereas, for Windows I would use Visual Studio. Will any version of Visual Studio work for Pharlap ETS or is there a specific IDE I should use?

 

And will the C includes be similar/same as Windows not Linux version includes? For example, Windows IPv6 can use the Winsock library, but Linux IPv6 cannot. Does Pharlap ETS have its own libraries or does it use Windows (32 bit only?) libraries?

0 Kudos
Message 3 of 12
(7,340 Views)

Sorry, outside my area of expertise.

 

BS

0 Kudos
Message 4 of 12
(7,336 Views)
0 Kudos
Message 5 of 12
(7,325 Views)
Solution
Accepted by topic author JHugh

Which version of LabVIEW? If you use a recent version you can use Visual C 6.0 (works always as that was the last Visual C version that did not have version specific runtime libraries but directly interfaced to the standard Windows C runtime API).

 

Other versions supported are

MSVS 7.1 (Visual Studio 2003)

MSVS 9.0 (Visual Studio 2008)

MSVS 10.0 (Visual Studio 2010)

 

The reason that you can't just go and use any Visual Studio version is that you can not install the redistributable C runtime that comes with Visual Studio onto Pharlap. The Pharlap Windows API is at about the level of Windows 2000, exclusive features that make little sense on an embedded realtime system such as user management, and access rights based on that. Also no .Net or ActiveX is present.

 

But a DLL created with Visual Studio is heavily dependent on the matching MSVCRxxx.DLL. So NI licensed the C runtime source code from Microsoft and ported it to the Pharlap system for the Visual Studio versions they decided to use for Pharlap development (They also need to compile the LabVEW realtime runtime system to run on Pharlap and since the Windows version is compiled with Visual Studio it is easiest to use the same compiler for the Pharlap version).

Above mentioned versions are the versions that NI has standardized on in subsequent LabVIEW realtime versions and ported the MS C runtime library to. While it would be of course nice if they supported all Visual Studio versions, that is not really an option. Creating and maintaining a port of the Microsoft Visual C runtime library is a major investment in time for development and even more so testing, so they limited it to the versions they needed as new important features got supported in the Visual C compiler. Visual Studio 2010 seems to be more than enough for even the most demanding features, which is not so surprising. C and C++ hasn't changed much with the exception of new features from the newer C11 and such versions but those are mostly academic, syntactic sugar or template related (shudder). Newer Visual Studio versions may be necessary if you want to use the newest .Net version but since .Net is not an option on Pharlap anyways, why bother!

 

Other compilers like MinGW or similar are unfortunately even more complicated to get to properly run on Pharlap as their C runtime library has similar problems as the Microsoft ones. You can't simply install it on Pharlap and porting a C runtime library to another target is not trivial.

 

As to Winsock support, yes Pharlap has a Winsock compatible implementation but if that supports IPv6 I wouldn't be able to confirm.

 

Correction: This link says explicitedly that there is no IPv6 support on realtime controllers that use Pharlap or VxWorks.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 12
(7,314 Views)

The fact that Pharlap only supports outdated compilers has always been a source of trouble for us. It's a real problem that you cannot run C++11 code on Pharlap. The changes introduced by C++11 are definitely not just academic. They are used in practice and this means that you can't use most of the code that was written in the past few years on Pharlap. 

 

Also, VS2010 is so old that other tools (like MatLab) dropped support for it. If NI doesn't come up with a solution this means that you can't use recent versions of Simulink to compile models for use with NI VeriStand.

 

Regards

Dirk

 

 

Message 7 of 12
(7,212 Views)

Well the problem is that any library that requires a newer compiler has almost certainly little chances to run on Pharlap ETS anyhow. If a newer compiler is used that usually also means that new Windows features are used. Any API introduced after Windows NT 4 is almost certainly not available on Pharlap ETS in any way.

 

And that is not something NI can change. Pharlap ETS is an outdated platform by nowadays means and even Interval Zero doesn't support it beyond maintenance mode. The only way NI is able to really fix that with reasonable effort is by moving their VXI controllers to NI Linux Realtime too.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 8 of 12
(7,207 Views)

Most features introduced in C++11 should not require new operating system API calls. It's just that the VC++ versions that (partly) support C++11 also make unsupported API calls (but for different reasons, not to implement the C++11 features). In other words, it would be possible to write a C++11 compatible compiler that targets the VC++ 2010 CRT (or even older). 

 

However, it would probably make much more sense to move PXI to Linux (which is what I'm hoping for). I just wish that NI would communicate what their plans are. This would make planning for the future much easier for me.

 

Regards

Dirk

 

 

0 Kudos
Message 9 of 12
(7,200 Views)

@Krid wrote:

Most features introduced in C++11 should not require new operating system API calls. It's just that the VC++ versions that (partly) support C++11 also make unsupported API calls (but for different reasons, not to implement the C++11 features). In other words, it would be possible to write a C++11 compatible compiler that targets the VC++ 2010 CRT (or even older).  


Well, NI does sell LabWindows/CVI but I'm positively sure they do not intend to replace the Visual C compiler. What they rather did in the past is create a VC CRT library that could load and run on Pharlap, using the VC CRT source code. While it's not exactly rocket science to do that (Visual C does come with that source code) it's fairly tedious and encumbered with license questions, since Microsoft does not deliver that code with any rights for you to use it, other than for debugging your application.

 

So NI had to license it from Microsoft in order to be able to distribute the CRT for Pharlap for the VC versions they support. And porting the code to Pharlap is most likely not even the most difficult and time consuming part. Testing and validating it is likely a much more time consuming work.

 

I'm aware that C11 has little to do with the underlaying OS but only with the actual compiler. However getting support for a certain feature in VC means you have to go with the VC version that supports it and believe me, trying to convince a VC version to link to a different CRT version than the one that it comes with it is an almost impossible adventure. I tried at some point to make a shim layer that replaces the VC CRT library by directly interfacing to the standard Windows MSVCRT.DLL. Getting code to link with such a library instead of the standard CRT library seems even with lots of low level mockery almost impossible.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 12
(7,194 Views)