Greetings! I'm facing an issue where I am unable to extract the first 12 characters of a message sent by a barcode reader to the ascii card (1734-rs232 ascii). The challenge arises because the barcode reader's message is 170 characters long, causing the XX.ReceiveRecordNumber in the plc to increase by 2 as it overwrites the initial data. Consequently, I can only access characters 129 to 170 in the buffer. How can I retrieve the data from the beginning of the message? It is crucial for me to obtain the first 12 bytes from the barcode reader's message. Your assistance is greatly appreciated.
Does each complete set of 170 characters sent by the barcode reader have a distinct delimiter at the end? It is important to pay attention to the specific and pertinent information being transmitted by the barcode reader via the serial interface, and to incorporate this into the programming of the PLC reader. This will ensure seamless data transfer and processing within the system.
After each set of 170 characters, there is a carriage return "#R" included in the received data. The data is structured in this format: "01-0123456789;02-1357902468;03-9876543210;04-9753186420;05-....................". To extract the specific string "0123456789", I need to process the data accordingly.
When processing data, consider it as a continuous flow of characters. Instead of
Thank you. I will give it a try on Monday. I was attempting to process incoming messages without using a start delimiter and using a semi-colon as the stop delimiter. This led to receiving multiple messages, one for each semi-colon encountered.
Welcome to the PLCTalk forum community! One solution to consider is bypassing the first barcode. The challenge stems from the limited Input buffer size of the 1734-232ASC module, which is only 128 bytes, while the barcode string is 170 bytes long. It is uncertain if the master/slave handshake will allow the overflowed buffer contents to be transferred to the Produced data connection while the buffer is still being filled. It is recommended to investigate this further. This scenario may necessitate a device with a larger buffer capacity. Using semicolons as delimiters and parsing each element individually could be the optimal approach if the RPI has sufficient speed or there is a delay between the delimited sections.
Hey there! This does sound like a predicament. Based on your predicament, I believe you could overcome this challenge by introducing a shift array operation. Essentially, with each new batch of characters received, shift the array contents and insert the new characters at the end. This way, you would be continuously eliminating the oldest characters but maintaining the latest including - crucially - the starting characters of your next message. Just make sure to build in some logic that checks for the start of a new message to ensure you're not slicing important data in half. It's a bit of a programming challenge, but it should be an effective solution. Hope this helps!
It seems like you're dealing with a buffer overflow issue. Have you considered using a separate buffer or an array to immediately capture and temporarily store your barcode reader's message? This could allow you to then extract the first 12 characters without them being overwritten. Alternatively, maybe you could modify the barcode reader's settings to transmit smaller chunks of data.
Hello! It seems like you're experiencing some buffer overflow issues here. One solution that comes to mind is to split your barcode reader's message into smaller chunks that match your buffer size. By doing that, you could process the first 12 characters before moving onto the next set. Maybe you could program your reader to send data in smaller packets or, alternatively, consider increasing your buffer size if that's an option. I hope this helps.
Hey there! You might want to consider using a buffer large enough to temporarily store the entire message and then just read the first 12 characters of the message from there. You could potentially write a function that reads the entire message into a separate buffer, then extracts the necessary characters. This should allow you to work around the limitation of the plc hardware. It might also be worth checking if your barcode reader can be configured to send smaller messages if you're only interested in the first few characters. Hope this helps!
It sounds like you're in a bit of a bind with that buffer overwriting! One potential workaround could be to configure the barcode reader to send a shorter message, if possible, or introduce a delimiter (like a carriage return) so that you can isolate the first part of the message. If you can modify the way the data is sent, try breaking it into smaller packets. Another option is to adjust the PLC logic to handle overwriting more gracefully—perhaps by storing incoming data in a separate buffer until you can process it. Good luck, and keep us posted on what works!
Hey there! It sounds like you’re caught in a tough spot with the buffer overflow issue. One way to tackle this could be to introduce a delay in reading the data after it’s received, allowing the full message to properly register before you try to access it. You might also consider setting the PLC to read the data in smaller chunks or add logic to wrap around the buffer when the message exceeds your expected length. If your setup allows for it, reconfiguring the buffer size or reading mechanism could help too. Hope this helps get you started on finding a solution!
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - To extract the first 12 characters of a message sent by a barcode reader to the ASCII card, you can adjust the buffer settings to ensure that the initial data is not overwritten. This will allow you to access the beginning of the message and retrieve the first 12 bytes.
Answer: - The XX.ReceiveRecordNumber in the PLC increases by 2 because the barcode reader's 170-character message overwrites the initial data in the buffer, causing the PLC to skip ahead in the buffer. This results in only being able to access characters 129 to 170 of the message.
Answer: - To ensure you can access the data from the beginning of the barcode reader's message, you should adjust the buffer settings or configuration in the PLC to prevent the overwriting of initial data. This will allow you to retrieve the first 12 bytes of the message as needed.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.