Problems creating xml files
MorgoZ
Posts: 116
Hello forum! I?m new here,
my problem is that i?m trying to create a new XML file from a simple structure, and everything goes ok until i try to open the new file in which i?m going to save the xml.
I?ve tried it with a full path and directly with the name of the file, but in no case a new file is created nowhere
slFile = FILE_OPEN('C:/pruebaxml.xml', FILE_RW_NEW)
slFile = FILE_OPEN('pruebaxml.xml', FILE_RW_NEW)
And i?ve also tried to save the document in an already created .xml file
But in all cases the result is the same: slFile = 0
And i don?t know what is the meaning of 0, what am i doing wrong?
Thanks for your help!!
Salutes.
my problem is that i?m trying to create a new XML file from a simple structure, and everything goes ok until i try to open the new file in which i?m going to save the xml.
I?ve tried it with a full path and directly with the name of the file, but in no case a new file is created nowhere
slFile = FILE_OPEN('C:/pruebaxml.xml', FILE_RW_NEW)
slFile = FILE_OPEN('pruebaxml.xml', FILE_RW_NEW)
And i?ve also tried to save the document in an already created .xml file
But in all cases the result is the same: slFile = 0
And i don?t know what is the meaning of 0, what am i doing wrong?
Thanks for your help!!
Salutes.
0
Comments
If you highlight the keyword FILE_OPEN in NS and hit the F1 key, you'll be taken to the help file. From there you can get a lot of useful informatino about what each keyword does and how to use it.
for example, you question of the result is answered by this from the help file:
Hope that helps
e
slFile = FILE_OPEN('\pruebaxml.xml', FILE_RW_NEW)
Jeff
ericmedley, at the help there is no mention about a 0 result.
But i think that i see what could be my problem.... i?m trying to save the XML in an external path....
so now my question would be where does NetLinx saves the XML files created? And how could i see them?
And, if i need to load a XML file or to save it in an external PC, is there any way to do so, knowing the IP and the path of the remote computer?
I mean for example: slFile = FILE_OPEN('\\192.168.1.2\sharedFolder\pruebaXml.xml', FILE_RW_NEW)
Many thanks for your help!!!!
and what is the username/password to access to the ftp? I?ve search it at my NI-400 PI but i didn?t find it.
and about saving the files from the master to an external device (PC) ????
Thanks again!!
That was set by whomever set up the security on the box. If you're not the original programmer, then who knows?
As for moving the file, you can either write your own FTP client in code and send it from the master to the server, or kinda reverse the process and pull the file to the Netlinx master to the PC by making the PC the client.
FTP protocol is not to difficult. I've written a routine to do as you describe before.
I actually think it would be easier to do from the PC side, however.
The default is administrator/password. I'm not so sure you can write to an external drive; there are no provisions I am aware of to mount it, and you are going to need some kind of transport layer.
i don?t know who set up the security, not me, and the master has one week since i took it out of the box, so it should be the default "administrator/password", thanks DHawthorne.
For moving the xml file i`ve found the "?!FTPSender", i haven?t test it already, but i think that it could work.
Thanks to all!