This thread collects community notes about reading a Keyence IV4 vision sensor from a Fairino Lua program over a TCP socket. The same approach applies to other cameras with an ASCII socket interface.

Status

Partial checklist. A working setup was reported. Commands depend on the camera model, so check the camera manual.

Camera side

  • Enable TCP/IP non-procedural communication on the camera. It may be off by default.
  • Note the port. Port 8500 was used in the reported setup.
  • Keep the camera in the same subnet as the robot port you use.

Robot side

An open socket only shows that the connection works. You still have to send a command and read the reply:

SocketOpen(camera_ip, camera_port, "socket_0")
SocketSendString("RT\r\n", "socket_0", 0)
reply = SocketReadString("socket_0", 5)
SocketClose("socket_0")
RegisterVar("string", "reply")

If you get a socket run timeout, the camera may not be answering that command. It helps to test the command from a PC first.

Robot jerks during small corrections

One user saw the robot jerk during camera corrections, which shifted the screw position by up to about 2 mm. The community suggestion was to lower both speed and acceleration in the correction Lin command.

Please reply with

  • Camera and amplifier model
  • Robot model and software version
  • Socket commands that work for you
  • Correction accuracy you reached