Problems with Beckhoff plc and .Net app

Joel1334

Member
Join Date
May 2009
Location
Halland
Posts
3
Hi!
I'm building an HMI i .NET and for some reason i can't write or read the string from my PLC! Why is that?

this is how my code looks like right now:


PLC:
HMI_AktParIns: STRING;

global in .NET app:
Public HMIaktparaminst = ".HMI_AktParIns"

Read from plc:
VarParamInst = TcClientSync.ReadVar(HMIaktparaminst)
txtAktParamInst.Text = CStr(VarParamInst)
System.Diagnostics.Debug.Write("ReadVar:" & VarParamInst)

Write to plc:
varAktparamInst = CStr(System.IO.Path.GetFileNameWithoutExtension(openFileDialog1.FileName))
System.Diagnostics.Debug.Write("WriteVar:" & varAktparamInst)
Call TcClientSync.WriteVar(HMIaktparaminst, varAktparamInst)
 
Hi there Joel.

I think that you need to be a bit more specific about what you are planning to do… I assume that your are not communication thru a OPC, are you sending TCP/IP telegram?

Do you get any exception thrown back at you from your runtime?

I´ve seen that you have been asking some questions about this in a computer developing forum (pellesoft)
but I´m sure that someone here can help you (don’t think many people there are well familiar with plc´s and communication between PLC-PC) :rolleyes:

Best Regards.

//e
 
There is a .Net dll called TwinCAT ADS.NET.

If you look in the reference manual and the method called TcAdsClient.ReadAny, It says...

Reads data synchronously from an ADS device and writes it to an object. If the Type of the object to be read is a string type,
the first element of the parameter args specifies the number of characters of the string.
If the Type of the object to be read is an array type, the number of elements for each dimension has to be specified in the parameter args.
At the moment only 1 dimensional Arrays are supported.

public object ReadAny(int,Type,int[]);

Maby this can help you... Check out the beckhoff site

There is a guy called Archie Jacobs (username: Archie) here that works alot with Beckhoff(I think :rolleyes:), maby he knows and can help you...

Regards.
 

Similar Topics

Hello, Im trying to configure a CANOpen master klemme (EL6751) to communicate with a device (Jetter JXM-IO-E09-G07-K00) in the System Manager, I...
Replies
1
Views
4,561
We have an AB SLC 5/03 that's been running since 1999 with a Beckhoff BK5200 connected to it. Just in the last month or so the BK5200 has been...
Replies
0
Views
1,533
We have a Beckhoff CX9000 running the TwinCAT Visualization on a CP7829 used as a motion controller. It is set up to jog the axis, using the F11...
Replies
1
Views
3,125
Help wanted !! I have a Beckhoff CX1000 with Windows XP installed. On a laptop i have installed TwinCAT PLC. From the Laptop I perform a...
Replies
1
Views
3,591
Unregistered
U
Hi, having some issues with scalings (SCP commands) with some Vegapuls 65 guided wave radar level transmitters. I've set the min/max in the...
Replies
3
Views
90
Back
Top Bottom