LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Multiple Reads

I work for a company that is trying to develop a Measurement Software that communicates via USB to a microcontroller.  We are using a custom VISA driver and have set the communication device as Bulk Transfer.  The Labview application sends a command to the device and expects to receive a response. The correct response is read, but it is read repeatedly. Is there a "flag" to read only when new data is sent? Is it reading directly from the microcontroller or is it reading from the PC buffer? I am new to USB and am not sure how to control the read function from Labview. I am using Labview 7.1. Any help would be greatly appreciated!
 
ThanksSmiley Indifferent
0 Kudos
Message 1 of 4
(2,788 Views)

Does your USB device show up as a COM Port?  If so you can use the VISA Bytes at Serial Port.  Keep executing this function to see if there is any data to be read.  If so then execute your read and specify how many bytes to read. Hope this helps.

BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(2,779 Views)
The device shows up as a NI-VISA USB device. We just can't seem to get the read VI to read correctly. It reads the same data over and over again if set to End Short. For example, if 2 packets are sent to Labview and it is not read, the function only reads the last packet sent and not the previous packet. If we use End none, it reads the first packet sent over and over again, but does not read the second packet sent. Any ideas?
0 Kudos
Message 3 of 4
(2,774 Views)
What data do you expect to see? Is it very large that it would overflow the buffer? The buffer size setting is set under a property node, USB Settings:Maximum Interrupt Size.
 
What do you have for the property, Message Based Settings:Suppress End Enable? If it is true, the read will not terminate due to an END condition. The read will not terminate until all of the requested data is received (or an error occurs). If false, it will follow the USB Settings:End Mode for Reads property that you specify (None or Short). You may need to change this Suppress End Enable property to true, if you know the number of bytes that will be coming in.
 
Are you sending this command to the device in a loop?
 
Can you send a screen shot of the code or post the USB part of your code?
 
Regards,
Missy S.
Project Engineer
RoviSys
0 Kudos
Message 4 of 4
(2,746 Views)