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 Fri Aug 23, 2019 9:47 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Dec 19, 2013 6:58 pm 
Offline

Joined: Thu Sep 12, 2013 9:54 am
Posts: 12
Hi there,

I have a question,

1. How to write a value into a input Function Block(e,g CHxInput) via Test Manager.scripting -> ExecuteScript using Python command?

Many Thanks.


Top
   
PostPosted: Thu Jan 02, 2014 4:13 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 254
Hi.

To write one or more values through the monitoring you need to get the online application, set/prepare the values and write them through the online application.

The following example prepares one value and writes it to the device:
Code:
onlineApp = online.create_online_application()
onlineApp.set_prepared_value("PLC_PRG.counter", "5")
onlineApp.write_prepared_values()

If you want all the prepared values to be forced you have to use the method force_prepared_values().

For more details you should have a look at the ScriptEngine online help which you can find in the directory "CODESYS\Online Help" of the CODESYS installation directory.

Regards,
Martin

_________________
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  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


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