LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put in column string

Hello,

I have a file like this :

 

G0 Z   0.000 
G1 Z   0.000
G1 X4082.009 Y5013.133
G1 X7505.601 Y5013.133
G1 X7505.601 Y3783.510
G1 X4981.293 Y3783.510
G1 X4981.293 Y1245.442
G1 X7521.378 Y1245.442
G1 X7521.378 Y   0.000
G1 X4082.009 Y   0.000
G1 Z   0.000
G0 Z   0.000 
M9 M5

It's a gcode file, I would like to put each axis on a different column. For this example it will be like this :

 

For X

 

4082.009 
7505.601 
7505.601 
4981.293 
4981.293
7521.378 
7521.378 
4082.009 

For Y

 

Y5013.133
5013.133 3783.510 G3783.510 1245.442 1245.442 0.000 0.000

For Z

0.000 
0.000
0.000
0.000 

I tried to do like I made on my VI but this is not what I want.

 

Can you help me ? Thanks

0 Kudos
Message 1 of 6
(3,573 Views)

You used the wrong delimiter, and Scan From String is your friend.

 Text to StringArray.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(3,535 Views)

Thanks for your help, but what do you use for the "status" box ?

0 Kudos
Message 3 of 6
(3,512 Views)

That is an Unbundle by Name.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 4 of 6
(3,509 Views)

Look at Scan from String (drop it on your own Block Diagram, right-click and choose "Help" to learn about its inputs and outputs).  Notice the Error Line?  That is a Cluster that contains three parts -- Status (True if an error), Code (the Error Number), and Source (a string describing where the error occurred).  The code is designed to "do something when Scan From String does not return an error".

 

However, about 5 years ago (I'm guessing), NI "enhanced" the Boolean Controls to allow them to accept an Error Cluster as an input and treat it as though it was just the Error Status.  Thus you can do the following:

Not an Error.png

Just take the Error Line, wire it directly to a Boolean "Not", and you get (directly) the Boolean "Not an Error".

 

Bob Schor

0 Kudos
Message 5 of 6
(3,472 Views)

It's almost November, but you don't need to be an American citizen to vote for this - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Conditional-indexing-should-accept-Error-Cluster/idi-p...

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 6
(3,454 Views)