LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview data type to microcontroller

Hi,

 

I want to send data from labview to a PIC 16F876A, my question is can I only write values from 0 to 255 or I can send bigger values (like 5000) that the PIC could read the same value.

 

Thanks.

0 Kudos
Message 1 of 11
(4,400 Views)

How are you communicating with it, through a serial connection?

 

A serial connection can only send strings of bytes.  It is up to you to determine the protocol of how you want to send the data.

0 Kudos
Message 2 of 11
(4,390 Views)

Yes, I am using serial communication.

So it`s imposible to send values above 255 through serial communication, right?

 

Thanks for response.

0 Kudos
Message 3 of 11
(4,384 Views)

Wrong. You can easinly send more than 255. Are you reading the ASCII value of characters or the character itself in PIC.

 

For example "01" ASCII values coreespond to some special character where as "1" sent as string has ASCII value of 31.

 

You can easily send more than 255 in any case.

 

Please give more info on ur PROTOCOL first.

0 Kudos
Message 4 of 11
(4,380 Views)

You can send how ever much information you want.

 

If you want to send a 16-bit value, you can send 2 bytes that are the binary representation of that number.  If you want, you can send it as a string of characters.  You could send "1234567" as a string of 7 bytes.  In that case the 7 bytes are the ASCII values of the characters you want to send.

0 Kudos
Message 5 of 11
(4,378 Views)

hi, If you dont have any protocole then u have to buil one protocole suitable to your appication.

 

In this discussion many of our friends have posted so many things. u can take, whatever  is suitable for your application.

 

Even u can Take reference of  . You can send data in string formate...

 

Thanks you

 

Brijesh

 

 

CLAD
Labiew programmer
0 Kudos
Message 6 of 11
(4,367 Views)

Hi kekin,

 

I´m sending the character itself in PIC. I´m doing the code in C in mikroC program and I´m using the USART_READ function and in labview the visa read via RS-232.

Do you have any example of what you propose.

 

Thanks to all.

0 Kudos
Message 7 of 11
(4,291 Views)

I`ve being working with this vi. What I need is to send any value (0 or 48 or 100 or 5000) and read this value in microcontroller.

If I want to send ascii characters i need to convert them to string?

 

I`m really new in this topic so excuse me if I do many silly questions, Thanks to all for your information.

0 Kudos
Message 8 of 11
(4,236 Views)

Hi Syd, if you want to write ascii characters, just send the character as a string to the microcontroller. In your VI you have chosen the default configurations for the serial port, are they really your chosen configurations? Here is the same VI with the options selectable. You should check out the serial examples shipped out with labview to work with the Read, Write and Configure serial Port VISAs. The help is also useful. If you get stuck just let us know.

 

 

PS: Which version of labview are you using?

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 9 of 11
(4,223 Views)

@syd_b wrote:

Yes, I am using serial communication.

So it`s imposible to send values above 255 through serial communication, right?

 

Thanks for response.


You can not send values above 1 through serial communication. Smiley Happy

 

(Sorry couldn't hold back)

=====================
LabVIEW 2012


0 Kudos
Message 10 of 11
(4,208 Views)