Converting Omron String to Allen Bradley String via Devicenet

wutnots

Member
Join Date
Aug 2009
Location
GA
Posts
39
I am sending Omron Text over devicenet to an AB GuardLogix Processor. I am having a difficult time converting the string to readable data. I am sending total of 8 words from the Omron and am unable to convert it to the same String characters in the AB processor. I can use the SWPB function in the AB to convert atleast 4 characters to a string at a time, but cannot combine them with any more characters to get a combined logical string.

For Example: if I send 8 words from omron that represent these characters, 27 0B RM 2 (which is 4 words), Then I get 809644599 in the 1st word over devicenet and 838881869 as the 2nd word, when the AB is setup as a DINT.

When using the DT0S function to convert a DINT to a string, I still wind up with numbers, vs. alphabetic characters.

Any help would be appreciated.
 
Change the radix (display format) of the data to Hex and you will see the ASCII for your data. It will be easier to see what is going on:

809644599 = 30423237 (Hex) which is '0B27'
Then do a SWP at WORD
The data is already in ASCII, so you do not need to do a DTOS.
 
Thanks for the input. I have that part figured out. I can see the ASCII value in the Controller tags, I can change the tag in the tag viewer to display in ASCII, HEX, Decimal, etc. My problem is, I want to Copy and eventually Concantinate the ASCII value to a string Tag with other ASCII Values. I can't seem to do that and get "Text" out of it, just number values.
 
Whoops!
Make the SWPB order Reverse.

Then copy the result into a Stringtag.DAT[0] and set the LEN to 4.
The length of the copy should be 4
Then do the same for the next Dword.
Then concatenate the two strings together.
 
An example of what I would ultimately like

This is an example of what my tag table looks like:
String1 '270B' ASCII Decimal
String2 'RM2' ASCII Decimal
String3 ' ' ASCII Decimal
String4 'C1' ASCII Decimal


This is what I ultimately want in a Tag
ProductID '270BRM2 C1' String
 
Tag Table Values

Here is a copy of what the current values are. I would ultimately like the DINT tags combined in to the one string tag.

ASCII.jpg
 
Made progress, still more to do.

I sure appreciate your help. It was much appreciated. I made significant progress by following a similiar pattern in your logic. I did however, have to do 2 swaps on each string just to get it ultimately in the correct format. I can't quite wrap my head around why I had to program it as you did, but hey, if it works, it works.

All I have to do now is strip out the null values and the stray L value and I got it.
Having one string in the AB allows me to program my Redlion G315 to only monitor one PLC vs. the Omron and AB PLC. Should improve communication reliability.

Once again, thanks a million, I appreciate you providing input.

ascii_2.jpg
 

Similar Topics

Hello! I'm working in upgrading an old c28k Omron to a cp1e. My doubts are concerning the IO pins. I can see in syswin 3.4 the following inputs...
Replies
4
Views
2,461
I am looking at a dead C20, and the owner wants to go AB, which is my preference too. I have not worked with Omron since trade school. I have...
Replies
4
Views
2,914
guys, Please help. Ive been having a self study on PLC Programming , I use OMRON CPM2A. I want to program the high speed input from my...
Replies
7
Views
5,387
Help! I'm not too familiar with Omron. I would like to know if there is an easy way to locate where the problem is in the program? I converted an...
Replies
4
Views
7,974
Anyone have any ideas on converting the AB "sequencer output" command to Omron PLC? I've been working on this for a while and my brain hurts...
Replies
4
Views
6,726
jerrydesaulniers
J
Back
Top Bottom