Showing results for 
Search instead for 
Did you mean: 

Updating image using ActiveX



I'm a student intern and have been tasked with updating an image 4 times per second.

The boss asked me to look into doing it via an ActiveX control, as suggested here (last of the five options):


Now, I'm (very) new to labview and ActiveX is a first for me as well (tho much easier for me to wrap myself around, as I'm on a familiar platform there (.NET)).

So my question is, has anyone done this before? Perhaps even have code they are willing to share?


Any tips and input are very welcome, and a C# example would be ideal.


Thanks for your time,




0 Kudos
Message 1 of 5



You might have a  look at this Calling ActiveX Code from LabVIEW

Eirikur Runarsson
0 Kudos
Message 2 of 5

Hi Eirikur,


Thanks for the link. Hadn't seen that page yet, though I have found similar information elsewhere.


I was about to start putting together a little test, when it struck me that ActiveX is purely windows, while the Labview program will run on a linux machine.


I found this post, stating that that's impossible (that is, using ActiveX in Labview running on Linux). It's quite old, though, so I wonder if anyone can confirm whether it is still impossible?


If it is, suggestions on how else to tackle this problem of near-continuous image updates would be greatly appreciated.

0 Kudos
Message 3 of 5

Hi Tobias,


You are correct in that ActiveX is only for Windows.


I think you have good suggestions in the link you initially posted.

Eirikur Runarsson
0 Kudos
Message 4 of 5

Hi Eirikur, thanks for getting back to me 🙂


We ended up trying with javascript, ajax. Being tested tomorrow at the factory.


The script is quite simple, with the final html displayed looking something like this:


<!DOCTYPE html>
<html xmlns="">
<script type="text/javascript" src=""></script>
<div id="imgHolder"></div>

//Script checks for update on contents of 'last_modified.txt' 10 times per sec.
//If the path given in that file is different from last check, updates html.

var path = "";
var img = document.createElement('img');
img.height = 200;
img.width = 200;

//ajax options when requesting 'last_modified.txt'
var reqOptions = {
   type: 'GET',
   url: 'last_modified.txt',
   dataType: 'html',
   success: function (data, status) {
   //if data (contents of 'last_modified.txt')
   //is different from last time, update path variable and html
   if (path != data) {
      path = data;
      $('p').html(path); //update file name txt
      //update source of image
      //update image


//When document is ready...
$(document).ready(function () {
   //Request file every .1 second
   setInterval(function () {
   }, 100);



The idea is that labview writes to the file 'last_modifed.txt', inputting the filename of the last image it wrote to disk.

The JS then requests this file every 100 ms, and updates the html if the filename is different from last pass.


Comments and ideas very welcome!


0 Kudos
Message 5 of 5