Comunication Problem PLC DL06 with Bar Code Reader

hcortes

Member
Join Date
Dec 2007
Location
Monterrey
Posts
3
I'm trying to communicate a code bar reader (metrologic MS9540)with a DL06 PLC with the next communication adjustments:

--------PLC SetUp Communication Port----------------
Port:2
Non-Sequence
Base Timeout
RTS on delay:0 ms
RTS off delay:0 ms
Data Bits:7
Baud Rate:9600
Stop Bits:2
Parity:Odd
Memory Address:V400
Echo Suppression: RS-422/485(4 wire) RS-232 (2 wire)
XON/XOFF flow control (Disable)
RTS flow Control (Disable)

----------------------AIN------------------------
Variable Length (Enable)
Port Number: K2
Data Destination:V400
Maximum Variable Length: K10
Interchar.Timeuot: None
First Char.TimeOut: None
Byte Swap: All
Termination Code Length:
1 Character
Termination Code1: 0D
Overflow Error: C2
Busy: C0
Complete: C1
-------------------------------------------------
I test the Reader with 10 diferents labels using the Hyperterminal and the readings are OK.

I'm using a Metrologic MS9540 bar code reader with the default setings, the cable between the PLC and Reader have this pin out:

PLC Reader
2 TX 3 RX
3 RX 2 TX
7 0V (-) GND 5 Signal Ground

Seemingly the comunication is working because the bit AIN Complete is Done and I can read values in the Data Table, the problem is for example,
for the label 00-02544H (in the Hyperterminal the result is complete), but in the PLC with the AIN parameters (adjusted above) the reading values are:

v400= 4 (4 bytes ???, Why only have 4 bytes????)
V401= 32 34 (Start Data, Why don't start with 30???)
v402= D 34
v403= 2020

Probably I am not understand how the system works..because 32 34 0D 34 = 2 4 ?? 4 (is only a small part of the complete label code, the same happen with other labels, only read part of the codes....)

If I understand good, the reading will be : 30 30 2D 30 35 34 34 48....Why i can't read the complete code???

I will be happy if you can help me because, I'm pressed with the delivery of this project....thank you
 
When you are using the hyperlink you are using RS232...

How does the metrologic MS9540 communicate?

What pins are you using?? on the DL06

Can you post your program it would help...
 
GIT,

Thank you for your help, today in the morning again check all the comunication parameters and found the parity in the reader was not matching with the parity of the PLC and this cause the messages were not coming complete in the PLC, now the ASCII Hex Code in the data table is OK.
But, if you can help me with the next point i will be happy.
Is posible to convert this hex code to string character to display in MMI?
Wich instruction i can use? AEX?

Thank you for yuor help ... and Merry Chistmas !!!
 
Convert ASCII to "Real String"

Here again, already I do not have problem with the information in ascii, but someone can convert the information ascii into information that it could show in a MMI, I tried the instruction ATH, but only convert to HEX (from A to F characters).

For example: the information ascii:

30 30 2D 30 32 34 31 30 4A

I want to convert it to :

00-02410J

For to show it in a MMI

Some idea ???
 
You don't say what MMI (Man-Machine-Interface) that you have, but you shouldn't need to do anything with that data. With C-more you would only need to create a String Tag pointing to the start of the string and display it. If those values are in individual words then you would need to pack two 8-bit characters into each 16-bit word. The strings are fixed length, so they will need to be zero filled in the PLC.
 
Try the HTA (Hex To ASCII) command. The problem is, while the individual bytes received are valid ASCII bytes each is taking up a full 16 bit word. The AD format for ASCII is 2 ASCII bytes packed into each 16 bit word. The HTA command will do this transformation.
 
It's too late for me to edit my previous reply. The HTA command is NOT APPROPRIATE for this purpose. While combining the ASCII bytes it also converts them (assuming the ASCII bytes were for valid hex numbers '0-9, A-F'.

If the bytes are in seperate words then the second part of my answer still applies and it echoes the thoughts of OpZed. You will need to create the shift and pack routine yourself.

Is posible to convert this hex code to string character to display in MMI?

It may be that we are not understanding what you want to do when you state the above. The sequence of characters

30 30 2D 30 32 34 31 30 4A

IS the ASCII characters which equal the written out string

00-02410J

The sequence of characters cannot be converted into a number. Many displays can show the string as it is assuming you give it a string length.
 
I note that you have restarted this thread at MrPLC's forum. It might be better to stick to one forum for more consistent replies. You may wish to continue, providing the more detailed information I noted on that site.
 

Similar Topics

hallo guy's, I have problem in comunication between PLC and SCADA. :shoot: I connected the plc with the scada and codesys due the keep server...
Replies
0
Views
1,463
Dear all , i am using 1756 L 63B cpu and 1756 CNB controll net scaner and comunicate with Pilz PSS 1 DNS (device net sacner ) now i am having...
Replies
2
Views
2,812
Hi, I have a problem with N2 6SE7138-4FB04-0AB0 we have still the comunication error. SF led on. Someone can help me?
Replies
5
Views
1,754
In micrologix1200 I have only one communication channel so that I do not unable to configure the PLC with Modbus rtu slave driver without losing...
Replies
9
Views
4,256
Hi, all. We have a MicroLogix1200, which channel configuration is "Driver: DH485; Node Address: 1; Baud: 19200; Network Link ID: 1". This channel...
Replies
15
Views
5,599
Back
Top Bottom