01-05-2012 04:16 PM
Hi!
I have been working on controlling a motor using a .VI created from NI Motion Assistant (not attached). The .VI was created a couple of years before I took on the project, so I do not know how they generated their XML files. The first attachment below (Contour1.txt) currently works with the .VI. However, I have tried everything that I can think of to replicate or edit the VI, but I have not been able to figure out a way to do so.
I created a simple .VI (XML_VI_Version4.xml) to output an XML file (XMLTest_2a.txt) with one column of sinusodal data. However, the formatting of this XML does not match the formatting of the XML file that will work with the old Motion Assistant VI.
Does anyone have any advice on how I can edit my VI? Or is there another easier way that I can generate the XML file formatted in the correct way?
Also, I converted the XML files to txt files in order to upload them to this post...
Thanks 🙂
01-05-2012 04:39 PM
Looking at the xml namespace it looks like it was created using Motion Assistant. The second one is created using the LabVIEW flatten to xml function. As you can see it is a schema that is very inefficient. Look for a write to xml function in Motion Assistant.
01-05-2012 06:00 PM
I modified your VI to use the LabVIEW XML functions. As you can see it is a complete pain. This should work unless your device/vi needs the namespace declaration thing.
01-06-2012 10:51 AM
You might prefer the brute force method of generating XML. Also attached in LV8.2.
01-06-2012 02:15 PM
Hi Steve!
I couldn't get the first VI you sent me to work since it says that the VI is not in the appropriate state for the invoke node. I do not know very much about invoke nodes so I did not know how to go about fixing that problem. Do you know if there are any manuals or reference guides that are helpful to learn more about this/XML?
Also, your second solution works great so far! I am currently in the process of testing the generated XML files with my VI to control the motor.
Thanks for all of your help! I appreciate it 🙂
01-06-2012 03:08 PM
It works for me. It might be because you are using an earlier version of LabVIEW. The only place I know to get information on the LabVIEW XML functions is from the example finder. As you can see it is a real pain. You have to remember to close everything especially when you create a lot of nodes inside of a loop. The "brute force" method is probably fine for what you are doing but if you ever want to read and parse XML with LabVIEW then the XML functions are going to be much easier. As for XML itself this is a good reference.
I see you are new to the forums. A couple of things you might not be aware of. Make sure to mark the post that solved your problem as accepted solution under options (blue dropdown in the upper right of the reply) after testing your motor if that fixes it. That way others who may wish to help will see that it is already solved and may choose to skip reading the thread. Also sometimes people will look for solved posts so they can try to offer an even better solution At any time you can unmark the accepted solution and mark a different one. Finally there might be people with similar problems in the future and marking a reply as accepted solution will help them find it. Also kudos are always appreciated by everyone on the forums. Those are our only form of payment
I feel awkward mentioning that because I don't want to seem like I am asking for kudos but I want to make sure you are aware of them.
Good luck with your motor.