03-15-2016 01:55 AM
Hi I am using my PIC Microcontroller for controlling 4 Motors. I have programmed my PIC. Meanwhile I have interfaced PIC with LabVIEW using VISA. Am going to read the data from PIC. I am passing 1 byte binary data from PIC to LabVIEW. The Problem is when I am getting the data in string. I want the string data to be converted into Boolean value. For example: Am passing 0100 data, 4 individual bits correspond to the 4 motor status. So When I pass this value, in my labVIEW the boolean indicator motor 2 should be glow. Help me with this guys. Thanks in advance
03-15-2016 02:18 AM
03-15-2016 05:22 AM
Thank you , I attached my VI. When i run this, only motor 1 boolean indicator glows. For all value.
03-15-2016 05:25 AM
03-15-2016 05:36 AM
Thanks. But When I run this... String value gets accumlated ie the previous value gets accumaled with the new value. As I am continously sending the string data from my PIC to labview. Is there is any way for seperating new string from the old one.
03-15-2016 05:51 AM
Hi velkumar,
as I said before: I cannot open your VI because of the LabVEIW version you use.
Is there is any way for seperating new string from the old one.
Simple solution: When you want to get the data of the new string you should work with this new string - don't attach it to the old data…
03-15-2016 05:59 AM
Hi GerdW,
Thanks for your reply, I have attached snippet of my program. I cant get you what you are trying to say
03-15-2016 06:36 AM
Hi velkumar,
- you always read the latest data: I have no idea why you think you accumulate your string data
- you use DeleteFromArray to get the last byte of the string: no idea why you do this
- using BytesAtPort is most often the wrong function to use. Either you use the TermChar or, like in your case, you read a fixed amount of data…
What's the data rate you want to receive? What's the message size you receive? What's the message format?
03-15-2016 02:37 PM
Duplicate thread: http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/String-data-to-indicate-ON-OFF-of-motor/m-p/3...