Jayloo75

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.

 

omron-issue.png

Edited by Jayloo75

Share this post


Link to post
Share on other sites

5a7d170335f51_Wordtostring.jpg.a7fd77790

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:

5a7d1a1a59376_Wordtostring2.jpg.c3bf2bbf

This was the data in the HexValue Array:

5a7d1a56d9d7e_hexvaldata.jpg.171b8b52b3c

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