JKI Discussion Forums
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Trouble loading XML, no errors given

#1
User is offline   pandersen 

  • Group: Members
  • Posts: 3
  • Joined: 22-July 09
I'm currently evaluating EasyXML and tried to load in this XML:

<groups>
	<group>
		<trigger>bTrigger</trigger>
		<handshake>bResult</handshake>
		<items>
			<item>
				<dbcolumn>partID</dbcolumn>
				<tag>sPartID</tag>
				<type>STRING</type>
			</item>
			<item>
				<dbcolumn>partStatus</dbcolumn>
				<tag>dPartStatus</tag>
				<type>DINT</type>
			</item>
		</items>
	</group>
	<group>
		<trigger>bTrigger2</trigger>
		<handshake>bResult2</handshake>
		<items>
			<item>
				<dbcolumn>partID2</dbcolumn>
				<tag>sPartID2</tag>
				<type>STRING</type>
			</item>
			<item>
				<dbcolumn>partStatus2</dbcolumn>
				<tag>dPartStatus2</tag>
				<type>DINT</type>
			</item>
		</items>
	</group>
	<group>
		<trigger>bTrigger3</trigger>
		<handshake>bResult3</handshake>
		<items>
			<item>
				<dbcolumn>partID3</dbcolumn>
				<tag>sPartID3</tag>
				<type>STRING</type>
			</item>
			<item>
				<dbcolumn>partStatus3</dbcolumn>
				<tag>dPartStatus3</tag>
				<type>DINT</type>
			</item>
		</items>
	</group>
</groups>


My cluster looks like this: Posted Image
My LabView code looks like this (the Groups Path part on top is what to follow): Posted Image

I believe I created the cluster correctly. It was a little confusing to set up, with an array inside a cluster inside an array inside a cluster. Did I do something incorrectly? After loading the XML the Config cluster is populated, but the Groups cluster is empty. I even unbundled and indexed the items and arrays inside the cluster to get individual elements, which verified that there is no data present. I do not get any error messages.

EDIT: Sorry, I picked an incorrect screenshot. There should be wires going from the Error Out terminal on your EasyXML block to the Error In terminal on the variant to cluster block. Result is the same with those wires, though.

This post has been edited by pandersen: 22 July 2009 - 10:13 PM

0 kudos

#2
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06
Hi,

I think you're almost there!

What I see is that you probably need to rename your "items" array as "item" and then put that "item" array inside a cluster called "items". Note that you structured the "groups" cluster and "group" array correctly.

Please let me know if that helps.

Thanks,

-Jim
0 kudos

#3
User is offline   pandersen 

  • Group: Members
  • Posts: 3
  • Joined: 22-July 09
I attempted what you suggested, but what I did still would not work. After playing around some more, I restructured my XML a bit and made the cluster match, and it works great!
New XML:
<groups>
	<group>
		<trigger>Program:Station_01.SQL_bTrigger</trigger>
		<handshake>Program:Station_01.SQL_bHandshake</handshake>
		<item>
			<dbcolumn>partID</dbcolumn>
			<tag>Program:Station_01._my_shift_register.PartID</tag>
			<type>STRING</type>
		</item>
		<item>
			<dbcolumn>partStatus</dbcolumn>
			<tag>Program:Station_01._my_shift_register.PartStatus</tag>
			<type>DINT</type>
		</item>
	</group>
	<group>
		<trigger>Program:Station_02.SQL_bTrigger</trigger>
		<handshake>Program:Station_02.SQL_bHandshake</handshake>
		<item>
			<dbcolumn>partID</dbcolumn>
			<tag>Program:Station_02._my_shift_register.PartID</tag>
			<type>STRING</type>
		</item>
		<item>
			<dbcolumn>partStatus</dbcolumn>
			<tag>Program:Station_02._my_shift_register.PartStatus</tag>
			<type>DINT</type>
		</item>
	</group>
</groups>


New cluster:Posted Image

Thanks for your help, EasyXML is a great tool! If this project continues to fruition we will definitely be buying.
0 kudos

#4
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06
I'm glad you got it working and thanks for the kind words. Also, if you attach your VI, I can help you get it working with the XML structure in your first example -- I'm very curious why it wasn't working.

We're looking forward to having you as a customer. Good luck with your project.

-Jim
0 kudos

#5
User is offline   pandersen 

  • Group: Members
  • Posts: 3
  • Joined: 22-July 09
I re-created what I had originally to attach it. Lo and behold, it worked fine. I suspect that after your first suggestion I didn't fix up the cluster properly. To be honest this is my 4th day using LabView, self-teaching myself, so I wouldn't be surprised if I didn't do it correctly.

I think I will stick to my newer XML structure anyway, it is a little simpler to handle in code after it is in the cluster. Thanks for the help!
0 kudos

#6
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06

View Postpandersen, on Jul 24 2009, 07:15 AM, said:

I re-created what I had originally to attach it. Lo and behold, it worked fine. I suspect that after your first suggestion I didn't fix up the cluster properly. To be honest this is my 4th day using LabView, self-teaching myself, so I wouldn't be surprised if I didn't do it correctly.

I think I will stick to my newer XML structure anyway, it is a little simpler to handle in code after it is in the cluster. Thanks for the help!


You're welcome. I'm glad you've got it working. Let me know if you need any more help.

BTW, You're doing amazingly well for only 4 days! :D

Thanks,
0 kudos

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic