ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA: (Hex 0xBFFF00A6) The connection for the given session has been lost.

Hi,

I'm completely new to Labview but I'm trying to learn something.

 

I get this error, while trying to connect to Mega 2560 --> VISA: (Hex 0xBFFF00A6) The connection for the given session has been lost, but one hour ago it worked...I did not change anything...

Could someone help me?

 

Thank you in advance!

0 Kudos
Message 1 of 9
(3,639 Views)

Can you show/upload your VI?

I guess that the connection reference is being held somehow - maybe restarting LabVIEW will temporarily fix your issue, but I guess it will reoccur if so without a more permanent fix.


GCentral
0 Kudos
Message 2 of 9
(3,630 Views)

How are you connected to your device?  What VISA session are you using?


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 3 of 9
(3,626 Views)

dipsy18_0-1617119198472.png

This is what I did...It did not properly do what I expected, but anyway it compiled...

0 Kudos
Message 4 of 9
(3,624 Views)

Your use of a Loop here is a little strange - what do you want to do?

Are you trying to make a single write/read pair, or to poll something repeatedly?

In either case, a For loop is probably the wrong tool (for the first, no loop, for the second, a While loop).

 

You also want to call VISA Close at the end of your VI, and some sort of Initialization at the beginning (depending on device, perhaps VISA Configure Serial Port or VISA Open).


GCentral
0 Kudos
Message 5 of 9
(3,616 Views)

I wanted to append to an array each letter composing a word I give at the input, that's why I use a for loop with that N... I'm trying to learn something regarding LabView since 2/3 days...I'm sorry if I did something terrible..

 

Should I do this in different and easier way? I guess yes...

 

Thank you!

0 Kudos
Message 6 of 9
(3,598 Views)

So you want to send one letter at a time? Or is the sending separate to the displaying?

String can't be autoindexed, so if you want a single letter at a time you need something like this:

cbutcher_1-1617120012883.png

 

 


GCentral
0 Kudos
Message 7 of 9
(3,592 Views)

I previously send all the letters, such as: Hi!

Then, for the serial reading I read 1 letter at a time and would like to put each one into an array, in different indices.

For example: write "Hi!"

Read a row array with 3 elements containing H i !

 

I don't know if I am clear enough in the explanation, but the aim should be this

 

Thank you for your help up to now

0 Kudos
Message 8 of 9
(3,586 Views)

Ok, so you want a program which sends a string with multiple characters to your Arduino, and then the Arduino code will echo the letters one by one back?

Are they echoed with a line termination character? Are they written separately (by the Arduino) or is the string just directly echoed and you only want to read it a single letter at a time?

 

If you want to read a single character, set the "bytes to read" input to VISA Read to 1.

Note that you'll get a warning (not an error) telling you that there might be more bytes available to read.

 

You can then index them out of the loop into an array.

If they're echoed slowly and you want to update the array between Reads, you'll need to put it inside the loop and use a Shift Register or Feedback Node to store the "history".


GCentral
0 Kudos
Message 9 of 9
(3,576 Views)