I am using an external PSU (RIGOL DP832) and I would like to set the voltage and current using simulink but I am not able to do it with simulink.
I am using the Instrument Toolbox and the Support Package for Keysight IO Libraries and VISA Interface. For matlab it is straight forward, this is the code
PSU = visadevlist();
vi = visa('agilent',PSU{1,1});
fopen(vi);
fprintf(vi, ':INST CH2');
fprintf(vi, ':VOLT 27.3');
fclose(vi);
but with simulink I am not able to send the value of a variable to the PSU. I am using the To Instrument block, and this is my simple simulink diagram,
and these are my properties
Any idea how to do this? I am also open to other alternatives, but I need parametric input for simulink


I'm not familiar with the block but having read the documentation I'd suggest the following
Change your command to
The block will then add the value from the inport of the block to the end of the above command.
In your example you've added the voltage as a fixed value in the command string.