I connected the soundbar to my Samsung UE40J5170 TV with a Toslink cable. This works as desired and the volume can be adjusted individually for the TV and soundbar with the respective remote controls.
The connection between the TV and the soundbar is wireless and must be set up with the TV menu and the remote control of the soundbar according to the operating instructions.