MATLAB: Writing Data into OPC Simulink Blocks

opcopc toolbox

Im totally new to these OPC blocks and was trying out the functions
I noticed that when i tried to write things into the OPC Write block and read it, the output from the reading always give me a slight delay (abt 0.1s).
Is it because the OPC blocks are programmed this way? And is there any ways to bypass this problem such that whatever i write will be shown in the read ouput instantly?
And also how do i write array into the OPC write block in simulink? I used (1×3) array but it says that the input for write block is 1 only when it should be able to take an array of any size. (Tested out in the OPC GUI and it can take any (1xn) array size)

Best Answer

Yes, I believe your 0.1s delay is because of your chosen fixed-step sample time. The output of the read block will only update every sample time, i.e. every 0.1s. Simulink needs to write to the server before it can read from it, hence the delay. If you change your sample time, you should see a different delay.
The write block will accept signals of dimension >1, but you must specify as many items in the block dialog as the width of the input port.
HTH,
Arnaud
Related Question