0

I'm trying to understand how to access and use the Bus system with custom S-Function Blocks. I built a very basic S-Function using the S-Function Builder which has no input and one Bus output. The Bus is a struct consisting only of one field of type double. This works just fine.

No I tried to connect its output to a newly created block (also with help of the S-Function Builder) which has one Bus input and no output. It should write the value of the only field inside the struct to the console using mexPrintf. But the value is always 0 (zero)

I set the output of the first block like that in the output wrapper function (works fine):

out0->data = 12;

and I try to get the input value inside the other block like this (prints always 0):

real_T insig = in0->data;
mexPrintf("Got a %d", insig);
Roberto
  • 713
  • 8
  • 14

1 Answers1

1

Stupid error - I was using %d instead of %f for printing a double value...

Roberto
  • 713
  • 8
  • 14