LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Raw interrupt: Data Rate between USB Raw Device and Labview!!!!

Solved!
Go to solution

I am doing USB communication between Labview and USB RAW device(Microcontroller). I have done all required things like NI-USB raw driver and I am able to get the 8 bytes using getusbinterrupt.vi, however my application requires continuos data transfer between pc and microcontroller, inorder to achieve that I have put continuos loop in microcontroller so it transfers continuos data to pc, (in this case e.g.0 to 255 and again 0 to 255 and so on.) , but I am not able to get increment of 1 as written in my program, instead of that I am getting increment of 5 to 10....Is this because Microcintroller is very fast than my pc??? if so how I can get continuos data without any jumps...

 

I am attaching vi with output snapshot....graph shows jump of the data variable..I am running my vi in continuos on mode...

 

As, I also want to write into usb device with labview, can you also suggest for that also?? I have read the posts like:

http://forums.ni.com/ni/board/message?board.id=170&message.id=382144&query.id=445342#M382144, but I am facing the same problem as this user...

 

Thanks in Advance.

MS.

Download All
0 Kudos
Message 1 of 10
(9,296 Views)
Solution
Accepted by topic author 26314362

26314362 wrote:

I am attaching vi with output snapshot....graph shows jump of the data variable..I am running my vi in continuos on mode...

MS.

Running fast code in continous mode is quite useless.

In your code you continiousely regsiter and unregster events, this takes some time, perhaps the following code improvement will help:

interruptusb[1]_BD.png

I am not sure but you might be able to reuse the event.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 10
(9,287 Views)

Once you enable the Interrupt events on USB, VISA actually buffers them for you so you certainly should NOT be losing data.

 

Perhaps trhe problem is with your microcontroller and not with the PC-side.

 

A USB Endpoint has a defined poll rate.  If you're feeding the endpoint with data faster than the endpoint is set to be polled, then updates will "fall between the cracks" and not be reported.  The poll rate of an Endpoint is a MAXIMUM rate at which data will be processes, not a minimum.

 

Shane.

0 Kudos
Message 3 of 10
(9,272 Views)

Thanks, PTClomp, your improvement have help me to move ahead. I am able to get the continuous data with your screen-shot and putting some delay in microcontroller..:)

 

Now, as I want to write also , I have used out pipe property node to write into my device, however I am able to write the byte but I am not able to read the data when I attached writting part of labview in the read vi.

 

I am attaching my both vi's with output...

1. Interruptusb[1] vi shows only read part, and snapshot shows I am able to read continuous data on graph terminal.

 

2.Interrupt-read-write vi have combined read and write part, in that case I am able to write data to controller but I am not able to read data, output shows value zero continuously.

 

Have I connected write part incorrectly??

 

Thanks in Advance.

 

Message 4 of 10
(9,242 Views)

The problem is that you do a write and read simultaniously.

What error was returned by the write?

You close the VISA session, essentially killing all possible communication.

Here is my proposal (based pure on LabVIEW experience, my VISA knowledge is quite outdated)

 

interrupt-read-write_BD.png

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 10
(9,225 Views)

Thanks TCPlomp, it works :)....now I am able to read and write 8 bytes of data continuously...do you know maximum data size the interrupt method can support?? I want to know about interrupt data buffer used in read.vi....

 

Moreover, my next aim is to transfer the data into Intranet, (private LAN)...after receiving data from controller , labview has to send this data over LAN..can you throw some light on that??/

0 Kudos
Message 6 of 10
(9,207 Views)

The LabVIEW TCP/IP examples are quite good. Just keep remembring to close a session after you are completely done.

 

TOn

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 10
(9,204 Views)

Well, I learned somehting today.

 

I thought VISA didn't support Interrupt out transfers.

 

Now I know better.

 

Cheers

 

Shane.

0 Kudos
Message 8 of 10
(9,192 Views)

Heartly thanks to you,..I will try TCP/IP..and will post my experience...so that anyone can use that.....I hope I will find supporters like you.....:)

 

 

 

 

enjoy your work!!!

MS

0 Kudos
Message 9 of 10
(9,188 Views)

What number '12' mean - I understand that is message which will be transport to my endpoint but if I'am using HID class should I construct some request ie. bmRequestType + bRequest .... put this into strring and send? Or i should send only my reports?

0 Kudos
Message 10 of 10
(7,185 Views)