Newall Linear Encoder with Red Lion Data Station Compact Logix

amil30

Member
Join Date
Aug 2022
Location
Iowa
Posts
8
Hi, I'm trying to get values from 8 encoders using a 2-wire bus RS485 connection to a Red Lion Data Station. These will ultimately write values to strings in an AB compact logix controller via ethernet. The way these encoders work is that is needs a request signal for a specific encoder ID to receive any data. Here below is essentially the documentation on request needed to receive data.

REQUEST TO ENCODER
ID Command Carriage Return
1 byte X Bytes depending on command 0D(hex)
RECEIVE FROM ENCODER
ID Data Checksum
1 byte 8 bytes 1 byte
ADDRESS (ID)
The encoder only responds to commands if the ID byte responds to the programmed
encoder ID.
COMMANDS:
Command Function Data Returned
RT Request Encoder type 01 (00=RS232 : 01=RS485)
RP Request position 8 bytes position

The other problem is figuring out how to send the correct request data through the Red Lion Data Station code which is in C programming language. We have tried various codes similar to the code shown below:

// declare locals

PortPrint(3,":SRP/r");

//S is the ID, RP is the command to request position

int i;

int j;

int in = PortRead(3, 500);

// loop while there is data in the buffer, populating the array

while(in != -1) {

Array[i++] = in;

in = PortRead(3, 500);

}

// if something was received, build a string

if(i > 0) {

Data = "";

for(j = 0; j <= i; j ++) {

Data += Array[j];

}

}

If anyone has experience with this type of application, any help would be greatly appreciated.

Thanks,
Alex
 
Welcome to the PLCTalk forum community ! This sounds like a neat challenge.

What exact model of Data Station are you using ?

Have you determined if the DataStation is transmitting the data you expect ?

Have you emulated or tested the RS485 wiring and protocol using another interface or utility ?

I actually built a multi-drop custom protocol on RS485 for some Mitutoyo scales a couple of years ago with the Red Lion DSPSX. I'll see if I can dig up some of my notes.

If you can ZIP and attach your Crimson (which 3.x version ?) program that would help too.
 
Hi Ken,

Thanks for the response! A little background on this: This was an existing application that someone before us had done. We were tasked with modifying this project for a new application and we were troubleshooting a couple of our encoder values that we were getting. In the process of viewing the original crimson program, we accidentally wiped it while being required to update firmware before doing anything. Since this was already working, we can be sure our encoders/wiring works.

To answer some of your questions:
1) We're using the same model as you DSPSX
2) Data is transmitting from the Data Station to the PLC since we've been able to manually enter values and see them correctly receiving the data
3) Haven't tried the RS282 since we're implementing a 2-wire RS485 and we know the system was already working before.
4) I'm having a hard time uploading the file now, but will try to get it figured out.

Thanks,
Alex
 
Alex zip that file up and you shouod be able to post it.

Before I do anything when troubleshooting code I look and see if the data being sent out of the DSP is correct. Ive screwed up more that one string coming out. Once you get that string correct then look at the reply data.
 
Trying to send it through a different means now since IT has blocked this forum flagging it as "social media" &#55357;&#56900; is there an easy way to see what data is being sent out? I haven't found a console type tool to really monitor this.
 
I use a software called Docklight. I've been using it for years and years. The free version doesnt allow you to export the serial data. From what I remember the license copy was $30.00 or so. It shows the data back and forth in separate colors and lines. You can see the data perfectly. A few USB adapters and your good to go. You can send and receive data.

I use it alot to make sure the device responds to my data send as I expect it to.


Have you nade sure the baud rate is set correctly in the communication tab? Did you rebuild the database from scratch or did you use the existing and just reload it into the DSP?
 
OT rant

...IT has blocked this forum flagging it as "social media" ...
I can't believe the number of cases posted on this forum, where IT seems to think they are somehow immune from the consequences and justified in taking clueless, ill-considered actions that negatively impact a company's bottom line. They should be fired. For cause.
 
OK so teh price must have doubled over the years. Its now $60.00 USD. Still this is a super cost effective software
 
I do agree with Brian, however, this site shows as not secure probably an SSL certificate out of date so I imagine that IT has a policy to block these sites, happened to me our IT gave way on that one, but only for an hour or so.
 

Similar Topics

I know nothing about simaticnet OPC server. I do know Kepware. I would only ever scale raw to engineering in the PLC, but it is possible to scale...
Replies
5
Views
219
Hello, We are currently working on a project that involves connecting a linear potentiometer to our Beckhoff PLC. After researching, we...
Replies
2
Views
199
hi! Has anyone experience doing linear interpolation for servo motors using omron CJ2M PLC and CJ1W-NJ413 PCU. If you do, can you show me...
Replies
0
Views
161
Hi, I have an application that currently utilizes SEW drives and programming that we are attempting to convert to Allen Bradley CompactLogix and...
Replies
9
Views
1,145
Does anyone know the part number for that plug that plugs into the 1771 devicenet scanner? The manual just says it is a linear plug, its 5 pins.
Replies
3
Views
1,056
Back
Top Bottom