Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

comunication between labview and a microcontroller

hi again,

when I connect the labview and the micro, the comunication is not perfect. With labview I receive perfect the values, but with the micro I receive the first byte two times (repeat). Ex.: I send with labview 25ºC and I receive with the micro 22ºC. I send 18ºC and I receive 11ºC etc.

I don't know what happen. I try to set a slower baud rate but don't work. I try with a faster PIC (16f84A 20Mhz) and a faster oscilator (20Mhz) and don't work, in the LCD screen appear strange characters. But with the 4Mhz oscilator and the 20Mhz PIC work well (repeating the first byte two times of course).

I put a slow value in the condensers (15pF) and don't work.

The last solution is send the values byte by byte with labview, and with a delay of 4ms for example,  what I don't know how to do it.

Does anyone know why the comunication is not perfect?

Thanks a lot!

David.

 

 

0 Kudos
Message 11 of 14
(1,471 Views)
How are you actually communicating with your controller?  The 16F84 doesn't include a built-in uart, so that is going to make any communication you do much more difficult.  I would recommend that you switch to one of the chips with a built-in uart, and then you will probably find your solution much easier to implement.

-tuba
0 Kudos
Message 12 of 14
(1,462 Views)

Hi again,

I need to make it with the 16f84. I think the inter-byte delay can help me, but I don't know how to do it. It is possible with labview 7.1? I only used labview for some mounths and in this moment I think it's not possible. Maybe someone with more experience can help me.

Thanks a lot,

 

David

0 Kudos
Message 13 of 14
(1,425 Views)
Hi

Easy to do, instead of writing a string, convert that string into a byte array, feed that into a for loop (auto indexing)
In that loop put a wait ms function with arbitrary value and a byte to byte array (buid array of one byte only) convert that to a string and send it as singe character string.

It looks a lot but is very fast because all conversions don't take time.
The only time is taken by the wait and the send string (visa)

success
greetings from the Netherlands
0 Kudos
Message 14 of 14
(1,413 Views)