Main Content
Change Values of Signals Using C Function Block and Buses
This example shows how to use buses with a C Function block. In this example two Constant blocks supply values. These signals are combined using a Bus Creator block. Code in the C Function block changes the values of these signals. Using a Bus Selector block, the values are displayed separately in two Display blocks.
open_system('mCFunction_BusWithoutCStruct')
The Output Code pane contains code that changes the values of the signals.
Add the symbols used in the code to the Symbols table. To use buses with a C Function block, set the Type of the symbol to Bus: SimpleBus
.