Trigger an cognex camera by script

4.3k Views Asked by At

I have got a Cognex Advantage 100 camera connected to my PC via ethernet.

After pressing F5 in the inSight Explorer to trigger the camera I can use the captured image in a Python script.

Can I make the Python script trigger the image capture itself?

2

There are 2 best solutions below

1
On BEST ANSWER

I'm not very familiar with the Advantage series, but I am quite familiar with the other In-Sight cameras. I'm going to assume the Advantage is similar to other In-Sight cameras.

You should be able to achieve a trigger from python by opening a telnet connection to the camera (on port 23), logging in (default username: admin, password: ), and sending the command 'SE8'. The camera trigger mode must be set to External, Manual or Network. If the command is successful, it will respond with a '1'. I'd suggest trying this with a telnet client before trying it in python. Suggested telnet clients: Putty or Hercules.

More information can be found in the In-Sight Explorer help file. From the contents, go to 'Communications Reference -> Native Mode Communications'.

3
On

Possibly you could simulate a key press. This answer here and this answer here, might help you do that.

Apart from that, your camera software doesn't allow you to interact with it via python, but it does supply it own method of programming the camera here. Try that instead, it seems to be the indented way of doing this.