CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Wed Sep 18, 2019 9:10 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Apr 07, 2014 8:22 am 
Offline

Joined: Mon Mar 10, 2014 3:08 pm
Posts: 23
Hi,

how can I read a XML file and write the value in a codesys-variable?


Regards,
Malcolm


Top
   
PostPosted: Tue Apr 08, 2014 8:44 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
Hi, Malcolm,

Could you be a little bit more specific what you want to do?

Regarding the "source":
Do you want to write the whole XML file into a String variable, or do you want to parse some specific value out of an XML file and write it to the codesys variable?

Regarding the "destination":
Do you want to write the value as initialization value in the declaration of the varible, or do you want to generate IEC code which writes that value at run-time, or do you want to write the value into a running application via CODESYS Monitoring, or do you want to write the value into a running application using OPC?

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Thu Jul 03, 2014 10:02 pm 
Offline
User avatar

Joined: Fri Jul 05, 2013 9:54 am
Posts: 60
I'm interested too, I think malcom means to open an xml file and parse some tag with its relaed attribute/value and transfer both into codesys strings or value.


Top
   
PostPosted: Fri Jul 04, 2014 9:15 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
Hi, hki75,

For parsing the XML tags, you should be able to use any .NET XML parser, or with recent CODESYS versions, also the python standard library XML parser. (In older versions, you can manuall patch the missing files in the IronPython standard library directory.)

To write the value into IEC Source, curently, you only can use the PLCOpenXML format.

To write the value into a running CODESYS application, you can use the monitoring interface provided for python, or any OPC client library.

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited