Category Archives: LabVIEW

National Instruments DIAdem Text @@ Commands

If you’ve ever used NI’s DIAdem for data analysis you know how useful it is for looking at and analyzing large datasets.  What you may or may not have discovered is the @@——@@ commands that can be used to display channel related texts anywhere in the program.

DIAdem helpfully gives you a list of available commands, but doesn’t tell you what they display or how to use them.
Program Command: @@ChnPropGet(No,Property name)@@
Formatting: @@ChnPropGet(1,”Description”)@@
Output: The 1st channel’s Description, other input could be Name, Unit, etc
Notes: Make sure to use quotes around the Property name and remember that the channels are counted from the very first channel onwards and found as “Number” in the channel information.

Command: @@CD()@@
Formatting: @@CD(1)@@
Output: The 1st channel’s Units

Command: @@ChD(Line,No)@@
Formatting: @@ChD(2,1)@@
Output: The 1st channel’s second data point value

Command: @@CL(No)@@
Formatting: @@CL(1)@@
Output: The 1st channel’s number of points (length)

Command: @@CNoXGet(Channel group number,No)@@
Formatting: @@CNoXGet(2,1)@@
Output: Finds the 2nd group’s first channel and returns it’s channel number (counting from the first channel.
Notes: Could be considered translating from relative position of a channel (in a group) to absolute position in the list of channels.

Couple of general notes, you can’t nest lookups (at least not in the text boxes, so it would be invalid to:


and turn it into a lookup:

Otherwise it’s pretty helpful to use these when labeling graphs/etc so you don’t have to constantly correct things.  DIAdem also builds in lots of string functions like trim/etc, so you can clean things up if necessary!

<Wordpress>  – I had all these formatted nicely in a table but WordPress ate itself trying to render it, hence the oddball list, sorry. </Wordpress>

AVL Smokemeter or Opacimeter Controller Software

If anyone is looking for a free terminal style controller for an AVL 415S Smokemeter or a AVL 439 Opacimeter I’ve posted the ones I use at work here.

You’ll want the very old school Terminal from Microsoft:

Microsoft TERMINAL

And the preset terminal buttons for the AVL 415S Smokemeter:


OR the LabVIEW interface for the AVL 415S Smokemeter:

LV Smokemeter Control
(Taken from this post)

And the preset terminal buttons for the AVL 439 Opacimeter:


OR the LabVIEW interface for the AVL 439 Opacimeter:

(Lightly modified from this one)

LabVIEW Shared Variable Engine

I spent more than 20 minutes trying to figure out the LabVIEW shared variable engine so it’s worth writing about.  My objective was to test the shared variable engine across multiple networked computers, if you are just trying to get the shared variable engine running this post applies to you as well, but you should not follow the steps to configure multiple computers.

The first note, is that they have a good page write up regarding shared variables here.  After reading a little bit about shared variables you should open up LabVIEW, go to:

Help – Find Examples. . .  and search for shared.  This will bring up a list of shared variable examples.  Open up the “Shared Variable Client – Server.lvproj”.

Now expand the server.lvlib and run “Variable”.  Once you have this up and running, go back to the project explorer and now expand clients.lvlib and run any of the VI’s from this category – ie: “Data Item Binding”.

Now you should have something that looks like:

Running Server

Client Receiving Data

Client Receiving Data

What’s happening is the LabVIEW project is sharing waveform information from the “server” in the form of TCP (I had UDP here, it’s clearly not as this would not have any confirmation of packet receipt – TCP vs. UDP) information packets and the “client” is listening to the waveform data and initializing communications by sending the server it’s Client Name.

If you want to get this example running across multiple computers you can see some useful information here.  The idea is that you need to now repeat the above steps on another computer, only this time DON’T open and run another server, we’re going to get the Client to read data from the other computer!

First step is to repeat the above and get the example project open on another computer.  Once you have the project opened up, let’s choose to get data from the other computer who is running now as a server.

First double click the “bound waveform” variable so we can choose where to get data from.

Double Click Bound Waveform

Double Click Bound Waveform

Now check the box “Bind to Source”, and click Browse… and find your other computer who is acting as the server.

Bind to Source; Browse. . .

Bind to Source; Browse. . .

Select Remote Server

Select Remote Server

Note Change in Binding

Note Change in Binding

Now go back and run any of the client VI’s and with any luck you should have data running from the server to each of the clients successfully!

Open a CLIENT on Another Machine

Open a CLIENT on Another Machine

If you create your own VI’s it’s very simple to create shared variables, just right click the project, go to new variable and configure it just as you’ve done above and you should be off and rolling in no time!