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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Micro-Nuggets !!! ~~~~ Post 'em if you got 'em

Sub-Micro Nugget: When using a Listbox as an indicator, set the Value of the Listbox to -1, so there will not be a selected item in the Listbox, which would look distracting.

 

Micro Nugget: Custom Symbols in a Listbox can greatly enhance the user experience by pictorially describing the items. The symbols you provide take place of one or more of the supplied symbols. Find some supplied symbols you are not using and index those locations, and replace them with your custom symbols (shown in the second For Loop).

 

In the example below, I have a case statement (in the last For Loop) where I apply the proper logo to each motorcycle type. I'm telling the Listbox to use the "open folder" symbol if the motorcycle is a YZF type, and I've previously replaced the "open folder" symbol with my Y.jpg, which us a Yamaha logo.

 

lstbxsymbs.png

Richard






Message 11 of 361
(8,741 Views)

Using a Mouse Over feature is a great way to get attention. Often, the tip-strip is all you need. But it can be too slow, not big enough, etc.

 

A custom cursor might be just the ticket. An animated cursor could tell a user that they need to buy the feature before the button will work, or that they should not try to type in an indicator, etc. I used this recently to show the user that they can't click on a picture.

 

The attached example shows how I used a big red “X” as an icon to warn the user that the “X-RAY” feature is not available when the “IR” button is on. This is less confusing to a user faced with a grayed-out button that still gives you the finger even though it is disabled.

 

Open the VI and look for the path constant. You'll see a note about changing the path to the place where you put the x.cur file.

 

 

Richard






Message 12 of 361
(8,668 Views)

Instead of using


@broken Arrow wrote:

 

 

Micro Nugget: Custom Symbols in a Listbox can greatly enhance the user experience by pictorially describing the items. The symbols you provide take place of one or more of the supplied symbols. Find some supplied symbols you are not using and index those locations, and replace them with your custom symbols (shown in the second For Loop).

 


 

You can use an unused index (>40 or something) no need to overwrite standard icons.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 13 of 361
(8,569 Views)

TCPlomp wrote:

You can use an unused index (>40 or something) no need to overwrite standard icons.


You are correct Ton, thanks for the clarification. I guess I've always found it intuitive to index using a symbol constant, so that's why I've always done the replace trick.

Note to others: replacing the existing symbol is only temporary, while you are using the VI where the replacement takes place.

Richard






0 Kudos
Message 14 of 361
(8,536 Views)

The picture shown below represents a hypothetical scenario where we know that the Background and the Potassium data will have fewer counts than the other isotopes. It is important to remember that the order in which you build the array effects the presentation on the graph. I had to wire Potassium and Background first, to make sure I would see them in front of the other data.

 

While we're at it, check out the General Histogram VI. Note that if you click on the output Histogram Graph and then Create > Indicator, you'll be presented with a graph that does not exist on the Graph palette. You could create one from a XY graph, but why? The General Histogram VI allows for a range input, which is ideal to present spectral data as shown.

 

The VI is attached. (( yes I misspelled Potassium in the code and FP Smiley Tongue ))

 

Histogram.png 

Richard






Message 15 of 361
(8,528 Views)

One common oversight when indexing an array (top) is wiring all of the index inputs when indexing sequentially. Not necessary! 

A less common addition feature oversight (bottom) is forgetting that the ADD function will accept an array and a single scalar. Common when adding offset scaling to data. 

 

arrayMistakes.png

Richard






Message 16 of 361
(8,407 Views)

@broken Arrow wrote:

One common oversight when indexing an array (top) is wiring all of the index inputs when indexing sequentially. Not necessary! 

A less common addition feature oversight (bottom) is forgetting that the ADD function will accept an array and a single scalar. Common when adding offset scaling to data. 

 

arrayMistakes.png


That last trick will also work on brown clusters.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 17 of 361
(8,392 Views)

Custom numeric formatting:

 

To force a numeric to always displaying the sign of the number simply put a "+" in the formatting.

 

To force a numeric to always displaying the period as the separator put a "%.;" in the formatting (this is very hand if you do work on systems where the regional default is to use a comma ",")

 

For example: %.;%+.3f  will format to three decimal places, use the period as the separator,  display the sign

 

Numeric Properties Angle (Caption)_2010-10-26_18-13-53.png

 

Message 18 of 361
(8,370 Views)

The previous post reminded me of something I tend to learn, then forget, then re-learn.  You can specify the order in which you use the inputs to Format Into String by using the #$ specifier, for example %2$f specifies that the second input should be formatted as a float.  Great for repeating things, or when you really want to avoid crossing wires.

 

FormatStringOrder.png

 

Edit:  This also reminded me of something else, WTF is it an error if too few format specifiers are given to that function.  I posted a lets-say not so popular idea request to change this here.  I would like it to just use as many specifiers as I give it, and if some inputs aren't used, so be it.

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Too-FEW-format-specifiers-should-not-be-an-error-for-F...

Message 19 of 361
(8,331 Views)

I'm going to talk about DAQmx, specifically M-series cards. They are really crazy devices that offer you a lot of different functionality: analog inputs and outputs, digital inputs and outputs, counters. What I think makes them really cool and superior to other devices is: you can combine the functionality and sync them.

For some days I was working on the task of getting analog readings correlated with a moving stage.

  • Well, you can easily use a counter on a M-Series card to read the encoder position.
  • And you even can get the position reading synchronized with you analog reading.

See here how to do.

 

This allows you to move a stage really fast and get readings at several defined positions to obtain a precise mapping.

 

Felix

Message 20 of 361
(8,296 Views)