IEEE Power Electronics Magazine - June 2016 - 21
Computer
Software
Environment
Memory
Hard Disk
PSIM
Flag File
PSIM
PSIM
Data File
Script
Data File
Control
Script
Script
Flag File
Control
Data
and the simulation proceeds forward. The synchronization is maintained by using flag files, which are updated
after every read and write. The actual read and write
doesn't take place unless the flag files have corresponding flag values in them. The process is then repeated by
the CS, and the simulation is continued.
Use of files for such communication is quite slow and
places extra load on the system resources. In addition,
there is a probability that incorrect data may be read if the
file read by the CS happens before it is updated by the SE
with values for the next cycle. If such a read were to happen, it could cause the entire simulation to go out of sync. It
is also possible that there may be an attempt to write to or
read from the same file at the same instance. This creates
a conflict, and it is never assured that the resultant values
are correct. This can be avoided by using separate files for
directional data and thread safe file handling. However,
using thread safe methods results in time wasted between
cycles as the system is stalled during the time a file is being
accessed by a thread. Also, the files need to be opened and
closed for every read and write. This adds an overhead for
each cycle. For evaluating a large number of cycles and
high sampling frequency, this overhead can become quite
large and add substantial delay to the simulation time. As
a result, the simulation becomes extremely slow even for
simple circuits.
All the bottlenecks due to the use of files can be avoided
by using network pipes or sockets for communication
between the software instance and the CS. Sockets are the
endpoints for communication over a computer network.
They are used for interprocess communications on the
same computer or different computer terminals. Because
they use network ports, they are more optimized for interterminal communications and have an overhead. On the
other hand, pipes reside on the file system in memory and
are faster. Therefore, pipes are preferred for communication between the CS and the SE. Pipes are basic operating
system communication tools that can facilitate fast and
MCU
PIL
Write Access
Read Access
FIG 2 PIL data exchange through text and XML files.
efficient interaction between processes on a PC. The communication is done between pipe servers and pipe clients.
The data transfer through pipes is nearly instantaneous
for small data size. It is also possible to keep the pipe open
for the entire duration of the simulation and close it when
the simulation ends. This eliminates the overhead associated with repeated opening and closing of files. The use of
pipes for PIL greatly increases the simulation speed. This
approach for the PIL communication is represented in Figure 3. The connection between the SE and the CS is made
using two bidirectional pipes. The pipes are full duplex
Computer
Pipe File System
111010......10111
PSIM
Software
Environment
Pipe 1
Control
Control
Script
Data
MCU
111010......10101
Pipe 2
PIL
FIG 3 PIL data exchange through bidirectional pipes.
June 2016
z IEEE PowEr ElEctronIcs MagazInE
21
Table of Contents for the Digital Edition of IEEE Power Electronics Magazine - June 2016
IEEE Power Electronics Magazine - June 2016 - Cover1
IEEE Power Electronics Magazine - June 2016 - Cover2
IEEE Power Electronics Magazine - June 2016 - 1
IEEE Power Electronics Magazine - June 2016 - 2
IEEE Power Electronics Magazine - June 2016 - 3
IEEE Power Electronics Magazine - June 2016 - 4
IEEE Power Electronics Magazine - June 2016 - 5
IEEE Power Electronics Magazine - June 2016 - 6
IEEE Power Electronics Magazine - June 2016 - 7
IEEE Power Electronics Magazine - June 2016 - 8
IEEE Power Electronics Magazine - June 2016 - 9
IEEE Power Electronics Magazine - June 2016 - 10
IEEE Power Electronics Magazine - June 2016 - 11
IEEE Power Electronics Magazine - June 2016 - 12
IEEE Power Electronics Magazine - June 2016 - 13
IEEE Power Electronics Magazine - June 2016 - 14
IEEE Power Electronics Magazine - June 2016 - 15
IEEE Power Electronics Magazine - June 2016 - 16
IEEE Power Electronics Magazine - June 2016 - 17
IEEE Power Electronics Magazine - June 2016 - 18
IEEE Power Electronics Magazine - June 2016 - 19
IEEE Power Electronics Magazine - June 2016 - 20
IEEE Power Electronics Magazine - June 2016 - 21
IEEE Power Electronics Magazine - June 2016 - 22
IEEE Power Electronics Magazine - June 2016 - 23
IEEE Power Electronics Magazine - June 2016 - 24
IEEE Power Electronics Magazine - June 2016 - 25
IEEE Power Electronics Magazine - June 2016 - 26
IEEE Power Electronics Magazine - June 2016 - 27
IEEE Power Electronics Magazine - June 2016 - 28
IEEE Power Electronics Magazine - June 2016 - 29
IEEE Power Electronics Magazine - June 2016 - 30
IEEE Power Electronics Magazine - June 2016 - 31
IEEE Power Electronics Magazine - June 2016 - 32
IEEE Power Electronics Magazine - June 2016 - 33
IEEE Power Electronics Magazine - June 2016 - 34
IEEE Power Electronics Magazine - June 2016 - 35
IEEE Power Electronics Magazine - June 2016 - 36
IEEE Power Electronics Magazine - June 2016 - 37
IEEE Power Electronics Magazine - June 2016 - 38
IEEE Power Electronics Magazine - June 2016 - 39
IEEE Power Electronics Magazine - June 2016 - 40
IEEE Power Electronics Magazine - June 2016 - 41
IEEE Power Electronics Magazine - June 2016 - 42
IEEE Power Electronics Magazine - June 2016 - 43
IEEE Power Electronics Magazine - June 2016 - 44
IEEE Power Electronics Magazine - June 2016 - 45
IEEE Power Electronics Magazine - June 2016 - 46
IEEE Power Electronics Magazine - June 2016 - 47
IEEE Power Electronics Magazine - June 2016 - 48
IEEE Power Electronics Magazine - June 2016 - 49
IEEE Power Electronics Magazine - June 2016 - 50
IEEE Power Electronics Magazine - June 2016 - Cover3
IEEE Power Electronics Magazine - June 2016 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2018
https://www.nxtbook.com/nxtbooks/ieee/pelcompendium_march2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2014
https://www.nxtbookmedia.com