Problem in VISA communication between a Virtual Terminal in Proteus, how can I troubleshoot the error?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to send and receive data using my matlab 2011a to the Virtual Terminal connected via a virtual RS 232 terminal in Proteus Software (V8). I am trying establish a serial communication between the matlab and the Virtual terminal in the proteus.
For serial communication, I have Virtual Terminal at COM1 and the object created at MATLAB at COM2. I have shorted both the terminals using the software VIRTUAL SERIAL PORT by HDD SOFTWARE.

I used the SERIAL function of the matlab to create an object and send data to COM2 which can be received at Virtual Terminal at COM1. After creating the object successfully, I tried sending the data from MATLAB to the Virtual Terminal connected at the COM2 using the function 'fprintf()' which resulted in an error in spite of having generated the output at the Virtual Terminal. After looking over the MatLab forum, I found out the solution here:
As suggested, I downloaded the Agilent IO library and created an object in its connection manager at COM2 as shown in the picture below.

After this, I initialized VISA by following commands:

And after intializing, I initialized 'vser' as shown in the above picture. After that, I established the contact using 'fopen()' and it is done successfully as shown in the picture below. Command window is docked out.

Now I tried sending some data to the Virtual Terminal using 'fprinft()' function as shown in the picture, but this time, the Virtual Terminal doesn't responds at all.

But, when I used 'fgets()' just after the above function, it returns the same response which I had sent using 'fprintf()' as shown in the image below.

After this, I tried writing something into the Virtual Terminal and try to capture the same by using the 'fscanf()' function, but it returns a null value as shown in the figure below.

I can't figure out what is going wrong in the process. I have been trying hard since a week but I have made no progress. I have exactly followed the same steps in the same sequences as presented here. What else can be done to have my output generated at the Virtual Terminal?
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Use COM Objects in MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!