LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa open and close with "for loops"

Hello everyone

In my program I used two "for loops" which include visa write and read for a RS32 port. it is not possible to close a devise with visa close as the out put is changed to 2D array!!! would you please help me with this error

0 Kudos
Message 1 of 9
(2,991 Views)

Right-click on the output tunnels to turn off the autoindexing.  If using LabVIEW 2012, then it is "Last Value" for the tunnel type.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(2,988 Views)

Thanks for reply,

It works for "for loop" but what about "event structure loop" still is error for that. 

0 Kudos
Message 3 of 9
(2,983 Views)

Hi sam,

 

disable indexing of "VISA resource" wire output tunnels in every loop in every (event) case...

 

Btw.:

- It's no good idea to have events running for long/undetermined periods of time. Really!

- It's no good idea to hide (or even delete?) labels of controls/terminals...

- It's no good idea to start coding with a lot of local variables. They tend to lead to race conditions...

- It's a good idea to clean up a block diagram. It is easier to read then...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(2,977 Views)

@sam009 wrote:

Thanks for reply,

It works for "for loop" but what about "event structure loop" still is error for that. 


Right-click on the output tunnel and uncheck "Use Default if Unwired".  You will now be forced to wire the VISA Resource through each case.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(2,958 Views)

Dear Gerdw

thanks for reply,

-I put 1000 ms for event stuctre time out if you mean that.

-the labels were hiden for better reading. anyway the progam with full lable is attached.

-just 3 local variables are used do you think it makes a problem.

and sorry I didn't understand what do you mean by disable indexing.

thanks

sam 

0 Kudos
Message 6 of 9
(2,953 Views)

I unchecked "Use Default if Unwired" and error is this:

"The type of the source is 1-D array of
VISA session of class.
The type of the sink is VISA session of class."

 

0 Kudos
Message 7 of 9
(2,949 Views)

@sam009 wrote:

and sorry I didn't understand what do you mean by disable indexing.



You need to do the same thing to the tunnel for the VISA wire on the innermost For Loop that you did for the For Loop that is a couple steps out.

 

As Crossrulz said in his post "Right-click on the output tunnels to turn off the autoindexing.  If using LabVIEW 2012, then it is "Last Value" for the tunnel type."

0 Kudos
Message 8 of 9
(2,928 Views)

Thank both of you,

I did and problem solved. thanks 

0 Kudos
Message 9 of 9
(2,920 Views)