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!
 
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.
 
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.
 
0000000000110001 = Hex 0031 = No string

0011000100000000 = Hex 3100 = String “1”

The data send by the Keyence gives me the upper result.
 
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
 
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
 
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.
 
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.
 
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.
 

Similar Topics

Hello Everyone, I am having issue with my Omron PLC CJ2M-CPU33 communicating with my HMI NS5-SQ11B-V2 via ethernet. The HMI keeps showing an...
6
Replies
487
Views
HI all! I am new in programming Omron PLC's and I been very glad if you can help me! I have PLC Omron CJ2M-CPU33 with built-in ethernet interface...
3
Replies
457
Views
I have a copy of a CJ2M program that I last looked at about 9 years ago. I no longer have access to CX-ONE but am looking to replace this...
5
Replies
481
Views
So i have this omron cj2m cpu 15 when i plugg it it gives me an error At first i thought the rest of the modules are needed but when i plugged...
1
Replies
787
Views
Hello, We have a problem with a PLC Omron Cj2M-CPU31, previously worked fine for a long time, before it intermittently indicates an HF error...
1
Replies
1,113
Views
Top