LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not able to print all the values from the XML file

Hi,

 

I am able to parse XML successfully but not able to print all the values which i want.....I have attached the VI, XML file...pls let me know the solutions.

 

I am able to print contents under group 1 i.e. G1 But fails to print G2, G3, G4 contents...please let me know what is wrong in my VI file

 

Ex:

 

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <MonitorSession Version="2.4.0" ActiveScreen="Screen 0">
    <Dotnetbarlayouts>&lt;dotnetbarlayout version="6" zorder="3,4,0,2"&gt;&lt;docksite size="0" dockingside="Top" /&gt;&lt;docksite size="0" dockingside="Bottom" /&gt;&lt;documents&gt;&lt;dockcontainer orientation="0" w="0" h="0"&gt;&lt;barcontainer w="1012" h="360"&gt;&lt;bar name="Screen 0" dockline="0" layout="2" dockoffset="0" state="2" dockside="5" visible="true" seldocktab="0"&gt;&lt;items&gt;&lt;item name="Screen 0" origBar="" origPos="-1" pos="0" /&gt;&lt;item name="Screen 2" origBar="" origPos="-1" pos="1" /&gt;&lt;/items&gt;&lt;/bar&gt;&lt;/barcontainer&gt;&lt;/dockcontainer&gt;&lt;/documents&gt;&lt;docksite size="0" dockingside="Right" /&gt;&lt;documents&gt;&lt;dockcontainer orientation="0" w="0" h="0"&gt;&lt;barcontainer w="1012" h="360"&gt;&lt;bar name="Screen 0" dockline="0" layout="2" dockoffset="0" state="2" dockside="5" visible="true" seldocktab="0"&gt;&lt;items&gt;&lt;item name="Screen 0" origBar="" origPos="-1" pos="0" /&gt;&lt;item name="Screen 2" origBar="" origPos="-1" pos="1" /&gt;&lt;/items&gt;&lt;/bar&gt;&lt;/barcontainer&gt;&lt;/dockcontainer&gt;&lt;/documents&gt;&lt;bars /&gt;&lt;/dotnetbarlayout&gt;</Dotnetbarlayouts>
    <Screen Name="Screen 0" DataRefreshRate="250" BAMRefreshRate="25" UIRefreshRate="200" EDMRefreshRate="20" DataRefreshUnits="Milliseconds" UIRefreshUnits="Milliseconds" MonitorType="RequestReceive" BAMTrigger="Clock" IDLTrigger="Clock" Radix="Decimal" ScreenType="Normal" Status="Active" LogMode="Any Data" LogRate="1" LogUnit="ms" LogPrefix="Screen 0" PCTimestamp="false" ActiveFaults="false" InactiveFaults="false" StartCondition="" StopCondition="" PreTrigger="5" PostTrigger="60" RepeatCount="0" Dock="Document">
      <Group Name="Group" Comment="Comment" ShowUnits="true" ShowSourceAddress="true" ColumnWidths="Addr=54,Name=231,Value=75,Unit=46,Comment=46"> --> G1
        <Parameter>
          <SourceAddress>00</SourceAddress>
          <Name>ECM_Run_Time</Name>
          <Units>s</Units>
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
        <Parameter>
          <SourceAddress>00</SourceAddress>
          <Name>Net_Brake_Torque</Name>
          <Units>N_m</Units>
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
      </Group>
      <Group Name="Group" Comment="Comment" ShowUnits="true" ShowSourceAddress="true" ColumnWidths="Addr=54,Name=200,Value=230,Unit=46,Comment=46">  --> G2
        <Parameter>
          <SourceAddress>00</SourceAddress>
          <Name>Engine_Run_Time</Name>
          <Units>s</Units>
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
        <Parameter>
          <SourceAddress>0</SourceAddress>
          <Name />
          <Units />
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
      </Group>
    </Screen>
    <Screen Name="Screen 2" DataRefreshRate="250" BAMRefreshRate="25" UIRefreshRate="200" EDMRefreshRate="20" DataRefreshUnits="Milliseconds" UIRefreshUnits="Milliseconds" MonitorType="RequestReceive" BAMTrigger="Clock" IDLTrigger="Clock" Radix="Decimal" ScreenType="Normal" Status="Active" LogMode="Any Data" LogRate="1" LogUnit="ms" LogPrefix="Screen 2_0" PCTimestamp="false" ActiveFaults="false" InactiveFaults="false" StartCondition="" StopCondition="" PreTrigger="5" PostTrigger="60" RepeatCount="0" Dock="Document">
      <Group Name="Group" Comment="Comment" ShowUnits="true" ShowSourceAddress="true" ColumnWidths="Addr=54,Name=200,Value=75,Unit=46,Comment=46">  - G3
        <Parameter>
          <SourceAddress>0</SourceAddress>
          <Name />
          <Units />
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
          <Parameter>
          <SourceAddress>0</SourceAddress>
          <Name />
          <Units />
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
      </Group>
      <Group Name="Group" Comment="Comment" ShowUnits="true" ShowSourceAddress="true" ColumnWidths="Addr=54,Name=200,Value=75,Unit=46,Comment=46"> - G4
        <Parameter>
          <SourceAddress>0</SourceAddress>
          <Name />
          <Units />
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
        <Parameter>
          <SourceAddress>0</SourceAddress>
          <Name />
          <Units />
          <ViewType>Normal</ViewType>
          <IsBroadcast>false</IsBroadcast>
        </Parameter>
      </Group>
    </Screen>
  </MonitorSession>
</NewDataSet>

 

0 Kudos
Message 1 of 4
(2,273 Views)

Mandya,

 

Have you been able to narrow down at all where the problem occurs (using highlight execution to try and figure out where things are going wrong for example)?  Are there any errors that occur or does your program simply not perform as expected?

James K.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(2,249 Views)

Hi,

 

it took me some time to understand what the code should do.

 

First of all please let me say, that wiring trough the error cluster is immanent for debugging. One problem I see is that the refnum from the document element is zero, so that all other calls for childs are failing. You will only notice this by debugging or execution highlighting (see James hint). You will also see a hint for a problem in this region of the code when you look at your indicator loadXml. This once was always False.

 

I have changed two things:

LoadXml.vi -> Read from Text File instead of binary

Main.vi -> Using the read text for input of the LoadXml invoke method and not the pretty printed one.

 

Now LoadXml performs the action and your 2D array is filling in some stuff. My advice would be to carefully debug your code and look, where references get lost and where errors occur.

 

Good Luck

Tyler

Certified LabVIEW Architect
0 Kudos
Message 3 of 4
(2,234 Views)

Let me know how to delete paricular node

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