From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Serial Data from Arduino using labview VISA?

Solved!
Go to solution

Is it possible reason because i'm doing some filtering in my loop so that could spent certain amount of time and slow down the sistem that it could not read the bytes fast enough?

0 Kudos
Message 21 of 141
(9,357 Views)

One thing that you should not be doing is use the VISA Bytes at Serial Port. You have enabled the termination character so you just need to set the VISA Read to some high byte count. It will automatically terminate when the termination character is detected.

 

Some of your processing, such as the Insert Into Array, is not very efficient and you could also be building some large arrays in the shift register. If you want this to run for a long time, you need to limit the size. I would also suggest the Build Array instead of the Insert Into Array.

Message 22 of 141
(9,333 Views)

Thank you. I will have to run this vi for aprox. 15min. So is there a problem with the processing stuff inside the loop? When i look at the highlight execution i see that the error comes from the read block.

0 Kudos
Message 23 of 141
(9,322 Views)

I put the block with the bytes at port away and set the byte count at the read block to 2000. Also changed insert into array with bulid array. But i still get the same error. Where could be the reason for this kind of error:ISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

0 Kudos
Message 24 of 141
(9,319 Views)

@john111 wrote:

I put the block with the bytes at port away and set the byte count at the read block to 2000. Also changed insert into array with bulid array. But i still get the same error. Where could be the reason for this kind of error:ISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.


The aim was not to stop you from using bytes at port.  You are either going to use bytes at port in a loop until the buffer runs dry, or you are going to terminate the read on a certain character, but not both at once.  The way your equipment communicates determines how you are going to handle the read!  There are so many, many many threads regarding communications with this intrument.  I'm sure you can get your answers by doing a search of this forum.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 25 of 141
(9,305 Views)

It seems like the problem is with the ftdi-usb chip in the arduino nano. Because when i run the exact same code on arduino uno there are no problems with this error in labview. I was looking on the forums and they suggest that you should put the latency timer on 1ms(instead of16ms). But there is no difference. I also update the drivers and try the example of read.vi... I don't know what else to do.

0 Kudos
Message 26 of 141
(9,284 Views)

Is it possible that thoso problems are because when i want to end my program i press abort execution instead of stop condition in while loop?

0 Kudos
Message 27 of 141
(9,278 Views)

@john111 wrote:

Is it possible that thoso problems are because when i want to end my program i press abort execution instead of stop condition in while loop?


If you use the abort button, there is no cleanup.  VISA sessions stay open, serial ports stay open, etc... whenever I have to use the abort button, I always have to shut down LabVIEW and restart it.  You should never use the abort button as the normal way to stop a running VI.  The first thing I do when creating a VI that I know will have a loop is to have a graceful way to exit.  The method of exiting will evolve, but it almost always starts out as a simple "Stop" button.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 28 of 141
(9,270 Views)

Hi!

I want to read data from arduino connected with zigbee using labview visa. But i am having 4 channels to read. 3 for pressure & one for accelerometer. pl. tell me how I can seperate it & show different graphs.


@Jazlan wrote:

Hi =). Im a beginner working reading serial data from an arduino but im facing... Lets do this step by step

 

I constructed a voltage divider circuit that gives an output ranging from 0 to 5V. The output of this circuit is sent to an analog input pin 0 of an Arduino Duemilanove board.

 

1) Firstly I plugged in the cable connecting my laptop USB to the arduino board.

 

2) I went to start->control panel->system->hardware->device manager. Check out Ports(COM & LPT). In my laptop I can see USB Serial Port (COM4). Now I know in Labview I have to read serial data from COM 4.

 

3) For the arduino side, here is the code to read voltage variations inputted to analog pin 0. The last line 'delay' determines the sampling rate of how we want to sample the voltage divider output:

 

int potPin = 0;    // select the input pin for the voltage divider output
int val = 0;       // variable to store the value coming from the sensor

void setup()
{
  Serial.begin(9600);    // opens serial port, sets data rate to 9600 bps
}

void loop() {
  val = analogRead(potPin); // read the value from the voltage divider
  Serial.println(val);
  delay(10);
}

 

I have slightly modified the basic serial read write VI.. I have attached the block diagram used with comments. Basically I tried to read serial data, divide by 1023 and multiply by 5 in order to graph voltage variations from the voltage divider circuit.  However Im not getting the correct voltage output values . The voltage value just keeps going to 0 and coming again as shown in the pic.

 

Could you guys please guide me on what went wrong?

 

Thanks!

 




0 Kudos
Message 29 of 141
(9,095 Views)

j'ai une carte arduino mega2560; j'ai un capteur ultrason, et j'ai le logiciel labview2011, je cherche de fonctionner le capteur sur arduino sur le port série TX/RX, avec une supervision sur labview,

capteur ultrason: DYP ME007TX

arduino mega2560

merci

0 Kudos
Message 30 of 141
(9,047 Views)