Omron CJ2M string data from vision system

andepand

Member
Join Date
Jan 2017
Location
Amsterdam
Posts
72
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.
 
Last edited:
0000000000110001 = Hex 0031 = No string

0011000100000000 = Hex 3100 = String “1”

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

I have PLC Omron CJ2M with OD211 module. I want to use the pulse output and PWM output and this module. But i confuse how to activated this, i...
Replies
0
Views
75
I have a project to control the speed of motor DC using PWM Output on PLC and when im on working i have a several trouble and of of them is the...
Replies
6
Views
168
Hi Everyone, i am modifying an OMRON Cj2M program and have run into an issue. How do you find the timer, counter, registers that have already...
Replies
11
Views
653
Hello all, I am trying to set PLC clock using DATE function. When DATE function is enabled, I can see A351 to A354 change to the register...
Replies
3
Views
361
Hi all, i have a hot water tank (500 gallon best guess) that uses a valve controlled by the plc to fill it. there is an analog 4-20 ma sensor...
Replies
26
Views
2,138
Back
Top Bottom