Quantcast

Communication with other software.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Communication with other software.

Piter
Hi list,

I would like to establish communication between a micromanager and a
python script for example. The first and the last idea idea I have got
is to use a virtual or physical RS232 port (I have a card with some 5 of
them). Is there any other way to do it?

Thank you in advance.

Petro


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

phil richard ershler
if you on an OS X system, it’s very easy because of the availability of AppleScript. It’s trivial to get MM to send AppleScript commands and requests. I’mm not familiar enough with Power Script in Windows to say if that would work in a similar sort of way.

HTH,

Phil


> On Feb 13, 2017, at 9:22 AM, Piter <[hidden email]> wrote:
>
> Hi list,
>
> I would like to establish communication between a micromanager and a
> python script for example. The first and the last idea idea I have got
> is to use a virtual or physical RS232 port (I have a card with some 5 of
> them). Is there any other way to do it?
>
> Thank you in advance.
>
> Petro
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Piter
Hi Phil,

Unfortunately I am on Win7 system, but thanks, I will look in this
direction.

Best.

Petro


On 02/13/2017 06:52 PM, Philip Ershler wrote:

> if you on an OS X system, it’s very easy because of the availability of AppleScript. It’s trivial to get MM to send AppleScript commands and requests. I’mm not familiar enough with Power Script in Windows to say if that would work in a similar sort of way.
>
> HTH,
>
> Phil
>
>
>> On Feb 13, 2017, at 9:22 AM, Piter <[hidden email]> wrote:
>>
>> Hi list,
>>
>> I would like to establish communication between a micromanager and a
>> python script for example. The first and the last idea idea I have got
>> is to use a virtual or physical RS232 port (I have a card with some 5 of
>> them). Is there any other way to do it?
>>
>> Thank you in advance.
>>
>> Petro
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> micro-manager-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Austin
write a file between the two programs, you can use if exist or even read the text if needed.


> On Feb 13, 2017, at 1:13 PM, Piter <[hidden email]> wrote:
>
> Hi Phil,
>
> Unfortunately I am on Win7 system, but thanks, I will look in this
> direction.
>
> Best.
>
> Petro
>
>
> On 02/13/2017 06:52 PM, Philip Ershler wrote:
>> if you on an OS X system, it’s very easy because of the availability of AppleScript. It’s trivial to get MM to send AppleScript commands and requests. I’mm not familiar enough with Power Script in Windows to say if that would work in a similar sort of way.
>>
>> HTH,
>>
>> Phil
>>
>>
>>> On Feb 13, 2017, at 9:22 AM, Piter <[hidden email]> wrote:
>>>
>>> Hi list,
>>>
>>> I would like to establish communication between a micromanager and a
>>> python script for example. The first and the last idea idea I have got
>>> is to use a virtual or physical RS232 port (I have a card with some 5 of
>>> them). Is there any other way to do it?
>>>
>>> Thank you in advance.
>>>
>>> Petro
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> micro-manager-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> micro-manager-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Kyle Douglass
In reply to this post by Piter
Hi Petro,


On 02/13/2017 05:22 PM, Piter wrote:
> I would like to establish communication between a micromanager and a
> python script for example. The first and the last idea idea I have got
> is to use a virtual or physical RS232 port (I have a card with some 5 of
> them). Is there any other way to do it?

May I ask you to further describe what exactly you would like to do? Are
you trying to

1) communicate between two already running instances of Micro-Manager
and the Python interpreter;
2) use Micro-Manager functionality from within a Python script;
3) something else?

If all you would like to do is to use the Micro-Manager core
functionality from within your own Python script (number 2 above), then
you can import the MMCore Python wrapper into your script and use it
like a regular Python module:
https://micro-manager.org/wiki/Using_the_Micro-Manager_python_library

Otherwise, I have also successfully used the technique suggested by
Austin to write simple files for communication between the two programs.

Cheers,
Kyle

--
Kyle M. Douglass, PhD
Post-doctoral researcher
The Laboratory of Experimental Biophysics
EPFL, Lausanne, Switzerland
http://kmdouglass.github.io
http://leb.epfl.ch


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Piter
In reply to this post by Austin
I have been considering it, I even used it in past but not with
micromanager. But I think it is a 'dirty' way.

I have found two things:

https://developers.google.com/protocol-buffers/

This one looks like only for linux.

And this i have to have a better look, I have a very limited Java
experience.

http://www.prasannatech.net/2008/07/socket-programming-tutorial.html

Best.

Petro.


On 02/13/2017 09:59 PM, Austin wrote:

> write a file between the two programs, you can use if exist or even read the text if needed.
>
>
>> On Feb 13, 2017, at 1:13 PM, Piter <[hidden email]> wrote:
>>
>> Hi Phil,
>>
>> Unfortunately I am on Win7 system, but thanks, I will look in this
>> direction.
>>
>> Best.
>>
>> Petro
>>
>>
>> On 02/13/2017 06:52 PM, Philip Ershler wrote:
>>> if you on an OS X system, it’s very easy because of the availability of AppleScript. It’s trivial to get MM to send AppleScript commands and requests. I’mm not familiar enough with Power Script in Windows to say if that would work in a similar sort of way.
>>>
>>> HTH,
>>>
>>> Phil
>>>
>>>
>>>> On Feb 13, 2017, at 9:22 AM, Piter <[hidden email]> wrote:
>>>>
>>>> Hi list,
>>>>
>>>> I would like to establish communication between a micromanager and a
>>>> python script for example. The first and the last idea idea I have got
>>>> is to use a virtual or physical RS232 port (I have a card with some 5 of
>>>> them). Is there any other way to do it?
>>>>
>>>> Thank you in advance.
>>>>
>>>> Petro
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> micro-manager-general mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> micro-manager-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> micro-manager-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Piter
In reply to this post by Kyle Douglass
Hi Kyle

I think you are right, it will be better to use python core of MM.
My problem was that I was not able to SLM working in python but it is
subject of other message I guess.

Best.
Petro
On 02/14/2017 08:38 AM, Kyle Douglass wrote:

> Hi Petro,
>
>
> On 02/13/2017 05:22 PM, Piter wrote:
>> I would like to establish communication between a micromanager and a
>> python script for example. The first and the last idea idea I have got
>> is to use a virtual or physical RS232 port (I have a card with some 5 of
>> them). Is there any other way to do it?
> May I ask you to further describe what exactly you would like to do? Are
> you trying to
>
> 1) communicate between two already running instances of Micro-Manager
> and the Python interpreter;
> 2) use Micro-Manager functionality from within a Python script;
> 3) something else?
>
> If all you would like to do is to use the Micro-Manager core
> functionality from within your own Python script (number 2 above), then
> you can import the MMCore Python wrapper into your script and use it
> like a regular Python module:
> https://micro-manager.org/wiki/Using_the_Micro-Manager_python_library
>
> Otherwise, I have also successfully used the technique suggested by
> Austin to write simple files for communication between the two programs.
>
> Cheers,
> Kyle
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Communication with other software.

Matthijs
In reply to this post by Piter
Perhaps relevant here:

Instead of raw socket programming, I would use a REST server to control MM. This is fairly straightforward to implement in JAVA, and has the benefit that almost any client can consume it. I started out on a project to implement this some time ago, but got stuck on generating a (compressed) video stream to consume, which limited the refresh rate to about one frame per second - too low for our purposes.

The (very) basic REST server however is functional and can be used to change CMMCore properties and retrieve semi-live images, optionally including meta-data. If anyone is interested in this, it may provide a useful starting point: the source code and documentation are on GitHub at https://github.com/MattNeuro/MMrestServer.

Yours,

        Matthijs



-----Original Message-----
From: Piter [mailto:[hidden email]]
Sent: 14 February 2017 21:02
To: [hidden email]
Subject: Re: [micro-manager-general] Communication with other software.

I have been considering it, I even used it in past but not with micromanager. But I think it is a 'dirty' way.

I have found two things:

https://developers.google.com/protocol-buffers/

This one looks like only for linux.

And this i have to have a better look, I have a very limited Java experience.

http://www.prasannatech.net/2008/07/socket-programming-tutorial.html

Best.

Petro.


On 02/13/2017 09:59 PM, Austin wrote:

> write a file between the two programs, you can use if exist or even read the text if needed.
>
>
>> On Feb 13, 2017, at 1:13 PM, Piter <[hidden email]> wrote:
>>
>> Hi Phil,
>>
>> Unfortunately I am on Win7 system, but thanks, I will look in this
>> direction.
>>
>> Best.
>>
>> Petro
>>
>>
>> On 02/13/2017 06:52 PM, Philip Ershler wrote:
>>> if you on an OS X system, it’s very easy because of the availability of AppleScript. It’s trivial to get MM to send AppleScript commands and requests. I’mm not familiar enough with Power Script in Windows to say if that would work in a similar sort of way.
>>>
>>> HTH,
>>>
>>> Phil
>>>
>>>
>>>> On Feb 13, 2017, at 9:22 AM, Piter <[hidden email]> wrote:
>>>>
>>>> Hi list,
>>>>
>>>> I would like to establish communication between a micromanager and
>>>> a python script for example. The first and the last idea idea I
>>>> have got is to use a virtual or physical RS232 port (I have a card
>>>> with some 5 of them). Is there any other way to do it?
>>>>
>>>> Thank you in advance.
>>>>
>>>> Petro
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> ----------- Check out the vibrant tech community on one of the
>>>> world's most engaging tech sites, SlashDot.org!
>>>> http://sdm.link/slashdot 
>>>> _______________________________________________
>>>> micro-manager-general mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>>> --------------------------------------------------------------------
>>> ---------- Check out the vibrant tech community on one of the
>>> world's most engaging tech sites, SlashDot.org!
>>> http://sdm.link/slashdot 
>>> _______________________________________________
>>> micro-manager-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>>
>> ---------------------------------------------------------------------
>> --------- Check out the vibrant tech community on one of the world's
>> most engaging tech sites, SlashDot.org! http://sdm.link/slashdot 
>> _______________________________________________
>> micro-manager-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, SlashDot.org! http://sdm.link/slashdot 
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...