Chapter 5. Function Block Diagram (FBD)234 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C5.1 Note on ReentrancyWhen a function block is created using the FBD language, the wires are created as global variables,not as members. This has two consequences. First, if there are multiple instances of that block in theprogram, the wires will show the values from the last instance executed during the sweep, not thevalues for the instance being viewed. This will give the appearance of incorrect operation whileactually working properly.The second consequence is that function blocks written in FBD are not reentrant. If you havemultiple instances of a block, and one of them can be called by an interrupt, then it is possible for theinterrupt to trigger while one instance of the block is in process, change the values of the wires, andthen return control to the original block. This will result in improper operation.There is a work-around for both of these symptoms, which is to create the wires as membervariables rather than global variables. This must be done manually by creating member variables ofthe appropriate types. You can then right-click on each wire in the FBD diagram and use the ReplaceVariable command to change the wire from a global variable to a member variable.CautionBlocks written in the FBD language are not reentrant.Because of this, if the block is called directly, orindirectly, from an interrupt, the block must not becalled anywhere else in the program, except whensteps are taken to explicitly make it reentrant (seeabove). Doing so can lead to unexpected operation.This applies to basic blocks, parameterized blocks, anduser-defined function blocks written in FBD.