We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Processing to Windows COM or other API
Page Index Toggle Pages: 1
Processing to Windows COM or other API? (Read 653 times)
Processing to Windows COM or other API?
Mar 13th, 2008, 3:28pm
 
I would like to add Processing's display capability to an existing Windows program, and I have control of both ends of the pipe.  

Could anyone with overview suggest the simplest and fastest way to pass data and commands back and forth between the two while both are installed and running on the same Windows XP/Vista machine?

The PC program has a COM interface and can easily be made to communicate with anything that can talk to COM.  But I have searched Processing Discourse and found no hint of Interprocess Communication other than maybe open().

Re: Processing to Windows COM or other API?
Reply #1 - Mar 13th, 2008, 4:24pm
 
How much data are you trying to push and at what rate?

I ran into this problem a while ago and ended up using TCP/IP sockets on localhost to communicate between programs.

Plus, Processing supports socket comm via the network library, so you'd just have to add a listener on the other app.

If you really want to use COM, you may have to write a JNI-> COM interface.
Re: Processing to Windows COM or other API?
Reply #2 - Mar 13th, 2008, 4:34pm
 
At the moment, I only need to pass a small (<1k) array of floats from the pc app to Processing, and the frequency of transfer is low, maybe once every few seconds at the fastest.  The data is produced by an interactive user of the pc program.  Each time the user makes a design change, the pc app has a new array to be displayed.

I saw the client() function and wondered what other options there are.  I think we could add a server() fn on the pc side, but of course, the COM api already exists.

If there isn't anyting else, I will look into setting up a partner for the client() in Processing.  At this point, I don't think it's (yet) worth the time to develop JNI-> COM interface.

Thanks.

Re: Processing to Windows COM or other API?
Reply #3 - Mar 13th, 2008, 4:46pm
 
Whilst there's no processing specific one, there seems to be a a general java one:
http://sourceforge.net/projects/jacob-project/
http://danadler.com/jacob/ (old?)
or
http://sourceforge.net/projects/jcom/
Re: Processing to Windows COM or other API?
Reply #4 - Mar 13th, 2008, 5:35pm
 
Jacob looks promising.  I will see if I can get it going with Processing.  Thanks very much!
Re: Processing to Windows COM or other API?
Reply #5 - Mar 20th, 2008, 8:21am
 
Jacob works fine.  I have used it to access our production pc program and there are no problems visible so far.  I am using Jacob to poll the pc program for available data and then to download an array whenever data is available.  If anyone else needs to access a PC program via COM interface, Jacob would be a good choice as far as I can see.  There is enough documentation and examples to get by.

Thanks for help finding it.



Page Index Toggle Pages: 1