Mitsubishi GX IEC Developer FEND. END Instructions

Michael Bell

Member
Join Date
Mar 2004
Location
Washington England
Posts
96
Hi all,
I have come across this problem when trying to use a CALL, Pointer and RET in GX IEC DEV. The PLC is an FX3U. The program consists of a number of POU's. I am trying to use a subroutine in one of them. If I write the code and compile it seems ok. However when I download to the PLC I get an error 'RET Instruction not found, even though one exists.
I have uploaded the ladder into GX Dev, and I can see the FEND and it is immediately before the END instruction, I have no control over this.This means that the FEND is after the pointer to the subroutine, which is incorrect.
I have no idea what is happening!
Any ideas, thanks.
 
You should't need to do this, in IEc you create a function block something like test, give it input/output parameters etc. then call the function in one of your other programs as many times as you like (note you can call them the same instance or individual instances the latter will put calls to seperate routines) this will automaticaly compile the code as a subroutine.
in reality all it does is:
a x0
= m2000 (temp variable)
a x1
= M2001 (temp Var)
call P1 jump to sub
a m2003 temp var
= y 0

....
fend
P1:
do the code
a M2000
a M2001
= M2003
ret
End
You should not have any need to jump to subs as these are really functions you can create just like siemens.
 
Last edited:

Similar Topics

Hi everyone, I'm working on a Mitsubishi Q series PLC whose code was developed in Mistubishi's GX IEC Developer v7.04. I looked online for GX IEC...
Replies
9
Views
1,363
Hi everyone, I'm working on a Mitsubishi Q series PLC whose code was developed in Mistubishi's GX IEC Developer v7.04. I looked online for GX IEC...
Replies
0
Views
477
I reposted this as I had mistakenly put IX developer in the title (it was a long day) :zzzzz: I have a policy of always verifying code before I...
Replies
1
Views
1,452
In a bit of trouble regarding Mitsubishi softwares. I am working on this programming softwares (PLC - GX-IEC Developer v7.04 and HMI - E-Designer...
Replies
3
Views
4,687
As per title, looking at how to scale an input, 4-20mA to a real value. Taking it in as an integer (RAW data)and converting it to a real, being...
Replies
0
Views
2,009
Back
Top Bottom