Troubleshooting QR Code Communication Issue with Click PLC and Cognex Camera

Question:

I recently started a new job and inherited some tasks from my predecessor. Currently, I am working with a Click PLC C0-11DRE-D, a Cognex DMR-280Q camera, and a 7" HMI system. The system is designed for the operator to input a lot number into the PLC, which then instructs the camera to capture a QR code and send the same number back. Despite seeing the code translation in the camera software, the number is not being communicated to the PLC - only receiving 0's/$$. I tried configuring the camera to use Modbus to align with the click protocol, but the issue persists. While I have experience with ladder logic, cameras are not my forte. Any advice or guidance on this matter would be greatly appreciated as I am currently facing some difficulties.

Top Replies

Based on your details, it seems that the Click device functions as the Modbus master in this setup. The suggested sequence of actions should follow as such: 1. The Click device activates a specific bit in the Cognex command word to prompt the scanning of the QR code. 2. The Click device constantly checks the Cognex status word until it confirms that the QR code has been successfully scanned. 3. Once the scanning is complete, the Click device then deactivates the aforementioned bit in the Cognex command word. 4. Following this, the Click device proceeds to request the QR code data from the Cognex. 5. Finally, the Click device retrieves the QR code data from the Cognex. Can you confirm if these steps are being executed accurately as planned?

Keep in mind that the majority of barcode scanners (cameras) typically transmit barcode or QR code data in ASCII format. Therefore, do not anticipate receiving values in decimal form. Consult the camera's manual to identify which Modbus registers store the data for the last scanned code. Extract these registers from the PLC system. Typically, each character (letter/number) is assigned its own byte, so you may need to retrieve multiple registers simultaneously in order to obtain the complete code, depending on its length.

If you're looking for more information on Modbus TCP communication, be sure to check out this link: https://support.cognex.com/docs/dms...Manual/Content/Topics/PDF/DMCAP/ModbusTCP.htm. This resource provides valuable insights into setting up and troubleshooting Modbus TCP connections.

From what you've described, it sounds like there might be an issue with PLC-Camera communication rather than the Modbus protocol you're using. I'd suggest checking the IP addresses and make sure there are no conflicting devices on the network. There's a possibility that the settings for IP, subnet, and port number may not match between your devices. Additionally, verify the data format and data index in the PLC write functions to ensure correct data transmission. Cameras can be tricky, but with a systematic approach, it'll be smooth sailing in no time.

It seems like a challenging situation! It definitely sounds like a communication mismatch between the Cognex camera and the PLC. Modbus should normally work, assuming that it's configured correctly. Have you checked the configuration parameters on both ends? One thing to remember is that Click PLCs most often communicate in modbus RTU. Ensure your settings are in line with this. If possible, you could try to create a simple Modbus message using ladder logic to check the connection. It'd also be helpful to monitor the communication using some sort of Modbus decoder/sniffer. This way, you can confirm if the PLC is sending and receiving any messages.

It sounds like a complex issue you're facing. It could be an issue with the Modbus configuration or potentially a mismatch in data types between the camera and PLC. Try checking if both systems are communicating using the same Modbus function codes. Also, ensure that the register addresses in the PLC match the ones you set in the camera software. Another point to consider is the modbus data types; check if the camera is sending data in a format that the PLC can understand (like INT or DINT). Finally, as tedious as it sounds, you might also want to confirm that the PLC and camera are correctly wired to each other. Hang in there! Troubleshooting such issues can be challenging but equally rewarding once you get it right.

It sounds like you're dealing with a tricky integration challenge! Since you've confirmed the camera is correctly reading the QR code in its own software, it might be worth checking your Modbus configuration again, especially the specific registers you're trying to read from or write to. Sometimes, the mapping can get a bit convoluted, and ensuring the correct data format is being sent and received can also make a big difference. Additionally, double-check the communication settings—baud rate, parity, etc.—to ensure everything is consistent between the PLC and the camera. If you haven’t already, reviewing the camera’s manual for specific Modbus implementation details could provide some clues as well. Good luck, and don’t hesitate to reach out for help if you hit more roadblocks!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. FAQ: Why is my Click PLC not receiving the correct data from the Cognex camera despite configuring it to align with the Click protocol?

Answer: Answer: The issue might be related to the configuration settings or communication setup between the PLC and the camera. It's important to ensure that the communication protocols, data formats, and addressing are correctly configured on both devices for seamless data transfer.

FAQ: 2. FAQ: How can I troubleshoot communication issues between my Click PLC and Cognex camera in a QR code system?

Answer: Answer: You can start by checking the communication settings, verifying the data being sent and received, testing with different input scenarios, and ensuring that the PLC and camera are compatible in terms of protocols and data formats.

FAQ: 3. FAQ: What steps can I take to debug the problem of only receiving 0's/$$ in the PLC instead of the expected lot number from the Cognex camera?

Answer: Answer: You can try monitoring the data flow between the camera and PLC, checking for any errors in the data transmission, confirming the correct data mapping, and validating the communication setup to identify and resolve the issue.

FAQ: 4. FAQ: I have experience with ladder logic but not with cameras. How can I effectively troubleshoot the QR code communication issue between the Click PLC and Cognex camera?

Answer: Answer: You can seek assistance from experts in camera systems, review the documentation for both the PLC and camera, experiment with different configurations, and use diagnostic tools to

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’