Keyence barcode scanner

dmayhugh

Member
Join Date
Sep 2016
Location
Michigan
Posts
48
I am using an SR-1000w keyence barcode scanner with compactlogix L18 version 20.1.

I am getting the barcode information to an ASCII string. How do I convert the ASCII String to a decimal value.

I am looking to compare the UPC barcode to see if I need to reject a product that is nort the same match. I was thinking that I coule convert the ASCII String to Decimal to complete this task.

Any help is appreciated.
 
I have been trying to use the STOD.

I cant clear an error with this command. The Keyence scanner is connected via EtherNet Module. The value is set up for Decimal. It will read the ASCII Value when I change the style from Decimal to ASCII.

I must be missing something. I am integrating new equipment to an existing line. I will be getting a message for the UPC code and need to compare it to the UPC that I am scanning. If this helps with what I am trying to accomplish.
 
If the UPC code you're getting as a "message" is also a string, as bernie said, you can just use the EQU instruction to directly compare the two strings and see if they match. If not, you'll have to convert the string to an integer, or the integer to a string. Either way.

You may need to provide some more detail if you need any more detailed responses (perhaps a screenshot of the logic, or zip and post the whole program if possible).
 
The STRING data type has an integer holding the number of characters (the length - LEN - section) followed by an array of SINTs (8 bit characters - the data - DAT - section). If the ASCII message does not have this exact format then you may need to copy the ASCII characters into the 'data' portion of an empty string and move a count of the characters into the empty string's LEN (length) section. I had to do this for at least one barcode reader's message. Once you have it correct either the STOD or the EQU can be used.
 

Similar Topics

Dear all, I have a Mitusbishi MELSEC FX2N PLC and a Keyence DV-90NE barcode scanner at hand. And now I want to wire these two together to get...
Replies
0
Views
5,599
Hi everybody, I would like to know if anybody here has already programmed with a LR-TB keyence on Io Link on a Rockwell PLC? And perhaps have...
Replies
0
Views
80
Hi everybody, Is anybody here still have programmed a Keyence sensor LR-TB2000CL and used it as io link material in studio 5000. I would like to...
Replies
0
Views
91
Hello all I've got a cell with four Keyence IV3 cameras that are saving images to a FTP server, we are also labeling the parts with a time date...
Replies
3
Views
250
I will find cable series but I don't know for fs260 model, kindly suggestions and help to me for connect cable
Replies
1
Views
109
Back
Top Bottom