LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB communication Between VISA and microcontroller

I am using USB to communicate between C8051F320 micro controller and Lab view.I try write and read operation through VISA read and write ao it gives me timeout Error(-1073807339)
I went through the below link which said it was a timeout error
 
 
So if any can help me out i would be thankful.
 
Regards
sow
0 Kudos
Message 1 of 8
(5,297 Views)
Hi sow,
Timeout errors can happen for many reasons.  Can you please provide us with more details as to how, when and where the error occurs.  This will help us troubleshoot with you.  A step by step explanation of what your code is doing and where the error occurs would be great.  Also, what versions of the software (LabVIEW and NI-VISA) are you using?  Has this setup worked for you before or is this a new setup you are using?
 
Please answer these questions and we can go from there.
 
Have a great day!
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(5,274 Views)
Thanks for the reply Chris
 
I am trying to communicate between 'C8051F320 micro controller and Lab view'. I have an example code(File Transfer) got when i installed USBXpress. The version of software used is 'Lab view V8.0 and NI-Visa 4.0'. This setup has worked in Lab view using the DLL SIUSBXp and when i tried writing the same data using VISA -write it interrupted but because of timeout error(The device was indicated NI-USB in the device manager).
 
Regards,
Sowmya
0 Kudos
Message 3 of 8
(5,255 Views)

Is there any example where i have both the VI and the C8051F320 code to communicate using USB using VISA read/write 

Regards

sowmya

0 Kudos
Message 4 of 8
(5,246 Views)
I also found the same posting probably from you on other site.
 
What device driver is your USB device is being hosted by? SiUSBXp.DLL and its kernel mode driver? Or VISA32.DLL and NiViUsbK.sys? 
 
When using NI-VISA's "RAW" USB resource, the VISA Write/Read calls are transparently mapped to USB's Bulk-OUT and Bulk-IN stream I/Os without any trick.  Is this a desired operation for your device?  If SiUSBXp.DLL is providing enough API set (such as open/write/read/close, etc...) for your LabVIEW app, you can call the functions by using LabVIEW's Call-Library feature that allows you to cal arbitrary DLL functions, instead of using NI-VISA USB RAW I/O operations.
0 Kudos
Message 5 of 8
(5,245 Views)

Thanks for the reply. I used SiUSBXp.dll so i could communicate using USB but now i am trying to do the same using VISA (Open,Read,Write,Close) but have problems in identifying the open of the device and even read/write gives me a time out error(–1073807339).So if u have a VI and firmware(C8051F320) where the USB communication works without DLL please mail me.

Regards,

sowmya

0 Kudos
Message 6 of 8
(5,237 Views)
 

Unfortunately I do not have the C8051F320 device. 

When your LabVIEW app uses NI-VISA USB, could the app successfully open the device with viOpen() function?  Then, what VISA resource string did you pass to the viOpen() call?  If you are unable to open the Visa Session with Open call, see the document shown in the following URL:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1qzCAA&l=en-US#1

Assuming your app successfully opened a Visa Session by viOpen(), you can now use viWrite() and viRead() for BULK-OUT and BULK-IN endpoints respectively.  The VISA USB RAW protocol does not provide any filter on the write/read IOs, viWrite() and  viRead() functions simply stream out/in the data "as is" without any modification. 

 

0 Kudos
Message 7 of 8
(5,227 Views)
Hi ,
 
I  was also using VISA to communicate with my device via USB port .Initially ,I too had same problems as mentioned by you.I also used to face one more error i.e. VISA resource is valid but is used by another device.To avoid such problems,you really need to examine your code very thoroughly as timeout error can result due to following reasons :
 
1. the code you write in write buffer may require some line feed characters or termination characters.
2. the device might not be connected properly with the system .
3. the baud rate might not be compatible (if on other end of usb ,there is serial connector)
4.If the timeout value you have put in configuration part is different than required by VISA to execute one set of data.
      Well,I would suggest to go for Measurement & AutomationExplorer and see if data is transferring via that.If,yes,check what are the different parameters there like timeout value,queue size etc.which you can find in "view settable attributes" part.
 
I hope ,your problem gets solved soon.
 
Best Wishes
Regards !
Sarita
 
 
0 Kudos
Message 8 of 8
(5,222 Views)