Posted 8 Jan 2015 Hi I am new with Barcode scanners. I want to trigger the barcode scanner from the plc and read the barcodein th ePLC. Howwill I be able to do this? Share this post Link to post Share on other sites
Posted 8 Jan 2015 Are you using a Sick CDM breakout box? Hook a PLC output up to the trigger input of the barcode scanner. Wiring depends on the model of the PLC. Connect the RS232 connection of the barcode scanner to the programming port of the PLC. That port is a combination RS232/RS422, so you'll want to check the wiring. You may be able to do it with a standard Micrologix serial programming cable and a null modem, but you'll want to check the wiring. Change the channel configuration of the Micrologix programming port from DF1 to ASCII and set the baudrate, etc. to match the setup of the barcode scanner. Note that this means you will no longer be able to program the PLC using the programming port, you will have to use Ethernet for that. When the PLC output is turned on, the barcode scanner will trigger. It will read a barcode and send an ASCII string to bufferes in the PLC. Use the ARD or ARL instruction to read data from the buffers into a string data type for manipulation. Share this post Link to post Share on other sites
Posted 8 Jan 2015 (edited) Background - We have just completed a project using CompactLogix to read and write via Ethernet/IP to Sick Barcode readers. It went fairly easily. The zip file available here helped immensly, especially the PDF on Ethernet Function Description. Once connected triggering the read and interpreting the response was fairly easy. We have also, using a Micrologix 1400 (which has the same messaging capability on Ethernet as the 1100), read and wrote the input and output assemblies (101 and 111) from a servo drive. It was not as difficult as had been suggested. Warning - BUT, the servo drive we talked to had information in 16 bit words. The Sick barcode reader has information in 8 bit bytes. I'm not sure how the information would line up since the only available target, I believe, in the Micrologix MSG command are 'N' files. Edited 8 Jan 2015 by b_carlton Share this post Link to post Share on other sites
Posted 8 Jan 2015 I guess I should have looked up the scanner model... I've been working with RS232 scanners and the Micrologix lately, and momentarily forgot the CLV630 series was Ethernet based. Yes, the Micrologix requires that you MSG the data into N registers which stores two characters in each register, with the High (Upper) byte being the first character. There is no easy way to move N data into a string (ST) data type. If you need it in a string, you will need to use a MOV instruction to move each register one at a time into the data sub-elements of the string data type. It's a pain, but the only way to use ASCII instructions on the data. If you only need to parse a portion of the string, say to pull a part quantity or something out, then just move the section of the data that you need. Share this post Link to post Share on other sites