MATLAB: Is it possible to retrieve file information from multiple targets with xPC Target 2.5 (R14)

fileloadmultipleSimulink Real-Timesystemtargetxpcxpctargetxpctarget.fsxpctarget.ftp

I am communicating with multiple targets from my host machine using xPC Target 2.5 (R14). However, I can only retrieve file information from the last target I loaded using xpctarget.fs.

Best Answer

The ability to retrieve file information from multiple targets using xpctarget.fs and xpctarget.ftp has been added in xPC Target 2.5 (R14SP1).
If you are using xPC Target 2.4 (R14), you need to programmatically set the communication properties of xPC Setup using the SETXPCENV function, switching the communication properties between one target PC and the other target PC prior to using the fs and ftp objects. Use the following code as a guide:
tgpc1=tg.xpc('TcpIp','212.212.212.200','22222') %target pc1
tgpc2=tg.xpc('TcpIp','212.212.212.201','22222') %target pc2
setxpcenv('TcpIpTargetAddress','212.212.212.200','TcpIpTargetPort','22222')
updatexpcenv
ftpobj=xpctarget.ftp
ftpobj.dir %display dir on target PC1
setxpcenv('TcpIpTargetAddress','212.212.212.201','TcpIpTargetPort','22222')
updatexpcenv
ftpobj=xpctarget.ftp
ftpobj.dir %display dir on target PC2