HEX or BINARY outside ASCII READ for Micrologix

Plastic

Member
Join Date
Feb 2009
Location
Michigan
Posts
319
We have an electrical test device that measures electrical capacitance. It has a RS-232 port. The device unconditionally broadcasts (spits out) test results at 9600,N,8,1 at about 1hz. The original intent of the device is to be tied to a computer running compatible software.
We need this information to be available in an Allen Bradley Micrologix.
There is a repetitive pattern observed using RS-232 sniffing programs similar to “Hyper-Terminal” but more In-Depth. The data is easily recognizable in HEX or BINARY mode, but the 10 bytes have values above the simple ASCII characters.
We have used the ASCII mode on Micrologix in the past to successfully read in ASCII data, or send out ASCII data, but we cannot read in the data from this electrical tester that falls outside standard ASCII characters.
Any ideas?
Thank you,
Plastic
 
What software are you using? Can you post a screenshot of what you have or a file from your capturing software?
Can you post a manuals for your measuring device? You should be able to manipulate the string in the logic should you?
Does the MLX see the string? If so can you change the radix to HEX? What does the data look like?
Sorry to overwhelm you with questions. I am just trying to understand what you have.
 
Last edited:
Use the BIN mode and convert your bytes direct. by looking at byte one.
be sure you test when byte one is received as it will garble when not in sync.
 
I think what shooter is trying to say, is to go ahead and use ascii mode, but then COPy the ST elements to integers where you can break them down howwever you wish, treating them as binary.

Also, post the full part number of your Micrologix. I think there are some limitations with some models ability to handle ST data type conversions. This may not be a factor if you simply need the binary patterns.
 
Ah-Ha! DTR (Data Terminal Ready) (Pin 4)

I had shelved this project throughout the week, due to being on out of state service. I went in today, because Saturday is quiet, without interruption.

I fired up the RS-232 sniffing Terminal, and saw the data coming from the test equipment. I started to change the handshaking choices in the terminal program, and got the data to stop flowing. There are radio buttons on the terminal program to enable/disable the other data flow lines on the RS-232 port. With handshaking set to NONE, I toggled on the Laptop DTR (Data Terminal Ready) line (Pin 4), and data began to stream. I toggled off the DTR and the Data Stopped.

Reviewing the 8-pin mini din pin-out on a Micrologix, there is no DTR line.

I tried all of the conventional Loop-back methods by jumpering RTS/CTS 7-8, and DSR/DTR/CD 1-4-6, but still no data flow.

I made a 9-pin breakout cable with terminals at the mid-point to measure logic voltage levels. With DTR off (no data flow) Pin 4 was -3volts. With DTR on (and data flowing) Pin 4 was +6volts.

By merely adding a 5vdc supply to the DTR terminal, we are now streaming the data into the micrologix. Woo-Hoo!

The data comes randomly out of order, so we made the string length TWICE the length of the packet length. Subsequently, we ASCII Extract each character to individual string characters, do a compare to the constant header character.
Once the location of the header charter is identified by compare, we use a pointer to point at the 4 characters of DATA.
Most of the 11 characters fall above the standard ASCII character set, but by manipulation the actual measured values at the test instrument, we saw that ^A=1, ^B=2, ^C=3, etc.

With a few more rungs, we now have a floating point number in the micrologix that is identical to the DMM digital display.
 

Similar Topics

Dear all, I have basic plc question. Why we use hex or binary numbering in plc programming? Can we use decimal instead? Appreciate for your respons!
Replies
4
Views
2,453
Good morning, I am running a controllogix and I am connected to a hydrocarbon gas alalyzer over an EWEB module. I am picking up a Hex number...
Replies
40
Views
13,909
G
I am programing a Rockwell MicroLogix 1500 LRP Series C PLC (Bul. 1764). I need to convert some binary numbers, stored in N (integer) files to...
Replies
0
Views
4,358
Guest
G
Hello, I'm trying to setup a TCP connection from a Compactlogix 5069-L306ER to a TDI checkweigher to receive real-time weight data of the...
Replies
6
Views
315
I am using a Micro 850E PLC (the new one with implicit messaging capability) to drive a Kinetix 5100 servo drive. The error code number on the...
Replies
7
Views
1,698
Back
Top Bottom