LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X Control to select delimiter character like space, comma, tab, colon etc...

Solved!
Go to solution

I wrote my first X Control to select decimal separators/table delimiters for beeing used when importing ascii data in own programs. I have some questions about the implementation of this X Control. However, additionally i would be very interested in your feedback on the code and what you think about the usefulness of this X control. 

 

Here are some explanations of what was my reason of writing this X control:

 

Beeing a physician i often deal with ascii data and need to import it in own LabView programs. However, sometime the data happens to use "." as decimal separator, sometimes ",". Additionally the columns delimiter can vary also. Therefore i always wire the delimiter and decimal separators in table string to array and similar functions to input controls. However, the string inputs accepts every ascii character but only a small subset is used as separators/delimiters. Furthermore you have always to delete the complete string if you want to enter a new delimiter. Nevertheless you can limit the input to one line and use backslash viewing mode.

Using enums or ring controls has the advange in beeing able to make a preset of known separators/delimiters. However, the text field is not able to show backslash codes. So, names have to be used instead. Then the corresponding index has to be translated back to the delimiter/separator string with additional code. 

With my X Control this is past. You can select a delimiter from a list, see a preview and the delimiter is returned as a string which can be used in the input of "table string to array" or similar functions. 

Here are my questions:

- I'm currently initializing the control in the "exe state change event". I change the value of the selected delimiter preview there via a property node. Further writes to the same property node are made in the "display change event" and in a "value change event". I would like to have only one write to the property node and would like to know where to place it the best.

- Do i have to implement the "display change event" if i do only reads on the value properties of the x control frontpanel elements?

 

 

The attached project is for LabVIEW 2013+

0 Kudos
Message 1 of 4
(4,151 Views)

Why don't you use a combo box instead? This seems like a simple case where an XControl is overkill. The combo box might not be the ideal look, but it allows the user to select human readable text as a dropdown, but the text can still be "\" notation.

Combobox.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(4,068 Views)

Assumed that a Combo Box could handle numeric values, only (besides the tags)

0 Kudos
Message 3 of 4
(4,059 Views)
Solution
Accepted by topic author Labuser16383

You're confusing the combo box with an enum. The combo box is 100% strings. The enum will always output a numeric, but can have custom naming attached to those numerics.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 4
(4,052 Views)