LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Problem (within Loops?)

Hello, the screen capture I have attached shows the area of concern of my problem. If you open the VI there is a little more material to the right (the bottom 2 loops I believe are irrelevant). So in the screenshot, you can see a case structure within a while loop but I did not have these before and the code executed perfectly (executed all the VISA commands). Now, after I added the structures, I am getting this error: 

 

VISA Read or Write Timeout Error -1073807339

 

I included these loops so that there is user interaction: If I press the "Run Profile" boolean which I have configured to latch when released, the VISA commands within the case structure should run. There is a string indicator labeled "Ramp Rate" which even though I have this error, displays the corrects values for every iteration, so there is definitely some successful communication. Does anybody have any idea why VISA suddenly is not communicating? If you look at the last VISA read write command I included for troubleshooting purposes, (the *IDN? with a string indicator) even that simple command does not yield any result. 

 

This worked before so I know I must have some dataflow error or something...

Download All
0 Kudos
Message 1 of 2
(2,099 Views)

You're closing your serial port inside the loop.  Any of the settings you did before the loop such as enabling the termination character probably came undone.  VISA ports will open themselves automatically, but probably with default values.  Things like the termination character that you told it to send by property nodes probably aren't happening on the later iterations of your code.

 

I prefer explicitly include the termination character in the string going to the VISA Write rather than using those property nodes.  That might have prevented you from seeing a problem here.  But I believe the actual problem is the VISA Close inside the loop.

0 Kudos
Message 2 of 2
(2,091 Views)