From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

A problem about developing a custom device through object oriented programming

Hi all, 

I am creating a custom device and its "driver VI" contains a "LV class" to control the device. I use LV 2019 to create the LV class and put it in the driver VI. The custom device is invoked by Veristand 2019 and deployed to a Pharlab target (NI PXIe-8840). 

During development, I deploy it to Windows 10 which is the development environment, and everything is ok. But the same program fails to be deployed to Pharlab target. The VeriStand shows "Error 1003" on the "driver VI". 

After debugging, I find that the deploy fails when a method of the LV class is further wrapped in a subVI (named A ) invoked by the "driver VI". If the "driver VI" invokes methods of the class directly, then everything is ok. 

I also try inlining the "subVI A" calling the class methods in the, but it also fails to be deployed (same error code 1003). 

 

Is there anything I can do to resolve the problem? 

Best Regards

 

Godel

0 Kudos
Message 1 of 6
(2,574 Views)

Hi Godel,

 

the solution is to put it to packed library to have separate name space. See f.e.following CD

 

https://github.com/NIVeriStandAdd-Ons/Instrument-Custom-Device

https://github.com/NIVeriStandAdd-Ons/Instrument-Custom-Device-Classes

 

Regards,

 

Jiri

CLA, CTA, CLED

0 Kudos
Message 2 of 6
(2,532 Views)

Hi Jiri, 

 

Thanks for your  kind reply. 

I follow your advice and packs the two LV classes in a library, but the same error shows. 
The attachment shows my project structure and the error message. 
Any further recommendations? 

 

Best Regards

 

 

0 Kudos
Message 3 of 6
(2,511 Views)

Hi Godel,

 

the use there was a packed  library, that has a separate build. You've used normal LV library...

 

~Jiri

 

 

CLA, CTA, CLED

0 Kudos
Message 4 of 6
(2,502 Views)

I believe I have come accross this before when trying to deploy custom device code to PharLap targets

 

You need to create the RT driver code under the PharLap target which is present when you create a custom device project using the template and build your Engine Release from there too, otherwise you are building a program to run with windows vi's rather than real time vi's and expecting it to run on a real time target 

 

example.PNG

0 Kudos
Message 5 of 6
(2,489 Views)

Hi all,

 

I have the same problem developing a custom device based on object oriented programming.

 

As shown in the example https://github.com/NIVeriStandAdd-Ons/Instrument-Custom-Device-Classes  I grouped the classes in a Library and I built the 3 different packed libraries, one for every target in use (RT PXI Target - Pahrlap, RT CompactRIO Target - Linux ARM and RT CompactRIO Target - Linux x64). To avoid conflicts in name, they have 3 different names (CCSS Chamber Classes Pharlap, CCSS Chamber Classes LinuxARMCCSS Chamber Classes LinuxX64). See attacched pic "Packed Library Project.png".

 

Then I added packed libraries to Custom Device Project, one for every target. See attacched pic "CD device Project (1).png".

 

I created 3 different Engine library, one for every target. I made this in order to diversify the RTDriver.vi, I want to be shure that packed libraries are linked to the target they were compiled for. See attacched pic "CD device Project (2).png"

For example, in "CCS_Service Engine Pahrlap.lvlib.RT Driver VI.vi" I added only the classes from "CCSS Chamber Classes Pharlap.lvlibp".

So in the CD project, I have 3 different RTDriver.vi, one for every target.

In every RTDriver.vi I added the objetcs of the classes taken from the packed library compiled for the specific target.

 

In Build Specification/Source Files, I always included the packed library (Destination "Support Directory"). See "CD device Project (3).png"

In Build Specification/Source FilesSetting, I fixed the destination of packed library to Support Directory. See "CD device Project (4).png"

 

When I deploy the CD, I get error 1003 on driver VI.

 

Are there any conceptual errors in the process described?

 

Someone can explain me how to use classes in a Costum Divice?

 

Thank you

 

Regards

 

Giuseppe

0 Kudos
Message 6 of 6
(1,079 Views)