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 Sat Dec 15, 2018 2:47 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Nov 13, 2018 1:08 pm 
Offline

Joined: Thu Oct 04, 2018 10:20 am
Posts: 6
Hello,

I want to do following things:

// interface
itf_base : I_Base;

// FBs
FB_A implements I_Base;
FB_B implements I_Base;

// create
IF A THEN
itf_base := __NEW(FB_A);
ELSE
itf_base := __NEW(FB_B);
END_IF


The problem is __NEW operator returns a pointer not an interface reference.

There is an operator to convert interface to pointer "__QUERYPOINTER".

Is there a way to do the reverse conversion?

Best
Kai


Top
   
PostPosted: Wed Nov 14, 2018 9:35 am 
Offline

Joined: Thu Oct 04, 2018 10:20 am
Posts: 6
Figured it out myself,

just need to dereference the pointer ...


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