LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can any one help with VI for getting data(HEX) from serial and write in text file

Solved!
Go to solution

Hello I have been fighting with this issue from last 2 months ... They getting help from different I thought I have solved the problem, but of no use still I am standing on zero

 

Problem: I have to get high speed data on USB in form of HEX ( coming in hex and to be stored in text file in hex like each hex value in different line I am also going to attach file)

 

We get ASCII on serial or VISA read but when try to convert to hex like the shown in text file make code slower to process, I know my VI will need more improvement.. Waiting for suggestions

 

Need help in urgent ....

Thanks in Advance 

Download All
0 Kudos
Message 1 of 12
(4,284 Views)

Hi Ali Afzal,

you read only one byte and generate an array with 10000000 elements. Why do you make it?

How fast shall your loop run?

 

Mike

Message 2 of 12
(4,281 Views)
Hello mike i want to get data on realtime for this i can use up to 50% of my cpu not more than that... to will change the ending condition on this VI like if i receive "F0F0F0F0" at the end of data and loop ends have to match this from data i am getting
0 Kudos
Message 3 of 12
(4,278 Views)

when i assigned 10000000 i was using the bytes on port  so they i have been playing with this VI, Mike can you tell me that in my vi i tried to use the concept that when byte is received on port the rest code should go means read visa after that just like event handling dont want to be pooling every time

 

what i have tried to is right or not? if not what should be done.

0 Kudos
Message 4 of 12
(4,270 Views)

Hi Ali Afzal,

can you give us an example string which you receive? If you don´t have enough time in this loop, then you can send the data with a queue to a parallel running loop. In this loop you can store more values at ones.

Can you explain why you create this big array in your vi?

 

Mike

Message 5 of 12
(4,268 Views)
Data string could be any Hex value stored in RAM of FPGA 8k,64k or 128k. I will be getting this data on visa on separate com port so on 8k data FPGA take 3 Min to send data on com part around 16 thousand hex's values but in that time my code is writing only around 1500 values in file.
0 Kudos
Message 6 of 12
(4,260 Views)
Solution
Accepted by topic author Ali Afzal

Hi Ali Afzal,

i think the attached example can work for you. If not, then try the solution with sending the data to a parallel running loop and store it there.

 

Mike

Message 7 of 12
(4,251 Views)
Thanks mike ... Going to implement it .. Now will be back to u in few min
0 Kudos
Message 8 of 12
(4,248 Views)

Thanks Mike it is running fast and even writing it on same speed thanks sir now going to check it with FPGA when will go to my office LAB

Thanks again sir. 

0 Kudos
Message 9 of 12
(4,241 Views)

Hello Mike

Thanks for your help I have another query about the same code. Sir I am trying to make a condition to look for End of data pattern in coming data like "FF00FF00FF00" when every I receive this continues data loop should terminate. Sending you vi also with details marked in it...

waiting for your reply.. 

0 Kudos
Message 10 of 12
(4,169 Views)