How to use SimulinkRealTime.target/getsignal on bus signal?
The documentation for simulink realtime `getsignal` https://www.mathworks.com/help/slrealtime/api/slrealtime.target.getsignal.html says that the output can be a struct if the signal is a bus.
I made a nonvirtual bus signal. See screenshot below.
The signal is not in the list of signals when I use `tg.ShowSignals = ‘on’;` and display `tg`. See attached file output.txt
I have tried attaching a gain block to the bus output. The gain block signal is visible and I can call getsignal on it, but getsignal returns a single double which seems to be the first of the 6 bus elements. I want the all 6 elements of my bus in one struct. (I want to use a bus signal and getsignal the bus signal because calling getsignal 6 times is too slow for the matlab program I am trying to write.)
Thanks in advance for any help.The documentation for simulink realtime `getsignal` https://www.mathworks.com/help/slrealtime/api/slrealtime.target.getsignal.html says that the output can be a struct if the signal is a bus.
I made a nonvirtual bus signal. See screenshot below.
The signal is not in the list of signals when I use `tg.ShowSignals = ‘on’;` and display `tg`. See attached file output.txt
I have tried attaching a gain block to the bus output. The gain block signal is visible and I can call getsignal on it, but getsignal returns a single double which seems to be the first of the 6 bus elements. I want the all 6 elements of my bus in one struct. (I want to use a bus signal and getsignal the bus signal because calling getsignal 6 times is too slow for the matlab program I am trying to write.)
Thanks in advance for any help. The documentation for simulink realtime `getsignal` https://www.mathworks.com/help/slrealtime/api/slrealtime.target.getsignal.html says that the output can be a struct if the signal is a bus.
I made a nonvirtual bus signal. See screenshot below.
The signal is not in the list of signals when I use `tg.ShowSignals = ‘on’;` and display `tg`. See attached file output.txt
I have tried attaching a gain block to the bus output. The gain block signal is visible and I can call getsignal on it, but getsignal returns a single double which seems to be the first of the 6 bus elements. I want the all 6 elements of my bus in one struct. (I want to use a bus signal and getsignal the bus signal because calling getsignal 6 times is too slow for the matlab program I am trying to write.)
Thanks in advance for any help. simulink, matlab MATLAB Answers — New Questions