06-26-2013 07:17 AM
I have used NI VISA read function to read and i tried to write and read the same data by loop back. i could read from the port , but i need to read only when any data comes in the serial port.how i will detect any data received in the com port?Based on the data received only i need to write the data to port.
pls help me
Solved! Go to Solution.
06-26-2013 07:25 AM
There are several ways of doing this.
If I understood your correctly, a simple solution is to create a property node, select the "Instr" (inside VISA) and use "Number of Bytes at Port". Then you check the number of bytes you expect and create a condition.
If this is not what you are looking, then I'm sorry but that's what I understood.
Regards
06-26-2013 07:30 AM
You can use the Bytes At Port property node. Personally, I just use the VISA Read with the number of bytes I am expecting and let the VISA timeout determine my loop rate.
06-27-2013 11:53 PM
Hi,
I have tried the "bytes at port property node" and created a condition to check whether it receive the no of bytes i expecting . but it reads only less bytes than it shown on "bytes at port property node".
06-28-2013 12:06 AM
Can you post your VI ?
06-28-2013 03:06 AM
I need to read 15 bytes data received in com port. Please check below vi and suggest me to read 15 bytes of data from com port continuously. it shows framing error when i run the vi.
06-28-2013 05:26 AM - edited 06-28-2013 05:29 AM
This should work better...just set your own port number, I used COM 20.
06-28-2013 05:36 AM
give a condition dat its should only read the data when no of bytes at port is > or = to 15 and put the read part in a case structure,It will work.