Hi deebp,
If you are using the Serial Protocol you can use the VISA Bytes at Serial Port command to read the amount of data at the port.
If you are using another protocol you will need to implement your own strategy. One method is to always have your first byte of data sent by your device to be a number which represents the number of bytes of data that are coming.
Regards,
John E.
Applications Engineering
National Instruments