04-13-2020 02:29 AM - edited 04-13-2020 02:41 AM
Hi dear members
How to config visa read function to stop reading when "AAAA" word is received?
Thanks
04-13-2020 03:18 AM
04-17-2020 12:42 AM - edited 04-17-2020 01:19 AM
Hi all
I have attached my VI. this is a serial reading process which stops reading when 0xAAAA is received. I have used string subset function but it didnt work?
next edit :solved!
thanks
04-17-2020 06:54 AM - edited 04-17-2020 06:55 AM
Hi all
I have attached my VI. it has 3 steps first by visa read function it tries to catch AAAA hex word. after reaching that it starts reading 38 bytes and shows on a cluster. then with VISA write function it writes on micro with active XON/XOFF . everything goes well until reaches to third process (write process). Labview write led goes on meaning it has written 38 bytes successfully. but on the other side micro cant get the bytes. I have added timing delay but it didnt solve.
any Idea plz?
Thanks
04-17-2020 08:00 AM
You need to move your initializer on the feedback node out one loop. Or use a shift register.
Right now you are only initializing it on first call of your VI ever running, So when it leaves that inner while loop and comes back to it, you are putting even more data at the end of what you already have and it will grow forever.
04-17-2020 08:29 AM - edited 04-17-2020 08:37 AM
04-17-2020 08:48 AM
I have changed it and used shift register
but didnt work
04-24-2020 08:12 AM
Hi all members
I have tried to use xon xoff for starting and pausing data write process from Labview to microcontroller. it works correctly as labview gets xoff, pauses writing and again starting the process when gets xon.
The problem is on micro side!
when micro sends xoff, it loses the bytes during the time between sending xoff until receiving it by Labview.
how should I solve this problem?
Thanks
Regards
04-24-2020 08:28 AM - edited 04-24-2020 08:29 AM
also I have set delay in write process loop in Labview but didnt solve
04-24-2020 09:03 AM - edited 04-24-2020 09:04 AM
The micro should of course send the xoff byte as soon as the input FIFO reaches 70% or 80%, not wait until it is totally full! Or you need to reduce the baudrate so that there won't be new bytes sent by the PC UART during the time it takes for the xoff to arrive at the PC side. But this second option could easily mean that you have to go back to 300 or 1200 baud to make it work!