Ive figured out how to insert a "box" on to a CFC type POU, but after setting it to lets say "TON" I was expecting to see the pins appear.
How do I reset teh box to show the pins? (I use the term reset, as its on the menu when I right click on the box).
I am trying to write a component that allows logic to be written straight to a POU, and I have not foound any documentation on how to do this, so I am making random guesses at the moment.
I am using the following to add the box on the CFC POU
private _3S.CoDeSys.CFCObject.ICFCElement add_cfc_box(_3S.CoDeSys.CFCObject.ICFCImplementationObject2 impl, _3S.CoDeSys.CFCObject.KindOfCall type, string name, string instance, System.Drawing.Rectangle bound)
_3S.CoDeSys.CFCObject.ICFCItem4 item = ComponentManager.Singleton.CreateInstance(objects_ids.GUID_CFCBOXELEMENT) as _3S.CoDeSys.CFCObject.ICFCItem4;
_3S.CoDeSys.CFCObject.ICFCElement2 elem = item as _3S.CoDeSys.CFCObject.ICFCElement2;
elem.KindOfCall = type;
_3S.CoDeSys.CFCObject.ICFCText Name = ComponentManager.Singleton.CreateInstance(objects_ids.GUID_CFCTEXT) as _3S.CoDeSys.CFCObject.ICFCText;
Name.Text = name;
_3S.CoDeSys.CFCObject.ICFCText Instance = ComponentManager.Singleton.CreateInstance(objects_ids.GUID_CFCTEXT) as _3S.CoDeSys.CFCObject.ICFCText;
Instance.Text = instance;
item.Bounds = bound;
I'm just guessing, but maybe you haven't added the standard library to your project yet.
Then the compiler doesn't know about TON yet and doesn't know which inputs / outputs it has.
The library is already part of the project. I can add by hand in the editor.
Also, the box I insert, if I double click on it,it correctly shows me information about it being a Timer, so I know the compiler understands what the block is used for.
Log in to post a comment.