LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a pulse when reading a specific string

Hi!

I'm trying to count the interval between strings that are send wirelessly by 2 arduino boards.

One board send an automatic code every 300ms (Codigo_Maquina_H_v1_0.ino).

The other send the code only when I push the button (Codigo_Maquina_D_v1_0.ino).

One third board receives and reads the codes.

The problem is: the intervals are not counted correctly. Sometimes it count, sometimes not.

***sorry for english, I don't know write right

Anyone have any idea of the solution?

Thanks

0 Kudos
Message 1 of 3
(3,346 Views)

One thing to think about that you may be forgetting is that the LabVIEW code that you are running to count the time that has elapsed is dependent on the OS and everything that is running on it.  Also, you are opening and closing the VISA connection inside of the loop.  Both of these things can, generally, slow down your loop execution.

So, you can remedy the latter to see if that is contributing appreciably to the slow loop rate.

How are you communicating with the Arduino's?  Also, your code only has a single COM port open, how are both Arduinos communicating with the computer?  You mention a third Arduino but I don't understand how you have everything connected and the code running on the third Arduino.

Message 2 of 3
(2,857 Views)

I'm using tree xbees in transparent mode. Just configure the two boards to send the serial to the third board (without arduino).

Understood. That is great!!! I put the visa open close out of the loop and realy the code runs more faster.

But new problems have appeared...sometimes I have strange characters on buffer...

0 Kudos
Message 3 of 3
(2,857 Views)