03-18-2011 06:44 PM
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.
03-18-2011 10:12 PM
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.
03-18-2011 10:46 PM
Yes, I am using serial communication.
So it`s imposible to send values above 255 through serial communication, right?
Thanks for response.
03-18-2011 11:15 PM
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.
03-18-2011 11:22 PM
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.
03-19-2011 01:16 AM
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 Ravens Fan. You can send data in string formate...
Thanks you
Brijesh
03-22-2011 01:52 PM - edited 03-22-2011 01:59 PM
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.
04-16-2011 07:25 PM - edited 04-16-2011 07:31 PM
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.
04-17-2011 04:05 AM
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?
04-17-2011 09:31 AM
@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.
(Sorry couldn't hold back)