Control Logix + Rslinx +Delphi

nicoceledon

Member
Join Date
Feb 2010
Location
Concepcion
Posts
4
Hi guys, i've got a question here. I actually i wasn't sure in which fourm post the question, but tlet's give it a try.

I want to develop an application on DELPHI 2007 to get data from the PLC.

What i've done:

Get the Data with Excel:
put the following line in a cell, and that's it
= RSLINX|CSA_AWA!temp1

My situation:

I'm a studen with NO experience with DDE protocol, or DELPHI programming.
I have to use DDE because that's what my boss told me.


I think that the problem is on the DELPHI side. i know that this might be missplaced, but maybe someone have done something similar

PS: I have a 1756-L61 Procesor with a 1756ENBT/A Ethernet module.

If someone could help me, would be great.
 
Ask your boss if you may use OPC instead. RSLinx actually support both, but it is easier to deal with OPC then DDE.
By the way, what is the problem?
 
i made it

Well the problem was that i couldn't get the data.

I've just made it. The problem was:

-I did the Client configuration, which is Server(RSLINX), Topic(CSA_AWA) and open the conversation or topic.
-I did the Item declaration, temp1.

But while i was reading the few functions that TDdeClientItem has, I found that one of them was for make the link between ClientConv and Item(Now it seems pretty obvious). so that was it, pretty simple.... but still got me hanging for a few hours.

that's for that reply val_99
 
Here is a sample of a way to use OPC with Delphi
I will post some more in the near future.
Steve.

{OPC Example for Nicoceledon}
{OPC Server = RSLinx}
{Topic = CSA_AWA}
{Item = temp1}
{Needs OPC components from Kassl http://www.dopc.kassl.de}
{Written with Delphi 5 but should be ok with any version from 5 and up}
{There are other ways to do OPC. See http://www.opcconnect.com/delphi.php}
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
uOPcWriter, StdCtrls, dOPCIntf, dOPCComn, dOPC; {Manually added uOPcWriter}
type
TForm1 = class(TForm)
dOPCServer1: TdOPCServer;
Edit1: TEdit;
WriteButton: TButton;
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure dOPCServer1Datachange(Sender: TObject; ItemList: TdOPCItemList);
procedure WriteButtonClick(Sender: TObject);
private
{ Private declarations }
FirstActivation: boolean;
OPCWriter : TOPCGroupWriter;
OPCGroup : TdOpcGroup;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
FirstActivation := true;
end; {FormCreate}
procedure TForm1.FormActivate(Sender: TObject);
begin
if FirstActivation then
begin
FirstActivation := false;
dOpcServer1.ServerName := 'RSLinx OPC Server';
dOPCServer1.OPCGroups.Add('Sample');
OPCGroup := dOpcServer1.OPCGroups.GetOPCGroup('Sample');
OpcWriter := TOPCGroupWriter.Create(OPCGroup);
{Add items here}
OPCGroup.OPCItems.AddItem('[CSA_AWA]temp1');
dOPCServer1.Active := true;
end;
end; {FormActivate}
procedure TForm1.FormDestroy(Sender: TObject);
begin
OpcWriter.Free;
dOpcServer1.Active := false;
end; {FormDestroy}
procedure TForm1.dOPCServer1Datachange(Sender: TObject; ItemList: TdOPCItemList);
var
i: integer;
begin
for i := 0 to ItemList.Count-1 do
begin
with ItemList do
begin
if IsGoodQuality then
begin
{Read items here}
if (ItemId = '[CSA_AWA]temp1') then Edit1.Text := ValueStr;
end;
end;
end;
end; {dOPCServer1Datachange}
procedure TForm1.WriteButtonClick(Sender: TObject);
begin
OpcWriter.Clear;
{Any items used here must have been added in the FormActivate section}
OpcWriter.AddItem('[CSA_AWA]temp1', Edit1.Text);
OpcWriter.WriteItems;
OPCGroup.Refresh(false); {Optional}
end; {WriteButtonClick}
end.
 

Similar Topics

I have RSLinx 2.52 running on windows 2000, connected to a control logix through ethernet. I can see all devices in rack, and can access...
Replies
3
Views
1,948
Hello, I have a new CLX, I powered it up downloaded the firmware, configured the I/O's, but I have two cards left a Enet and a DHRIO Anyone...
Replies
13
Views
4,834
Hi, I am trying to send a constant value to the PLC..input module using RSLinx OPC server, but the value is being set to 0 and then to user...
Replies
4
Views
4,650
I have RSLinx Professional 2.42 A 1756-ENBT module and a 1756-DHRIO, Control Logix L62. I have everything working so far. Is there anyway to...
Replies
6
Views
3,671
I am having trouble with getting no control of my analog output signal. I am using the SCL function block to control my analog output. The logic...
Replies
11
Views
243
Back
Top Bottom