LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ControlLogix String Data Type

 Labview 2009/DSC

I’m having a hard time to create a bound variable to a AB ControlLogix string tag. I’m able to create a variable of a single character but this means I have to have 82 variables per string.

Is there a better way to do this.  I want to "Data Bind" the tag to a string control to have read and write access.

 

Thanks

0 Kudos
Message 1 of 6
(6,372 Views)

JuergenO,

 

Hello! First of all, the document on our website, Connect LabVIEW to Any PLC Using OPC, is a great resource for applications like yours. If you haven't seen it before I reccomend taking a look at it.

 

The bound variable that you are creating. What data type is it? Is it a string data type?

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 2 of 6
(6,347 Views)

Hi Ben,

 

Thanks for responding.

I don't have a problem with the opc server or connecting to the plc. The problem is the Controllogix String data type. The data type is a assembly of String.LEN = Datata type Int32 and String.Data = array of 82 Int8 (String.Data[0] - String.Data[82].

I can create a bound variable by selecting e.g. String.Data[0] which is the first char of my string. But i can't select String.Data and receive a variable with the complete string.

My bound variable is a string data type.

 

Is there a way to create a bound variable from String.Data?

 

Thanks

 

0 Kudos
Message 3 of 6
(6,337 Views)

JuergenO,

 

Have you tried to make your Variable have the data type of an Array of Int8? You could then take the whole String.Data into LabVIEW.

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 4 of 6
(6,321 Views)
Hi Ben, I did some more testing with the ControlLogix tags. I'm able to create a String Bound Variable if:1. The string is a single AB String tag2. The string is in a single dimensional array of AB String tag. I can't create a String Bound Variable if:1. The string is in a UDT (User Defined Data Type) 2. The string is in a 2 or more dimensional array of AB String tag. The strings I tried to read and write are embedded in UDT's which is a common way to group tags.

Is there anything I have to do different for UDT's and array's?

 Thanks Juergen

 

0 Kudos
Message 5 of 6
(6,296 Views)

JuergenO,

 

To make a bound variable to a 2D array of strings you'll have to follow the steps in this document:

 

How Do I Make a 2D Shared Variable?

 

As far as the UDT's go, it is my understanding that they are for readability purposes and are still a "real" (string, bool, I32, etc) datatype. As long as you know the underlying datatype, I would think you could still talk to it. However, it seems you're saying that a simple UDT (that is really a string, and not 2D) isn't working, but that same string not in a UDT does work. Is this Correct?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 6 of 6
(6,277 Views)