LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate with the serial port along with notifier

Hello All,
I have a problem, If any one has any suggestion please help me.
I am acquiring dat through the serial port.
I have a customer based hardwrae which talks on serial port.
After I send a srting i.e the command I get a response from the hardware.
I want to read this response.
But i dont know how many bytes will come in the response.
I tried connecting"NO OF BYTES AT PORT" to the serial read but i am getting 0 bytes at port.
And if i read 8 bytes at time till i get the termination char, the process gets delayed.
 
Please can anyone help me how to read this response as fast as possible
Baud rate is 230400 and i think that it is too fast
so i should response soon.
Please if any one any idea about NOTIFIERS. please let me know
 
Thanks a lot in advance
With regards
 
Avni
0 Kudos
Message 1 of 3
(2,446 Views)

hi there

have you tried the VISA events? The functions can be found at "Instrument IO" -> "VISA" -> "VISA Advanced" -> "Event Handling". There's one event called "Serial TermChar", maybe thats what you need. There are examples for VISA events shipped with LV.

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 3
(2,442 Views)
Avni,
 
I don't think the NOTIFIER will help much in this case.
Buffer initialization and proper "time out" would help better in this case.
You can try this sequence :
Initialize port
Initialize Buffer size
Send command to read data on port
Read data till expected end character
Clear Buffer
Close port
 
Hope this would help you.
 
 
0 Kudos
Message 3 of 3
(2,428 Views)