![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
Omron CJ2M string data from vision system
Hi Guys,
Question: I'm using an Omron CJ2M to recieve a 40 character tekst string from a Keyence CV-X 420 vision camera. The keyence uses two words for one ASCII character which I can not change. So the first character is stored in D24, the second in D26, third in D28 etc. When I send the character '1' to D24, which is set to STRING, it is stored in the lowest 8 bits, so the HEX value is 0031. For some reason it is not regonised as an ASCII character. When I shift 8 bits to the left making the HEX value 3100, it's regonised as a '1'. I'm pretty lost here, offcourse I can move the lowest 8 bits to the highest 8 bits and loop it for all adresses but I have a feeling I'm missing something here. Any ideas? Thanks in advance! |
![]() |
![]() |
#2 |
Member
![]() ![]() Join Date: Feb 2005
Location: Grand Rapids, MI
Posts: 1,298
|
Omron stores ASCII as hex in D memory.
Hex 31 is an ASCII 1. You can use instructions to change the Hex to ASCII and / or change the display radix in CX-Programmer. |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
Yes, that I know.
I work in ST and D24 is set as STRING. When I view D24 in my program or in watch window, it shows a quotation mark, meaning there’s no string data. When I view the adress in memory I can see the Hex value 0031 is stored there. Changing the bits manually so that it makes a value of 3100 gives me a 1 string in watch window and my program monitor view. Last edited by andepand; September 9th, 2019 at 01:36 PM. |
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
0000000000110001 = Hex 0031 = No string
0011000100000000 = Hex 3100 = String “1” The data send by the Keyence gives me the upper result. Last edited by andepand; September 9th, 2019 at 01:45 PM. |
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: Feb 2005
Location: Grand Rapids, MI
Posts: 1,298
|
You can use the MOVD instruction to move the information to the desired location.
|
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
That was my last resort. I just cannot inmagine there not being any other solution.
The Keyence is pretty restricted in it’s adressing and data settings but the Keyence manual shows it should be possible. In the example shown, the adress is not set to STRING but to ASCII, which is not a data type I can select. I asssume it’s an old CX programmer version or whatever |
![]() |
![]() |
#7 |
Member
![]() ![]() Join Date: Feb 2005
Location: Grand Rapids, MI
Posts: 1,298
|
Current version of CX-Programmer is 9.7 (I think).
|
![]() |
![]() |
#8 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
I mean the one they used for the keyence manual, mine is up to date.
|
![]() |
![]() |
#9 |
Member
![]() ![]() Join Date: Feb 2005
Location: Grand Rapids, MI
Posts: 1,298
|
What is your communication type?
Serial, Ethernet/IP, etc? |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
I’m using Ethernet/IP, the data is recieved by the plc only put in the lowest 8 bits.
Which makes sense I would say, but 0031 is not accepted as an ASCII character |
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: Feb 2005
Location: Grand Rapids, MI
Posts: 1,298
|
Problem is the "00" before the "31"
00 is a null character and often end of line. I agree this really makes no sense on the Keyence end. MOVD can be used to fix the issue, just more work for you. |
![]() |
![]() |
#12 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
Mostly it will mess up the sleekness of my program
![]() |
![]() |
![]() |
#13 |
Member
![]() ![]() Join Date: Jan 2017
Location: Amsterdam
Posts: 69
|
Thanks for your time and advice anyway!
For now I’ll work arround it by moving the data. If anyone else is familiar with this problem, let me know. |
![]() |
![]() |
#14 |
Member
![]() ![]() Join Date: Jul 2012
Location: South East USA
Posts: 27
|
Not super familiar with Omron, but with Ethernet/IP are you using explicit messaging? The way AB does it at least with CCW returns bytes with stored data, which is either Boolean or DINT data. So rather easy to just pull from the registry and do what you want with the data.
|
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ControlLogix 3rd Party eds files | AutomationPrimer | LIVE PLC Questions And Answers | 8 | March 19th, 2015 10:18 AM |
Crimson C-language program examples | ceilingwalker | LIVE PLC Questions And Answers | 17 | February 3rd, 2015 09:16 AM |
SLC5/05 ASCII to String Data Conversion | tspisak | LIVE PLC Questions And Answers | 1 | September 11th, 2007 08:39 AM |
Help with Profibus CPU315-2 DP | Rafael Guedes | LIVE PLC Questions And Answers | 5 | September 3rd, 2007 08:44 AM |
Omron Vision Sensor | Tim | LIVE PLC Questions And Answers | 9 | October 25th, 2003 01:34 AM |