LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa serial interrupt

Solved!
Go to solution

Hi dear members

How to config visa read function to stop reading when "AAAA" word is received?

Thanks

 

0 Kudos
Message 11 of 26
(1,787 Views)

Hi laian,

 

we already discussed this problem, so no need to start a new thread...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 26
(1,747 Views)

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

0 Kudos
Message 13 of 26
(1,739 Views)

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

0 Kudos
Message 14 of 26
(1,687 Views)
Solution
Accepted by topic author Laian

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.

Message 15 of 26
(1,677 Views)

Hi   

thanks for your reply.

would u plz explain it in more details

You mean I should use shift register for all 3 while loops?

or I should put property node within the write while loop?

0 Kudos
Message 16 of 26
(1,672 Views)

I have changed it and used shift register

but didnt work 

0 Kudos
Message 17 of 26
(1,660 Views)

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

0 Kudos
Message 18 of 26
(1,608 Views)

also I have set delay in write process loop in Labview but didnt solve

0 Kudos
Message 19 of 26
(1,603 Views)
Solution
Accepted by topic author Laian

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!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 20 of 26
(1,589 Views)