LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LabVIEW in a Docker Container

Hi John

 

This response might be a little late and you've already got this working. I just found it strange that you couldn't get the silent install of the RTE working and had to resort to using .msi files. So I fired up container using the windowsservercore image and gave it a shot. I used the LV 18 RTE (LVRTE2018_f2Patch-64std.exe) and from the log the install finished without (significant) error. 

 

The trick I used for the install was to not directly call the above .exe in the container. It is a selfextracting archive so firstly I ran it on my host, deselecting the autorun of .\setup.exe. If you don't change the default path the files end up at is "C:\National Instruments Downloads\LabVIEW\Run-Time Engine\2018 (64-bit) f2 patch\Standard"

 

I mapped the entire "Standard" folder to the container and ran the following install command in the folder:

.\setup /q /acceptlicenses yes /r /log C:\Users\Public\log.txt /disableNotificationCheck

 

To monitor the install progress I simply kept checking the size of the log.txt file. I assumed the install was done when the size was fixed for a number of checks 🙂

 

I confirmed that the RTE was working by building a dll from some VIs adding and subtracting numbers and calling the dll from a Python script in the container. 

 

I didn't use a dockerfile for the install, I did it all interactively and then commited a new image from the container, so as a next step I'm going to create a dockerfile that does the same thing. I'll post back with results if anyone is still interested?

 

Best Regards

 

David

Senior Systems Engineer

Northern European Region

Message 21 of 22
(3,109 Views)

We've converted some of our LabVIEW code to run under a Linux docker container. We're using only the LabVIEW runtime engine in the container, not the development environment. We've made the application headless by building it as a shared library with a wrapper. The approach is outlined here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019RYlSAM&l=en-US

 

One useful thing that article leaves out is the use of LVDLLStatus. If you're having problems interfacing with your LabVIEW code in the C wrapper, it can tell you what the problem is. As with any LabVIEW function involving strings being called from C, the function doesn't return a pointer to a string. Instead, you have to allocate the memory yourself before you call LabVIEW and pass the pointer.

 

char *ErrStr;
int ErrStrLen = 1000;
ErrStr = malloc(ErrStrLen);
LVDLLStatus(ErrStr, ErrStrLen, NULL);
printf("LVDLL Status: %s\n", ErrStr);
free(ErrStr);

 

The Dockerfile if anyone is interested...

 

 

FROM centos

# Install labview runtime
RUN mkdir ~/LabVIEW_Runtime
RUN curl -o /root/LabVIEW_Runtime/runtime.tgz \
	http://download.ni.com/support/softlib/labview/labview_runtime/2018/Linux/f1/LabVIEW2018f1RTE_Linux.tgz
RUN cd /root/LabVIEW_Runtime ; tar xf ./runtime.tgz ; rm -f ./runtime.tgz
RUN rpm -Uvh /root/LabVIEW_Runtime/*.rpm
RUN rm -rf ~/LabVIEW_Runtime

 

Then you'll need to use COPY and RUN to install your application, figure out how you're going to do networking (expose/publish), and start the thing using ENTRYPOINT.

Message 22 of 22
(3,077 Views)