Page 1 of 1

How do I call an OCX

Posted: Sun Jan 30, 2011 10:52 pm
by mhoneywill
Hi,

I'm very new to LiveCode so please excuse the silly question, I would like to call functions in an ocx. Specifically modbus_activex from www :mrgreen: modbustools :mrgreen: com this would give me modbus functionality in windows.

Could somebody explain if this is possible. I've got a feeling that you could use the CreateObject command but I can't find any information on how to use this.

In the long run I would like to implement the Modbus code in Livecode to allow serial and Ethernet access to be crossplatform. But if I can call the ActiveX then that will fast track me to getting data from external devices into my Stack.

Cheers

Martin

Re: How do I call an OCX

Posted: Sun Jan 30, 2011 11:17 pm
by BvG
There is no activeX in livecode. If you have access to the source code, you can create an external from that, which is the activeX equivalent of LC.


www.modbustools.com

Re: How do I call an OCX

Posted: Mon Jan 31, 2011 6:20 pm
by mhoneywill
Thanks BvG

Do you know if there is any way in wrapping the Activex control to create an external?

What made me think this could be done was this posting ?????? (I'm not allowed to post URL links so I can't share the message I was talking about)

Failing this I'll have to write my own Modbus RTU/TCP serial and Ethernet driver, does anyone know of any serial port example stacks or drivers I can use as a basis

Re: How do I call an OCX

Posted: Mon Jan 31, 2011 6:36 pm
by mwieder
I doubt that getting this working through the ActiveX component will really fast-track your application, but rather sidetrack it, since it will be Windows-only. The protocol looks easy enough to implement using serial/socket commands (see Sarah Reichelt's sample stacks at http://www.troz.net/rev/stacks/SerialTest.rev). But if you really want to try going through the ActiveX component your best bet would be to write some VBScript that does this and then call it from LiveCode with a "do as VBScript" command. Ken Ray has a post with some help on how to do this at http://www.sonsothunder.com/devres/live ... ext002.htm.

Why can't you post urls?