7/7/2023 10:48 AM | |
Joined: 11/20/2022 Last visit: 8/29/2023 Posts: 3 Rating:
|
Hi everyone, I think due to one small mistake I can't properly communicate the PLC with the PGV head via RS485, so that I can read data from it. I am using: - Tia Portal V17, - CPU 1214C DC/DC/DC, - CM 1241 (RS485), - PGV100-F200A-R4-V19 optical reading head (Pepperl Fuchs Data & Documentation) Starting from the beginning: 1) Using QR codes, I set the basic communication parameters of the PGV head: - baud rate: 115200 - head address: 1 2) Using a USB adapter, I connected to the dedicated Pepperl Fuchs software (Vision Configurator v6.6.0.0): The communication worked correctly, and the parameters previously entered via QR codes were confirmed in the software, in addition, the PGV correctly read the position of the line, which was displayed on the PC screen: 3) I wanted to check the operation of communication without using a dedicated program. Using the "Serial Port Monitor 9.0" program and the PGV instruction, I once again connected to the PGV. To read the position you need to send the corresponding request, in my case (for the head with address 1): C9 36 (C9 (11001001) - request, 36 (00110110) - checksum). While the request is being sent, the first LED on the PGV head flashes to indicate that data is being transferred via RS485. The PGV response is correct and in accordance with the instructions: In addition, I checked the operation of communication in the case of a change in the selection of line tracking, sending a request: ED 12 (ED (11101101) - request, 12 (00010010) - checksum), in response, the corresponding LEDs lit up on the head. 4) I then connected the PGV to the CM1241 and set the port in Tia Portal: (further text in the next post) |
7/7/2023 10:50 AM | |
Joined: 11/20/2022 Last visit: 8/29/2023 Posts: 3 Rating:
|
5) To build the program, I used the Siemens example program (Link to example program) making small changes, e.g. replacing the Modbus_Comm_Load block with MB_COMM_LOAD, etc. Making the program suitable for communication with PGV. I am uploading 2 screenshots of the 2 most important functions: MB_COMM_LOAD: Here everything looks fine. MB_MASTER: In this case, the MB_MASTER block is alternately in a busy state or error 16#80C8 (Slave timeout. Check the baud rate, parity and the connectors on the slave), when sending a position request: The diode responsible for information about the transfer of data via RS485 on the PGV flashes (I conclude that the request reaches the PGV), but I am unable to read data from the head, and the MB_MASTER block itself never reaches the done state. In addition, I think it is also worth writing about the fact that when sending a request to change the line tracking selection (as I did in point 3. using PC; request 16#ED12), the head correctly changes its settings and lights the corresponding LEDs (exactly the same as in point 3.). I tried swapping the positions of the cables, but this caused the PGV to not respond at all when sending requests, so I went back to the original position. I tried to describe my problem as accurately as possible, if you have any questions, feel free to ask. Full program at Tia Portal: P.S. I have included all screenshots in the attachment (probably they will be of better quality). Best regards, MontezumaM AttachmentModbus_Problem.zip (290 Downloads) |
Last edited by: Jen_Moderator at: 07/10/2023 07:00:06Link optimized. |
|
Follow us on