LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table with xml data

 

Hello!

I have a XML file with some pulses and cicles informations. I need to cread a 2D graphic with it.

My program:

biaverly_1-1602159277232.png

biaverly_2-1602159302727.png

 

Problems:

1 - Can I just get the cluster I want? I needed to create 3 cluster to see the cluster I want.

2 - I want to creat a 2D graphic (pulses x cicle) but I can't remove " ; " from val.

Is there an easy to creat this graphic ?

 

 

 

XML FILE:

biaverly_0-1602159104121.png

 

 

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

Hi biaverly,

 


@biaverly wrote:

1 - Can I just get the cluster I want? I needed to create 3 cluster to see the cluster I want.

2 - I want to creat a 2D graphic (pulses x cicle) but I can't remove " ; " from val.

Is there an easy to creat this graphic ?


1. When parsing a XML file you need to provide the exact same data structure as is use din the file, so your approach using this big cluster containing sub-clusters is right. You can easily Unbundle after the parsing…

 

2. Convert the "Val" text into numeric data, maybe using SpreadsheetStringToArray. Then get the data columns you need and build a XY plot for a XY graph…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,417 Views)

Tu get the cluster you want directly you need to use the LabVIEW parser with an XPath expression (I recommend you look at some tutorials on the net it is not intuitive). You next have to remove the first line (I use a regular expression for that but there are different ways to do it). Then as GerdW suggested use the Spreadsheet String to Array to get the data and convert it to numeric.

 

You will have to change the XPath expression to get different data.

 

Parse XML.png

 

Ben64

Message 3 of 4
(1,386 Views)

I think it would have been better to carry on in this thread : https://forums.ni.com/t5/LabVIEW/Easy-XML-Labview/m-p/4089018

or at least to mention it for reference.


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

Epictetus

Antoine Chalons

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