24.01.2015 Views

CoDeSys on CCP XS for Bromma Conquip - Research

CoDeSys on CCP XS for Bromma Conquip - Research

CoDeSys on CCP XS for Bromma Conquip - Research

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Student<br />

Joel Ek<br />

Supervisor at CC-Systems<br />

Fredrik Löwenhielm<br />

Dok Nr<br />

1.0<br />

Date<br />

2006-08-08<br />

Rev<br />

PA1<br />

Säk klass<br />

F<br />

Filname<br />

Thesis.doc<br />

CODESYS ON <strong>CCP</strong> <strong>XS</strong> FOR BROMMA CONQUIP<br />

5 SOLUTION<br />

The methods presented here have been chosen as best soluti<strong>on</strong>s <strong>for</strong> the different isolated<br />

problems that have been analysed.<br />

5.1 Porting of comp<strong>on</strong>ents<br />

This secti<strong>on</strong> shows the whole soluti<strong>on</strong> <strong>for</strong> how a comp<strong>on</strong>ent is ported, including how to<br />

graphically place and c<strong>on</strong>nect comp<strong>on</strong>ents in <str<strong>on</strong>g>CoDeSys</str<strong>on</strong>g> and how the code from <strong>Bromma</strong>’s old<br />

system has been altered in order to functi<strong>on</strong> with <str<strong>on</strong>g>CoDeSys</str<strong>on</strong>g>.<br />

5.1.1 Functi<strong>on</strong> Block with External library<br />

The editors in <str<strong>on</strong>g>CoDeSys</str<strong>on</strong>g> use a declarati<strong>on</strong> part and a body. The declarati<strong>on</strong> part holds all declared<br />

variables divided in input, output and local variables. The body holds text or graphic depending<br />

<strong>on</strong> which language you want to use.<br />

The external ANCI C library can be managed in two different ways; either you put the ANCI C<br />

functi<strong>on</strong>s in the external library or directly in the run-time system. If we use the sec<strong>on</strong>d way we<br />

<strong>on</strong>ly need to declare the different variables used by the comp<strong>on</strong>ent when building our Functi<strong>on</strong><br />

Block. The code <strong>for</strong> the Functi<strong>on</strong> Block will be linked into the program at run-time.<br />

Figure 17: A Functi<strong>on</strong> Block representing a NAND comp<strong>on</strong>ent, the code in the body will be<br />

replaced at runtime.<br />

When the interfaces <strong>for</strong> the comp<strong>on</strong>ents have been declared in the Functi<strong>on</strong> Blocks they are<br />

saved as an extern library, this lead to an automatic creati<strong>on</strong> of a <str<strong>on</strong>g>CoDeSys</str<strong>on</strong>g>-library file and a C<br />

30 (55)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!