Data conversion help request

2 posts in this topic

I am using an Omron NJ controller and a Cognex Dataman 260 bar-code scanner.   At this point I can trigger the scanner and receive data from the scanner via ethernet/ip.

My issue is in converting the response from the scanner to something human readable.

The bar-code I scanned reads "872-3GSq".  The results of the scan are located in the variable Dataman_to_NJ[8]-[11].

At some point I know I need to use the SWAP function but I believe my lack of data type knowledge in this system is hindering me.

How can I convert the value in Dataman_to_NJ[8] to the string "87"?

Any assistance would be appreciated.



Edited by Jayloo75

Share this post

Link to post
Share on other sites


The above code shows what could be done to convert one word. An array of consecutive words could be used in the same fashion to convert to an array of bytes and then that could be converted to a longer string using the same two lines of code.  Like this:


This was the data in the HexValue Array:


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now