Migrating ActiveX Control Functionality to Ignition

Hi,

I'm facing a challenge with transferring functionality from an ActiveX control used in my current SCADA system (Intouch) to a new version of Ignition, which no longer supports ActiveX. The existing system relies on an ActiveX control to interact with a device (a laser), but now I need to find an alternative solution within Ignition.

For context, here's an example of the ActiveX control code used in Intouch:


#SynMhAtxCtrl1.DeleteObject ("Text1");
#SynMhAtxCtrl1.Redraw();

#SynMhAtxCtrl1.AddText ("Text1",LaserXPos_ANA,LaserYPos_ANA, LaserTekst1_STR);

#SynMhAtxCtrl1.Redraw();
    
#SynMhAtxCtrl1.SelectObject("Text1");

#SynMhAtxCtrl1.MoveSelectionTo(LaserXPos_ANA, LaserYPos_ANA);

#SynMhAtxCtrl1.Redraw();

I don't need a graphical interface; I just want to extract the functionality, such as the SynMhAtxCtrl1.AddText() method, to control the laser device. The device communicates using optical fiber, and unfortunately, it doesn’t support other communication protocols like Modbus.

The ActiveX control is provided by Synrad WinMark, and it uses an .ocx file for communication. I’m unsure if it’s possible to invoke functions directly from the .ocx file within Ignition. However, I discovered sample code written in C++ by WinMark that closely resembles the ActiveX functions I’m using. Here's an example of what that looks like:

long CSynMhAtx::AddText(LPCTSTR strObject, float x1, float y1, LPCTSTR strText)
{
	long result;
	static BYTE parms[] =
		VTS_BSTR VTS_R4 VTS_R4 VTS_BSTR;
	InvokeHelper(0xc, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
		strObject, x1, y1, strText);
	return result;
}

What I'm looking to do is leverage the .ocx file within Ignition, allowing me to call these functions in a script to control the laser device. Has anyone faced a similar situation or have any advice on how to proceed with calling functions from an .ocx file in Ignition?

What you are asking is essentially for DLL embedding within Ignition, as .ocx is a native code container for windows only. You may succeed if you create a JNI wrapper around it and load it via a 3rd-party module.

What you are asking is exceedingly non-trivial, and not certain to succeed. You should ask the laser vendor what other technologies they might support.