LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text to text machine translation

Hi, I'm looking for a VI that can translate an entered string to an equivalent value in a list of strings and display this equivalent string

 

E.g. If I type in "a" it would display "Alpha" and if I type in b it would display "Beta" and so on.

 

Thanks

0 Kudos
Message 1 of 22
(2,934 Views)

I suggest to use variant attribute for that, if you look it up you should find interesting results.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 22
(2,932 Views)

Here's what I mean, hope this helps.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 22
(2,927 Views)

@MarkBai wrote:

Hi, I'm looking for a VI that can translate an entered string to an equivalent value in a list of strings and display this equivalent string

 

E.g. If I type in "a" it would display "Alpha" and if I type in b it would display "Beta" and so on.


I don't see in what way "a" is equivalent to "Alpha" and why you call this a "translation"?

 

Please clarify. How does your list of strings look like? Is it a list of keys and their values, for example?

0 Kudos
Message 4 of 22
(2,923 Views)

@TiTou wrote:

Here's what I mean, hope this helps.


One serious flaw here is the fact that you have two controls with the same name. This can lead to endless confusion, and accidental mistakes, especially if you use local variables and property nodes.

 

The variant attribute is sound, though. I use it all the time, e.g. for associative arrays. 😄

0 Kudos
Message 5 of 22
(2,919 Views)

@altenbach wrote:
One serious flaw here is the fact that you have two controls with the same name. This can lead to endless confusion, and accidental mistakes, especially if you use local variables and property nodes.

Very true, I went a bit to fast...

 


@altenbach wrote:
The variant attribute is sound, though. I use it all the time, e.g. for associative arrays. 😄

Yes, it's really fast, I love it!


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 22
(2,916 Views)

Thank you

 

I'm new with labview. What does the variant do exactly? Because I'm trying to replicate the vi you showed except that it has to permanently save the added translations even if the panel is stopped or closed.

0 Kudos
Message 7 of 22
(2,911 Views)

Oh... that won't happen with the VI I gave you.

 

But you could add some code at the end to save all the attributes into a file and at the next start load the attributes from the file.

I'm home now so I can do it... but you could have a go, it's not that hard, and come back here if you have specific questions.

 

Good luck!


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 8 of 22
(2,901 Views)

Why is this message thread in the Feedback forum?  It isn't a conversation about the operation of the forums.

 

It should be moved to the LabVIEW forum.

0 Kudos
Message 9 of 22
(2,898 Views)

@Ravens Fan wrote:

Why is this message thread in the Feedback forum?  It isn't a conversation about the operation of the forums.

 

It should be moved to the LabVIEW forum.


i've asked the moderator to move it to the lbview section already 😉


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 10 of 22
(2,892 Views)