Using functions in GX Deleloper

parky

Member
Join Date
Oct 2004
Location
Midlands
Posts
5,639
The other day I replied to a thread about calling blocks of code conditionally.
Attached is a sample of creating a function block in an FX2N.
The function block is a standard valve control that is called twice as a demo, the function is written as a subroutine using temporary bits/words.
Before calling the routine the bits/words for the valve are passed to the temps, the block called & then the bits/words are returned.
In the attached file the function is a simple one however more complex functions could be written & in this case is only for demonstration.
It will work on GX Simulator & you could use a simular idea on other plc's like SLC.
This may prove useful for some of the less experienced programmers.
 

Similar Topics

I am working on a project on an s7-1200 with an hmi, but I am looking to remove the HMI and substitute its functionality using the User-Defined...
Replies
2
Views
1,884
Hi, I'm getting a bunch of these warnings when I build the program in Connected Components Workbench. The program is legacy code. The program...
Replies
5
Views
2,291
Hello, I am an apprentice and ee student and I have been trying get a slc 5/03 to report temperature data and system status history at a fixed...
Replies
6
Views
3,451
Hello i have created a function in PLC control in the twincat system. the function has been created using ST while the main program is written in...
Replies
2
Views
2,634
Hi I am trying to use a custom built dll in RsView, by using the functions in the dll as if they were functions in RsView itself. I have used...
Replies
1
Views
4,839
Back
Top Bottom