Event Execution

Discussion about recent product features & solutions!
Search

Post Reply
11 posts • Page 1 of 2
User avatar
eMTy
Posts: 22
Joined: Wed Aug 17, 2011 3:33 pm

Event Execution

Post by eMTy »

Hi guys,

is there a possibility to trigger an event of a shape by script?

kr
Michel

User avatar
eMTy
Posts: 22
Joined: Wed Aug 17, 2011 3:33 pm

Re: Event Execution

Post by eMTy »

And is there a possiblity to read the current dollar values of another panel?

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: Event Execution

Post by leoknipp »

Hello,

it is not possible to call a event of a shape from another script.
The QT events are only called when the user is interacting with the UI.

With the functions for the CTRL-debugger you can see the current value for $-parameters which are used at a panel.
For details please have a look at the online-help: CONTROL --> CTRL Debugger

Best Regards
Leopold Knipp
Senior Support Specialist

eMichx
Posts: 64
Joined: Thu Apr 24, 2014 11:24 am

Re: Event Execution

Post by eMichx »

Hello,

It's not possible to send event, would be possible to use the function mouse_event from the library user32.dll,
using userDefFunction like :
for example to move the cursor

userDefFunction("user32.dll","mouse_event",makeDynInt(0x01,x,y,0,0),makeDynInt());

or

#uses "user32.dll"
...
mouse_event(0x01,x,y,0,0);
...

I have ever tried, but nothing is working
- with #uses library is not correctly loaded!
- with userDefFunction, no error, but nothing happened!!


regards
Emmanuel

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Event Execution

Post by Gertjan van Schijndel »

@Emmanuel, with these methods it is only possible to use specially for WinCC OA created libraries (dll's).
To use the functions of a foreign library a control extension has to be created. With the library 'libffi' it would be possible to create a dynamic interface to foreign libraries.

User avatar
mpoint
Posts: 49
Joined: Thu Oct 28, 2010 11:28 am

Re: Event Execution

Post by mpoint »

To use the functions of a foreign library a control extension has to be created. With the library 'libffi' it would be possible to create a dynamic interface to foreign libraries.
Incidentally, I wrote such a Ctrl Extension some time ago, and it's available on github: https://github.com/mooware/CtrlFFI. It's lacking in documentation, and there are currently no prebuilt binaries, but that could be improved if someone is interested.

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Event Execution

Post by Gertjan van Schijndel »

@Markus, did you also manage to compile it under windows?

User avatar
mpoint
Posts: 49
Joined: Thu Oct 28, 2010 11:28 am

Re: Event Execution

Post by mpoint »

Yes, it works on Windows and Linux, 32 and 64 Bit. libffi is a bit difficult to build on Windows; I think I had to make a few adjustments in their build.

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Event Execution

Post by Gertjan van Schijndel »

@Markus, at GitHub I only see a makefile for linux. How did you built it on windows?

User avatar
mpoint
Posts: 49
Joined: Thu Oct 28, 2010 11:28 am

Re: Event Execution

Post by mpoint »

Sorry, the Makefile probably doesn't even work on Linux, seeing as libffi isn't in it. The code is already a few years old, not sure how I built it then. Probably GNU Make on Windows as well. I'll try to get prebuilt binaries and a build system up sometime in the next few days.

Post Reply
11 posts • Page 1 of 2