cancel
Showing results for 
Search instead for 
Did you mean: 

Write a char string to PLC using SAP UDS 4.0 and RSLinx

Former Member
0 Kudos

We have the following setup,

XMii 12.0

UDS 4.0

RSLinx as the OPC

I have setup a simple OPC DA tag in a test PLC. I have also setup the alias configuration with groups and items. I am able to read and write numeric values to the PLC.

However, I am not able to write character strings. Even if I set the data type for the item within alias config as a "VarChar", I am not able to write a string to the PLC. It gives a type mismatch error.

Does UDS not support writing alphanumeric characters to a PLC ? What am I missing ?

Regards,

Ramesh

Edited by: Ramesh Yelisetty on Jun 4, 2009 5:45 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ramesh,

Please try follwing things :

1) Change the datatype in PLC to "varchar"

2) Set "server " datatype in OPC server.

3) Also check the length of the datatype in OPC Server.

Please let me know which version of RSLinx OPC you are using?

-Suresh Hiremath

Former Member
0 Kudos

The PLC has data types like String, int bolean, etc. It does not have a "varchar" data type.

What do you mean by "server" datatype ?

The RS Linx version that we are using is 2.42

Regards,

Former Member
0 Kudos

Ramesh,

Check the alias capabilities of the UDS, this will help you to undersatnd tagnames that RSLinx is exposing.

Try to put UDS into Alias mode and make sure you fully populate the Alias section (description, min/max, datatype) and then set the Cache Mode to: Alias.

You may follow below thread to know " how to add an alias"

Regards

Ram Upadhyay

Former Member
0 Kudos

I have already configured the alias.

I am able to read and write integers.

I have set the data type in alias item to"VarChar"

When i pass string data, it errors out with a data type miss match message

Former Member
0 Kudos

Looks like you are not getting all the tags through the OPC Server.

Have you configured the Alias with Dynamic Meta Data or just "Alias" and also set the Cache Mode to: Alias !

Regards

Ram Upadhyay

Former Member
0 Kudos

Hi Ramesh,

Set the datatype to "String" in PLC.

"Server" is a datatype in OPC Server.

If you are not sure about the datatype in PLC,set the datatype in OPC server as "Server". By setting "server" datatype in OPC it will automatically matches the datatype of PLC.Then there is no chance of datatype of mismatch error.

-Suresh Hiremath

Former Member
0 Kudos

What address are you writing to in your PLC? Allen-Bradley PLC's using different addressing schemes for the various data types. Usually, you'd be using the ASCII (A type) or String (ST type) files. What is the exact address you are trying to write to?

Former Member
0 Kudos

The data types on the PLC side are either of "String" or "ASCII" already.

The problem is fixed and it is working now. This is how it works,

The UDS browser does not determine the complete source string. Even if the help says that you should adopt the string from the browser, it may need to be edited to capture or address the exact characters.

It of course depends on how you have defined the TAGs in your PLC.

This is how it goes ... if the source string is [ABC]X:Y<i>... one may have to take it to the level of [ABC]X:Y<i>,Lm,Cn,SCp to get to the right characters. Check the syntax from RSLinx references.

I was ignorant of the source string, since I believed in what the help said and did not verify what I copy-pasted from the browser.

BOTTOMLINE: Cant adopt the source string from the browser as-is, it might need to be edited as per the exact address of the characters.

If i find something new, I will open a new thread,

Please feel free to share. All this conversation has been helpful.

Former Member
0 Kudos

That's precisely what I was asking - the format/syntax of the address in the PLC that you were trying to access. Never count on "generic" OPC browsing to give you correct addresses for anything other than integer and float types. String/text, bit fields, I/O points, and other types will often require "hand editing" the address. Generally, I don't think it is a good idea to talk directly to the PLC - it is much preferable to place an HMI/SCADA package in the middle (and 95% of the time, one already exists) and communicate with that package. It's safer, too - if you were to enable writing to the PLC, and accidentally typed in the wrong address, you could easily cause harm to people, machines, product, or the environment! Factory things go "boom" pretty easily...

Former Member
0 Kudos

Thanks for all your responses. They were very helpful.