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 Mon Sep 23, 2019 2:13 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 

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.

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

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

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:
onlineApp = online.create_online_application()
onlineApp.set_prepared_value("PLC_PRG.counter", "5")

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.


Check out the CODESYS store:

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

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 3 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