Jump to content
AhBi82

VirtualBox with RT

Recommended Posts

Hi,

Didn't know the Zybo. Looks great.

Well the fact is, NI is providing on ni.com a kind of NILinuxRT x86_64 recovery image for PXI with lvrt 2015 installed inside.

I'm working on it for home-learning needs since a couple of weeks. Just a hobby.

I was curious on the technical faisability and basically only checked the data transfer mechanisms.
Maybe there is some more important part of code to try.
Or more killer bugs.

But here's what I managed to run with the NILinuxRT-VM theme in mind :

- About Linx 2014 on a raspberry : an upgrade to 2015 means to a "RTPlatforms.cpp" error by the lvrt binary. Guess it's not quite the same. Maybe a special compilation for this target ?
- Chroot the recovery on a standard and virtualized Linux Mint with the LINX method. Works well. We've got quite the same functionnalities as LINX, but not the RT code : standard code (no RT), run-in-source, build-and-deploy. But not the timed-loop (don't know why, even with fake-hwclock. Got an err -825 CPU issue).
- Run the recovery on a VM in Virtual Box. Quite simple to do with some lucky tricks. It's better : timed-loop, RT Fifos, source-build and deploy are fine. We can add the network streams and the shared variable client easily (not the server). It was running well during a single day.
- Installed it on a real x86 singleboard, a lattepanda. Maybe an Edison could fit. It's running. Noticed the Arduino device inside is recognized by the kernel (didn't check for the other peripheral devices). Just starting with it. Really fun.

All of them runs the real-time engine.
The last 3 items are not 2015 locked. It is upgradable for 2015 SP1, 2016 and so on. (-License point)
For all of them, MAX is not an issue.
It begins as it seems that LabVIEW needs to declare the shared variables in MAX to operate the networked variable engine server on the target.
So the target-VM must (at least) be detected in MAX to obtain an equivalent of a full autonomous device. Much harder.
I'm still discovering about this (MAX see hardly my VM).

fmorandat

  • Like 2

Share this post


Link to post
Share on other sites

Well as mentioned by olfenr there is a solution to a Linux RT VM using an NI provided ISO.  Posted here is an ISO apparently intended on upgrading the OS on PXI RT chassis, to put RT Linux on them, so that they can then be use with the Communication and Design Suite which presumably only supports the Linux RT variant and not Pharlap/VXworks.  You can use this ISO to install the RT Linux OS into a VM made by Virtual Box.  After installing the OS and using the username root, and empty password, you can login, and SSH into it.  I cannot seem to get the remote target recognized by MAX, so I can't install software, or deploy code from LabVIEW.  I've played with the network adapter settings and using Host-Only I can ping the target from my host, but I cannot add the target in MAX.  One thing I just thought of but haven't tested, is possibly starting with installing the Pharlap RT OS in a VM, then using this ISO to upgrade it.

Share this post


Link to post
Share on other sites
7 hours ago, hooovahh said:

Well as mentioned by olfenr there is a solution to a Linux RT VM using an NI provided ISO.  Posted here is an ISO apparently intended on upgrading the OS on PXI RT chassis, to put RT Linux on them, so that they can then be use with the Communication and Design Suite which presumably only supports the Linux RT variant and not Pharlap/VXworks.  You can use this ISO to install the RT Linux OS into a VM made by Virtual Box.  After installing the OS and using the username root, and empty password, you can login, and SSH into it.  I cannot seem to get the remote target recognized by MAX, so I can't install software, or deploy code from LabVIEW.  I've played with the network adapter settings and using Host-Only I can ping the target from my host, but I cannot add the target in MAX.  One thing I just thought of but haven't tested, is possibly starting with installing the Pharlap RT OS in a VM, then using this ISO to upgrade it.

I would guess you can't. If I'm not mistaken max and labview are very particular about what they discover. If you look at release notes you'll sometimes see that max/lv get driver support for hardware several months before release. If you look at the last section here (http://digital.ni.com/public.nsf/allkb/2DED4C9DA08F627B86257F9A00579B05?OpenDocument) you can also see that it specifically says "LabVIEW Communications 2.0 System Designer can now detect your system." 

If you see the description here (http://www.ni.com/documentation/en/labview-comms/latest/rt-targets/registering-real-time-system/) it sounds like this hardware view is in place of max, not in addition to. Just skimming the files it seems like the image in that ISO includes a full software set -- I can't find any document which describes installing software to an RT target, which is kind of a conspicuous thing to leave out of documentation which is otherwise fairly complete.

Share this post


Link to post
Share on other sites

In LabVIEW you can add the target by specifying the chassis type and IP address, but when you go to connect it complains about software compatibility issues.  This is because that ISO includes LabVIEW 2015 (non SP1), but I don't have the non SP1 version installed.  Presumably if I did I could connect to the target in LabVIEW and deploy code.  Other attempts at adding the target are met with odd errors from MAX.  If you try to add the target manually in MAX by specifying the IP address it says it is unable to initialize a connection.  If you use the Troubleshoot Remote  System Discovery and specify the PXIe-8135 (which my VM thinks it is), then it will search for remote targets, and the simple error handler comes up complaining about releasing a queue generating error 1.

I suspect you are right in that this OS is intended to be used with the Comm Suite and MAX isn't supposed to be able to find the target.  So installing additional software through MAX likely isn't possible.  But writing code and deploying to it might be possible if you have LabVIEW 2015.  The software installation wizard appears to be built into MAX and not a separate application that could be called specifying the IP address of a chassis.  So unless there is some other way to get the system recognized by MAX, or some other method of installing software by side-stepping MAX then this might be a dead end.

Share this post


Link to post
Share on other sites
On 13/12/2016 at 7:21 PM, hooovahh said:

You can use this ISO to install the RT Linux OS into a VM made by Virtual Box.

Interesting.....

On 13/12/2016 at 7:21 PM, hooovahh said:

One thing I just thought of but haven't tested, is possibly starting with installing the Pharlap RT OS in a VM, then using this ISO to upgrade it.

If it is from Pharlap to Linux. then it is not an "upgrade".

Hmmm. Dual boot a PXI rack? :) That must be worth a few hours playing around with :P

Share this post


Link to post
Share on other sites

Yeah I tried the "upgrade" route and you're right, it isn't an upgrade and wipes away the OS.  Still you can have a RT Linux VM.  Just no MAX or installing software...and at the moment you can only develop for it in 2015, but putty, networking, and package management works.

Share this post


Link to post
Share on other sites
15 hours ago, hooovahh said:

Yeah I tried the "upgrade" route and you're right, it isn't an upgrade and wipes away the OS.  Still you can have a RT Linux VM.  Just no MAX or installing software...and at the moment you can only develop for it in 2015, but putty, networking, and package management works.

Yes. It is a "recovery disk" so requires a pre-existing install. It fails "provisioning" if you try to install from scratch in VMware.

Edited by ShaunR

Share this post


Link to post
Share on other sites
1 hour ago, ShaunR said:

Yes. It is a "recovery disk" so requires a pre-existing install. It fails "provisioning" if you try to install from scratch in VMware.

This is not the case in VirtualBox.  I installed it on a fresh VM with no OS.  I also tried the upgrade method starting with Pharlap but the results were the same in both cases.  During the install it complained twice saying something like this isn't supported hardware and it might not work, do you want to continue anyway?  And I just said yes until it asked to remove the CD and boot normally.

Share this post


Link to post
Share on other sites

So with a little help, I was able to upgrade the RT Linux part of the system to have LabVIEW 2015 SP1, and with it I was able to add the target, connect, deploy code which ran bash commands, and got the result.  Still no UI and there is a good chance that just wasn't included in the package anyway.  And still no way to install more software through MAX.

After you install the OS using the NI provided ISO, boot up the VM using the network adapter Host-only.  Hopefully when it boots it will show the IP address and it can be pinged from your Windows OS.  Using Filezilla connect to using "sftp://<IP Address>", username "root" and blank password.

Navigate to  /usr/local/natinst/labview and delete or rename the lvrt file, and delete the symbolic link liblvrt.so.15.0 (the file can remain)

I wanted to upgrade to 2015 SP1 so I transferred over the lvrt and the liblvrt.so.15.0.1 files from the following directory:

C:\Program Files (x86)\National Instruments\RT Images\LabVIEW\2015sp1\Linux\x64\

Next we need to set the permissions on these two transferred files, so in Filezilla right click and set the properties of these newly transferred files to 755.  Next we need to recreate the symbolic link we deleted earlier.  So using putty log into the VM, and navigate to the /usr/local/natinst/labview folder and execute the following command.

ln -s ./liblvrt.so.15.0.1 ./liblvrt.so.15.0

Then reboot the controller.  Then in LabVIEW 2015 SP1, create a new project, and add a new target or device.  Specify it with the IP address, and specify the type as a Real-Time CompactDAQ >> 9135 (this is a controller with x64 RT Linux).  You should now be able to connect, and deploy, and run code to the RT system.  I tested it running the system exec "ls" and it listed files as bash should.  I've also been able to deploy code that uses TCP, UDP, WebDav, Network Streams, DataSocket, and VISA functions so these libraries are installed with the ISO, but no DAQmx, not that this VM needs it.  In my mind the most benefit is from being able to use and call into 3rd party libraries and test deploying network code.

  • Like 2

Share this post


Link to post
Share on other sites
On 16/12/2016 at 1:49 PM, hooovahh said:

This is not the case in VirtualBox.  I installed it on a fresh VM with no OS.  I also tried the upgrade method starting with Pharlap but the results were the same in both cases.  During the install it complained twice saying something like this isn't supported hardware and it might not work, do you want to continue anyway?  And I just said yes until it asked to remove the CD and boot normally.

Yeah. I looked a bit more and it's looking like the image wants to create a USB device as part of the install and, IIRC, VMWare has problems with USB boots.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.