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 Sun Aug 18, 2019 11:50 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Mar 12, 2014 6:59 am 
Offline

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

How can I call a testscript with python? I can open a testscript-xml with python but it doesn't run.


Regards,
Malcolm


Top
   
PostPosted: Wed Mar 12, 2014 10:36 am 
Offline
Frequent User
Frequent User

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

I'm not sure what you want to accomplish. If it is related to your previous post about a continuous loop inside a test script please give a short description what you want to test.

The following combinations of scripting and Test Manager are possible:
    - Test script which executes Python code with the command ExecuteScript from TestManager.Scripting
    - Execute a Python script which starts a CODESYS instance with the required parameters for executing a test script
    - Execute the (menu) command "Execute Test Script" inside a Python script; requires access to the API of the Automation Platform

I would take the first one and convert the test steps, which should run in a loop, to Python code with the loop around it.

Rough example for a test script:
    - Prepare
      - Load project
      - Update device
      - Set communication path
      - Login to active application
    - Test
      - ...
      - Execute script which contains the loop
      - ...
    - Clean up
      - Logout
      - Close project

Regards,
Martin

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

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


Top
   
PostPosted: Wed Mar 12, 2014 10:51 am 
Offline

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

thanks for your answer. Yes, it is related to my previous post. I want to test e.g. set/clear I/Os.

I have a test script which executes Python code with the command ExecuteScript from TestManager.Scripting. My Problem is how to execute in Python the test script which contains the I/O-Actions.

Regards,
Malcolm


Top
   
PostPosted: Wed Mar 12, 2014 11:22 am 
Offline
Frequent User
Frequent User

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

Malcolm wrote:
My Problem is how to execute in Python the test script which contains the I/O-Actions.

You shouldn't execute a test script from the Python code of another test script. The normal use case would be to use Call or RemoteCall to execute the other test script and the test report of the other one is integrated in the original one. But you need a loop which is not implemented yet.

Are you using the commands from TestManager.Monitoring in that test script? If yes, than you could do the same by using the scripting interface. See read_value(), set_prepared_value(), write_prepared_values() and other methods of the IScriptOnlineApplication.

Regards,
Martin

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

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


Top
   
PostPosted: Wed Mar 12, 2014 12:14 pm 
Offline

Joined: Mon Mar 10, 2014 3:08 pm
Posts: 23
Where can I find a list of all IScriptOnlineApplication methods?

Regards,
Malcolm


Top
   
PostPosted: Wed Mar 12, 2014 12:35 pm 
Offline
Frequent User
Frequent User

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

The documentation is in the file "ScriptEngine.chm" in the sub directory "Online Help" of CODESYS. It's not linked to the online help which you can reach directly from CODESYS.

The scripting interface is in the book "_3S.CoDeSys.ScriptEngine.BasicFunctionality Namespace".

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  [ 6 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