Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't see port in terminal emulator after controlling it with VISA

Solved!
Go to solution

Hello,

 

I created a LabVIEW VI to control the duty cycle ratios of PWM channels on a FRDM KE02Z microcontroller. The microcontroller, programmed in CodeWarrior, is set up to receive a string from a terminal input and break it down to two parts (channel name and ratio) which are then applied to the PWM. The code works and I tested it with Termite 2.9 and a logic analyzer before controlling via LabVIEW. The problem I've been having, however, is that I have to completely close LabVIEW in order to see the port on Termite again and vice versa.

 

Previously, I had problems with the VI after I opened anything else besides it, even an almost identical VI, so long as it used the same port. I would get errors and be unable to get my VI to work again unless I restarted LabVIEW. I was able to remedy this by adding a VISA Flush I/O Buffer as per an earlier discussion (http://forums.ni.com/t5/LabVIEW/Timing-issues-with-Serial-Read-Write-can-t-acheive-terminal/m-p/2636... after the configuration of the Serial Port and at least now I can jump between VIs. I am still unable to see the port jumping between LabVIEW and Termite unless I close one; VISA Close and closing the VI aren't enough, I have to close LabVIEW itself. Is it possible to achieve this just within the VI? By using a VISA Flush or VISA Clear at the end (before/after VISA Close) for example? If so, what is the difference/preference between them?

As I mentioned before, the VI is functional but I would like to know what is going on for future considerations. Would appreciate any advice.

Hope to hear from you,
Yusif Nurizade

0 Kudos
Message 1 of 3
(4,687 Views)
Solution
Accepted by topic author Akello

You haven't wired the VISA Resource Name through the Stop event so it's not closing anything.

0 Kudos
Message 2 of 3
(4,683 Views)

Wow.

 

Hi, my name is Yusif and I make stupid, obvious mistakes.

 

Thanks for pointing it out to me, I have no idea how I managed to miss that.

 

Best,

Yusif Nurizade

0 Kudos
Message 3 of 3
(4,658 Views)