# Cognex Dataman Connection and get img \[python\]

**URL:** <https://forum.inductiveautomation.com/t/cognex-dataman-connection-and-get-img-python/74825>\
**Category:** General Discussion\
**Created:** [June 9, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/cognex-dataman-connection-and-get-img-python/74825 "2023-06-09T12:04:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Mateusz\_Tobiasz](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Mateusz\_Tobiasz](https://forum.inductiveautomation.com/u/Mateusz_Tobiasz)\
**Post date:** [June 9, 2023, 3:52pm UTC](https://forum.inductiveautomation.com/t/cognex-dataman-connection-and-get-img-python/74825/3 "2023-06-09T15:52:12Z")

</div>

Its python3, im trying a lot of codes from forums, sending ASCII messages true socket inside camera, im getting replyes like Log in after sending login and password:  
Socket Created  
Socket Connected to example\_ip on ip example\_ip port 23  
Username:  
Password:  
Login succeeded

but when im sending another comand im heting 25 thousand of ascii, when its not similar with dimensions to image.

I tried [[Solved] Connecting Cognex to Halcon - Technical questions - RobotExchange](https://www.robotexchange.io/t/solved-connecting-cognex-to-halcon/146) -- python 3 code, but when im sending img like comand i cant get image.

I tried rewrite this code: [Getting 1MB of ASCII Cognex image with Java sockets and TCP ZeroWindow issue](https://forum.inductiveautomation.com/t/getting-1mb-of-ascii-cognex-image-with-java-sockets-and-tcp-zerowindow-issue/56966) to python but also without effect

---

_[View the full topic](https://forum.inductiveautomation.com/t/cognex-dataman-connection-and-get-img-python/74825)._
