IEC 61131-3 compliance and Rx3i

Ozpeter

Member
Join Date
Aug 2014
Location
Virginia
Posts
124
I was poking through the Stackoverflow PLC Tag when I saw this answer to a question about converting a Real to a DWord and back again.

What caught my eye was the use of the UNION data type and I went D'Oh as this could have more easily solved a data mapping problem I recently had. So I lept to my trusty Machine Edition and wanted to see how I could replicate this code in Structured Text on an Rx3i.

And that's where I hit a wall. It seems that GE doesn't support the the UNION data type (or I am really really stupid - but I am betting on the former).

This made me sit back and think "How compliant is GE with IEC 61131-3 languages?". I also thought "Is UNION a brand specific extension to Structured Text?".

I went googling and couldn't find any obvious answers to my questions. So can anyone help me out here?
 
I know nothing about GE Machine edition but if it allows "markers" with addresses, then you can usually define 2 variable at the same address and get a similar effect as a union.

So If you define these
Code:
	MyDword AT %MD48: DWORD;
	MyReal	AT %MD48: REAL;

When you write to MyReal with a real number it is available in MyDword as a DWORD and vice versa.
 
I know nothing about GE Machine edition but if it allows "markers" with addresses, then you can usually define 2 variable at the same address and get a similar effect as a union.

I'm well aware of that (and use it all teh time), but what I was trying to do involved Words and Bytes. GE has crappy support for Byte variables, so a UNION could have been an alternative.
 
I was poking through the Stackoverflow PLC Tag when I saw this answer to a question about converting a Real to a DWord and back again.

What caught my eye was the use of the UNION data type and I went D'Oh as this could have more easily solved a data mapping problem I recently had. So I lept to my trusty Machine Edition and wanted to see how I could replicate this code in Structured Text on an Rx3i.

And that's where I hit a wall. It seems that GE doesn't support the the UNION data type (or I am really really stupid - but I am betting on the former).

This made me sit back and think "How compliant is GE with IEC 61131-3 languages?". I also thought "Is UNION a brand specific extension to Structured Text?".

I went googling and couldn't find any obvious answers to my questions. So can anyone help me out here?

I think there was a revision to IEC 61131-3 in the past decade that added a bunch of advanced object oriented features that I haven't seen catch on much. UNION could be part of that, maybe?

I've never heard of it, at the very least, tho it does seem useful.
 
I think there was a revision to IEC 61131-3 in the past decade that added a bunch of advanced object oriented features that I haven't seen catch on much. UNION could be part of that, maybe?

I've never heard of it, at the very least, tho it does seem useful.

When I as googling this morning I discovered IEC 61131-3: Additional language extensions which is a blog entry belonging to Stefan Hennekan and he has a lot of Structured Text topics. That particular blog entry mentions TwinCat 3, so I am thinking that these may be Beckhoff specific extensions? But I am not sure.

That blog has a bunch of other really interesting topics in it as well. So perhaps I need to get the current IEC 61131-3 spec and do a deep dive into it.
 
Here is the online help from CoDeSys from 3S. So at least packages based on CoDeSys 3.5.13 and above should have support for the UNION.

Elsewhere in the documentation it mentions that UNION is an extension to the 61131 standard.

Union.PNG
 
Here is the online help from CoDeSys from 3S. So at least packages based on CoDeSys 3.5.13 and above should have support for the UNION.

Elsewhere in the documentation it mentions that UNION is an extension to the 61131 standard.

I found that section in the CodeSys site and then googled Extended Structured Text which landed me on the Beckoff site (again) where it says
“Extended Structured Text (ExST)” is a TwinCAT-specific extension for “Structured Text (ST)”, as defined in the IEC 61131-3 standard

But I still couldn't find a simple list of those extensions!

Fun observation - The CodeSys help looks like copy pasta from Beckhoff.
 
FWIW I just dug up a reference to the IEC 61131 standards and for all 9 documents it's about $USD2300 (for soft copies!). But the programming language document (IEC 61131-3) is only $USD350 :D

And the latest 61131-3 stand was updated in 2013, but may be updated again after 2019
 
Fun observation - The CodeSys help looks like copy pasta from Beckhoff.

I would think it would be the other way around. Codesys basically exists to be brand labeled; I think twincat 3 is codesys 3?

^information above is not based on actual first hand knowledge, but only my already questionable memory of things others have said. Trust at your own risk...
 

Similar Topics

Hello, I have a small programming task that I need help solving. I have to: * Create an analog input (4-20v)and a digital output * The analog...
Replies
45
Views
25,060
I am looking for some expert advice. I have always made function blocks both with inputs and outputs and without inputs or outputs. I make the...
Replies
21
Views
6,703
Hello and happy new year! I would like to further understand who needs to design by this standard and is it a requirement for everyone or only...
Replies
3
Views
1,774
So Ladder is easy to read graphically, most everything can be coded in ladder, and it represents wiring diagrams the closest. SCL and ST are good...
Replies
5
Views
1,711
Hello, I have been looking at the Yaskawa website for documentation on G-code sample programs. I was unsuccessful at finding any IEX 61131-3...
Replies
9
Views
2,769
Back
Top Bottom