LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading XML node values from configuration files

Hi,

 

I've got an inherited piece of software that generates an XML file that I cannot change the parameters of, that will sometimes contain a single waveform or occasionally a multipulse waveform (Pulse 0 or Pulse 0 AND Pulse 1).

 

I am using the XML as a template, and I can open it, edit the node values for Pulse 0 fine. I have added in code to list the nodes and determine if Pulse 1 is present, which works fine. However, the pulses have the same node names e.g. Pulse 0 and Pulse 1 both have a node called 'DelayTime', so when my code executes, it updates Pulse 0 correctly, finds Pulse 1 is present and then overwrites the values for Pulse 1 into Pulse 0.

 

Any advice/guidance would be appreciated. XMLs are attached in the zip. 


Thank you.

 

 

Download All
0 Kudos
Message 1 of 2
(2,056 Views)

Your code just verify if there is a Pulse node with a name attribute equal to Pulse 1 and update the fist Pulse node if one is found. You should explicitly search for a Pulse node with the Name attribute Pulse 1 using the following xpath expression:

  /Waveform/PulseManager/Pulse[@Name='Pulse 1']

 … and you could do the same thing for Pulse 0.

 

Ben64

Message 2 of 2
(2,028 Views)