09-26-2022 05:32 AM
Dear all,
I'd like to share with you an issue I’m facing trying to deploy an .so file to a PXI running NI Linux and compiled from a Simulink model which includes an S-Function.
In my company we have a quite complex C project developed in Visual Studio, which we have traditionally built as a static library (*.lib) for both Win32 and Win64 systems. We generate a S-Function for Simulink from this library using the Legacy Code tool from the Mathworks. Since several years, this has worked perfectly as we are able to use the library in simulation (Simulink), but also, we are able to build and deploy the S-Function to PXI systems generating a dll file for Pharlap using the Veristand Model Framework. This last using the Win32 version of the *.lib file built with Microsoft Visual C++ 2010 compiler.
So, everything goes well until now, when we want to use the same C Code in NI Linux 64 platforms.
Below the process we have followed:
But the issue is that when I try to deploy it in the PXI running NI Linux. An error appears telling me that “The specified model is incompatible with NI Veristand…”.
So, my questions are:
Please find attached (in zip file):
Thanks in advacned,
Borja
09-29-2022 09:12 AM
Hello Borja_85,
I checked some error solutions and found something necessary links that can help you avoid this error.
This forum post has solution for that error, check that and try to debug it again.
Also there are 2 similar articles where described the solution of this error, go through these links you might find something necessary.
1. Error -307703 The Specified Model is Incompatible with NI VeriStand - NI
2. Error -1 or Error -307703 When Adding vsmodel to VeriStand - NI
The next step I suggest to check is VeriStand compatibility with NI Linux Real-Time. I assume that you are using Linux RT version here, if it is not please let us know what NI Linux you are using and mention the version.
One of the possible reason can be migrating PharLap Application to NI Linux RT. I have attached the link where I suggest to double check if the migration was done properly.
Regards )
09-30-2022 08:49 AM
Hi I.hovs,
Many thanks for your feedback. I've checked the links you shared and here is my feedback.
I don't think that these links (This and 1. Error -307703 The Specified Model is Incompatible with NI VeriStand - NI) are applicable here as they ara based on using special characters in the model name. And I don't have any special character in the name.
Regarding this (Error -1 or Error -307703 When Adding vsmodel to VeriStand - NI), I had already checked that and tested it. Unfortunately with the same error.
Regarding this ( compatibility ), I'll check it. In the meantime, I'm using Veristand 2020 R6, RT Linux Image 20.x (I think), and 2017 version of the C/C++ cross compile tool. Any issue here?
About this ( migrating PharLap Application to NI Linux RT.), I'm not migrating an application from Pharlap. I have C static libraries for windows (*.lib) and Linux (*.a), which are working (tested under Windows and Ubuntu). These libraries are wrapped afterwards in a Simulink S-Function, which I'm compiling for NI Linux using Veristand Model Framework.
Best regards,
09-30-2022 09:27 AM
Thanks for your feedback.
What I understand is that the VeriStand version witch you have mentioned is 20.x inappropriate with NI Linux RT image version. See it from attached picture, witch I got from compatibility link.
So what I suggest you to update it into one of this versions on the pic. I think that might be the solution in this case since you already checked all the links I sent.
Let me know about any new updates and information.
Regards
10-03-2022 04:40 AM
Hi,
Many thanks for your feedback. Sorry for the misunderstanding regarding the RT Image version, but the other day I didn't have the PXI and, therefore, I couldn’t check the RT version.
I can confirm that I’m using RT Image 21.5. So, according to the compatibility table, the so file should be loadable. Furthermore, I’ve created a virtual machine with NI Linux (following a couple of guides available in the web), I’ve installed also RT 21.5 on it but, unfortunately, I’m receiving the same error in both the PXI and the VM.
Plase find below a couple of screenshots showing the RT image installed on both PXI and VM (emulating an NI-cRIO)
Any other clue?
Many thanks,
10-07-2022 02:02 AM
Dear all,
I have good and bad news from my side!
The good news is that I’ve been able to download the generated so file to the NI Linux RT. After deep investigation, I realized that some specific trigonometric functions were undefined in the generated so file.
I discovered this by executing “ld” command to the so file. The only thing I did is specify to the veristand.tlc file the “-lm” linker flag. After doing this, I’m able to download the so file to the PXI, but it is initially stopped.
If I do again “ld” to the so file, I’m receiving this:
As shown, the only undefined symbols are functions that Versitand introduces in the so file when building from Simulink. I’m quite sure about this because I’ve generated an so file from a very simple Simulink example (just a sum of 2 inputs), execute the “ld” command and I get the same undefined symbols.
But here are the bad news…. When I tri to run the model from Veristand Channel Data Viewer, I’m getting a segmentation fault. Specifically, I’m receiving this message:
Could you please give me some feedback about this? In the meantime, please find attached the generated so file (zipped) I’m trying to run.
Best regards
10-07-2022 02:09 AM
Hi again,
Sorry, but I forgot to add an important detail. All static libraries I'm using are coss-compiled with the -fPIC flag.
Regards,
10-13-2022 03:59 AM
Hi there,
I’ve been working from my side on this and have good and bad news.
Good news is that I’m able to run the library in NI Linux. What I’ve done is create a Linux application in C from which I call the library (*.a) I'm using to generating the so file from Simulink. This runs properly.
However, bad news are that I’m not still able to run the so file generated from Simulink using exactly the same *.a library. So, I think that the issue might be related to the building process using the Veristand Linux tlc.
Does anyone know a way to debug step by step the so file execution in NI Linux from a Labview real time project for instance?
Is there any so file checker?
Best regards,