hey all,
i'm looking for an elegant way to programm modularly in ladder on mitsubishi q series. the amount of software being developed at the place where i am working right now is expected to increase, so we think it would be good to share some kind of software library between the developers.
it would be an advantage, if we didn't have to change those routines at all, only adjust configuration data, when some piece of the library is used on other hardware.
i'm a bit lost with this one because my background is rather c than automatisation. so far i only came up with one idea that seems feasible to me...
a simple example:
some frequency drive at
X400 (alarm)
Y600 (motor off)
Y601 (motor on)
D1000 (speed)
now i store the configuration data separately in file registers:
R1000: 0 (actual status)
R1001: 400 (input base address)
R1002: 600 (output base address)
R1003: 1000 (register base address)
the library would now contain a subprogram for that very device, like this:
P20:
-[<> FD0 Krunning]-+-------[MOV FD0 Z0]
+-------[+ K1 Z0]
+-------(SET Y0Z0)
+-------[MOV Krunning FD0]
meaning: if it's not already running, SET Y601 (hopefully) and set the state appropriately.
and the main program would call like this:
--||-----[CALL P20 R1000]-
to start it.
unfortunately it looks like it's impossible to create an instance of some gx-developer structure with these data so i could access them from the subroutine like this:
--[<> FD0.status Kbang]----[SET FD0.on]---
...etc. pp.
(or is it?)
any input/comment is greatly appreciated. how do you guys handle modularisation?
thanks in advance!
Volker.
i'm looking for an elegant way to programm modularly in ladder on mitsubishi q series. the amount of software being developed at the place where i am working right now is expected to increase, so we think it would be good to share some kind of software library between the developers.
it would be an advantage, if we didn't have to change those routines at all, only adjust configuration data, when some piece of the library is used on other hardware.
i'm a bit lost with this one because my background is rather c than automatisation. so far i only came up with one idea that seems feasible to me...
a simple example:
some frequency drive at
X400 (alarm)
Y600 (motor off)
Y601 (motor on)
D1000 (speed)
now i store the configuration data separately in file registers:
R1000: 0 (actual status)
R1001: 400 (input base address)
R1002: 600 (output base address)
R1003: 1000 (register base address)
the library would now contain a subprogram for that very device, like this:
P20:
-[<> FD0 Krunning]-+-------[MOV FD0 Z0]
+-------[+ K1 Z0]
+-------(SET Y0Z0)
+-------[MOV Krunning FD0]
meaning: if it's not already running, SET Y601 (hopefully) and set the state appropriately.
and the main program would call like this:
--||-----[CALL P20 R1000]-
to start it.
unfortunately it looks like it's impossible to create an instance of some gx-developer structure with these data so i could access them from the subroutine like this:
--[<> FD0.status Kbang]----[SET FD0.on]---
...etc. pp.
(or is it?)
any input/comment is greatly appreciated. how do you guys handle modularisation?
thanks in advance!
Volker.