LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i count different characters from a text.

Use typecast on the U8 number to get the character as a string.

0 Kudos
Message 11 of 30
(2,114 Views)

I would use To Upper to make all of the letters an uppercase and then subtract 64 from the U8 equivalent (capital A = 65 in the ASCII table).  That will give you the index of the element that needs incremented.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 30
(2,113 Views)

@Jenson94 wrote:

Oke thanks, now i got everyting in the different classes but how do i cast it back an select those from the right array?


Here's one possibility. To put things in a graph should be trivial (except for labeling the x axis markers). 😄

 

 

Download All
0 Kudos
Message 13 of 30
(2,088 Views)

You can make it a little simpler by removing the case structure.  If you try to access/set an idex outside of the array, the array doesn't change.

 

Spoiler
It is very rare that anybody can make Christian's code any simpler.  I have to jump on this whenver I can.

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 14 of 30
(2,069 Views)

Another approach is to use variant attributes.

 

Count Letters in Text using Variant Attributes.png

 

Ben64

Message 15 of 30
(2,059 Views)

Hello,

 

I have to say i'm inpressed with your nowhow on labview! But how do convert a string to a graph? Do i first have to make an array of the string or something like that?

 

I'm learning so much from this, thank you guys!

0 Kudos
Message 16 of 30
(2,026 Views)

The array coming our of the first loop is all you need to send to a waveform graph. Select a graph style that looks like a histogram. It will look like the picture attached to your first post.

 

The x-axis is as follows 0=a, 1=b, 25=z etc. as I said, to get the actual characters on there requires a bit more work. 😉 To have the axis go from 1..26 instead, change x0 to 1 in the graph properties. (See attached quick example)

 

 

 

Download All
Message 17 of 30
(2,024 Views)

Thanks guys, I really appreciate you are helping me!

 

Can somebody explain the block diagram from the last post? I'm understanding it for about 85% but stil not 100% shure on how it works?

 

 

0 Kudos
Message 18 of 30
(1,991 Views)

@Jenson94 wrote:

I'm understanding it for about 85% but stil not 100% shure on how it works? 


Which 15% of the diagram puzzles you??

0 Kudos
Message 19 of 30
(1,983 Views)

The part of the in place element structure!

0 Kudos
Message 20 of 30
(1,968 Views)