How retrieve serial data in the controller using the 1769-ADN and 1769-ASCII modules?

Join Date
Sep 2010
Location
Port Elizabeth
Posts
6
Firstly some background:
I have to add a 1769-ASCII module to an existing plc installation done by another company some years ago.
The 1769-ASCII will be added to the Compaq I/O 1769-ADN DeviceNet Adapter which already has 2 Input and 1 Output modules.

Configuration is as follows:
1769-L32E Controller + 1769-SDN/B DeviceNet Scanner Card + 1769-IQ32/A + 1769-QW16/A
Via DeviceNet To:
1769-ADN/B + 1769-IQ32/A (slot 1) + 1769-IQ32/A (slot 2) + 1769-OW16/A/FW Rev 3.1 (slot 3) + 1769-ASCII (slot 4) + 1769-PA4 + 1769-ECR

I have tried to use manual I/O mapping but could not get it working. Eventually I just used the auto map future. Existing modules mapping stayed the same because I have added the ASCII module to slot 4.

PLC now seems to be happy with the new I/O card.
Barcode scanned with barcode scanner on the 1769-ASCII input appears in the Controller’s Local:1:I.Data[xx] array. So I can see for example the barcode length in part of the 32-bit word and analyzing the rest of the words I can also see the individual characters of the barcode.


Now my question is: What is the correct method to use for extracting all the characters from these 32-bit words to construct the original string scanned?

I have looked on the web for more info using the 1769-ADN and 1769-ASCII modules together, but could not find any. The 1769-ADN User Manual I have describes various I/O modules, but not the 1769-ASCII.

Thanks,
Johannes
 
Thanks Jera,

I have the manual, but at first thought that it won't be of any use since I am using it through DeviceNet.

Problem now is that with the ascii module's data being auto mapped, the data starts at Local:1:I.Data[4].16 and not Local:1:I.Data[4].0. This is because the data from the 1769-OW16/A/FW Rev 3.1 module is in the first to bytes of Local:1:I.Data[4]. So I must now make a plan to get this offset sorted.

As mentioned before I could not manage the manual mapping to work where I tried to start the ascii module's data from Local:1:I.Data[5]. Then Local:1:I.Data[4].16 to Local:1:I.Data[4].31 would have been unused.

I will give this some thought and maybe try manual I/O mapping again. I obviously must be doing something wrong.

Thanks,
Johannes
 
You can use a SINT array tag to help shift your ASCII string into a readable format.

Perform a Copy Synchronous (CPS) instruction on the part of the 1769-SDN input data table that contains your string.

CPS
Source Local:1:I.Data[4]
Dest MyCharacterArray[x]
Length xx

The trick is the length: set it to the number of characters in your ASCII string plus 2.

Now the array tag MyCharacterArray will include:

MyCharacterArray[0] = Some byte we'll ignore
MyCharacterArray[1] = Some byte we'll ignore
MyCharacterArray[2] = First character of the ASCII String
MyCharacterArray[3] = Second character of the ASCII String
MyCharacterArray[4] = Third character of the ASCII String

and so on.

Next you're going to move that ASCII data from the SINT[x] array tag into a real String tag.

Use a MOV instruction to place the desired Length into the string tag's .LEN sub-element.

Use a COP instruction to place the MyCharacterArray bytes into the String tag's .DATA array. The .DATA array is an array of 1-byte SINT elements, just like the character array you created above, so the Length is the number of characters in your string.

COP
Source: MyCharacterArray[2]
Dest: MyStringTag.DATA[0]
Length: xx
 
Last edited:
Thanks Ken,

I only saw your post now.

After a few hours of struggling I have managed to get the scanner to work.

The method I used is almost exactly as your method. Great to know that this is how it is done. :)

I still am concerned about the fact that I could not manage to manually map the I/O…

Johannes
 

Similar Topics

we have lost the HMI Panel View source file (.apa) we do not have back either. we have only .PBA file. can some one help how to get .apa source...
Replies
2
Views
1,143
We have many CISCO and STRATIX switches in our process network. The Stratix switches have AOPs that enables us to use our Rockwell PLCs to gather...
Replies
8
Views
2,227
Hi, I started my journey with Micro820 and I have to read input status address 10001-10010 from one device via Modbus TCP, everything works fine...
Replies
0
Views
1,191
I'm headed to my shop right now to try an experiment. I'm trying to find out if the PowerFlex 700s can swap control boards and successfully power...
Replies
8
Views
2,571
Hi All, I am writing a piece of software for some research and would like to retrieve a running program from a PLC using python or some other...
Replies
5
Views
1,995
Back
Top Bottom