VISA usb, read problems

Hello,
I'm doing a project where Labview must communicate with a uC (microchip, mikroC PRO for PIC). Unfortunately, it doesn't work correct, sending data to the uC is good but cann't transmit data to the PC (Labview). The program remains in the loop "while (! HID_Write (& writebuff2, 64)). '
For writing and reading, I use the example program "USB RAW - bulk.vi". If I 'pushed the Bulkin button then I get the following error welding "Error -1073807302 occurred at VISA Read in USB RAW - Bulk.vi" but if I click Bulk Out, then I receive data in the uC.
Can someone help me maybe? thanks 
Piece of uC code:
unsigned char readbuff2[64] absolute 0x500;   // USB Buffers should be in USB RAM
unsigned char writebuff2[64] absolute 0x540;  // USB Buffers should be in USB RAM
void USB_enable()
  char cnt;
  HID_Enable(&readbuff2,&writebuff2);     
void USB_Communication()
  char Read_Reg;
  if (HID_Read())
    switch (readbuff2[0])
      case Reg_Addr_Software_Version:      //read Software_Version
        writebuff2[0]= Reg_Addr_Software_Version;
        writebuff2[1]= Software_Revision_H;
        writebuff2[2]= Software_Revision_L;
        writebuff2[3]= 0;
        break;
      default:
        writebuff2[0]= Reg_Addr_Automatic_Response_Warning;
        writebuff2[1]= 0;
        writebuff2[2]= Address_Fail;
        writebuff2[3]= 0;
        break;
    while(!HID_Write(&writebuff2,64));
  } // end HID_Read()
Solved!
Go to Solution.

Did you look at the links describing the solution?
"Yes I solved the problem.
I found the solution in this topic: http://forums.ni.com/t5/LabWindows-CVI/Control-PIC18F4550-via-USB-with-LabWindows-CVI/td-p/694804
And see the solution in topic:
http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/VISA-RAW-FOR-USB-USING-PIC18F4550/m-p/2064030...
Regards,
Ronald"
He said: "The descriptor file (USBdsc.c) of MikroC Pro was not correct" and made some modificacations described in the forum post
Taylor B.
National Instruments

Similar Messages

  • Visa usb driver problem

    I have a usb controller that I want to communicate with labview....I have successfully made usb raw driver using driver development wizard...and it is running good in my pc in which NI labview is installed....now i want to run a labview application in a pc in which no labview(nothing related to NI) is installed ... so I copied the visa usb driver to that pc.....after connecting device and installing the driver it says cannot install driver completely...I have tried this with 2 pcs...so I was wondering apart from visa usb driver....is there something to install in a pc which is not having labview so that  it can communicate with pc ?
    Solved!
    Go to Solution.

    I have already installed the runtime engine, but that comes later...first it should be there at the device manager list but it has error symbol on my device...I think unless this driver is not properly installed device will not be recognised by labview application..

  • VISA : USB through PIC microcontoller, writing is good, but not reading

    Hi guys;
    I'm trying to put together a simple VISA USB read/write program to test communication from Labview to a PIC microcontroller.
    I've found an example on youtube and wanted to try to implement it.
    Well, in the owners video everything seems to work juste fine, but for me only the writing is working, I can't read data from the microcontroller.
    Can anybody explain to me what is going wrong on this ?
    Here is a the diagram.
    Thank you.

    Give this a try.
    You don't need to initialize the USB port every iteration of your loop.  Nor do you need to close it each time either.  Move those out of the loop.  I also greatly simplified the conversion of your data to write.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Attachments:
    USB Read and Write.png ‏25 KB

  • Visa Read problem from a PIC24's UART port

    Thanks for taking the time to read my post.
    I am using Labview 8 on Win XP CPU 3.4, 2GB RAM PC.
    I am using a microcontroller PIC24 (on the Explorer 16 development board), which I have programmed to acquire an AC singal at a rate of about 4 kHz. The PIC24 has a 10bit ADC and the acquire value is then padded to16bits in total (format: 000000xxxxxxxxxx).
    The serial setting for the pic and my Labview program are 115200, 8 data bits, no parity, 1 stop bit.
    In order to send the acquired value to my PCs serial port (Remember UART = 8-bits of data only) I divide the 16 bit word into MSB and LSB. I then send the MSB and LSB 8-bit value one after the other.
    The total data rate for this communication is about 64kbps.
    The problem is that when I run the code I have written in Labview the CPU usage shoot up to 70% and I also see buffer overruns (a non continuous sine wave). If I a time delay in my while loop the buffer overruns increase.
    Also if I try and use the ‘bytes at port’ VI the data I get is meaningless.
    I would be grateful if someone can look at my code and give me some suggestion as to how I could make the ‘Visa Read’ VI more efficient.
    Regards
    Alex
    Attachments:
    Serial Client for PIC24.vi ‏101 KB

    Dear all,
    I do not know if you have been following my post, but I am still getting buffer overruns (a non continuous sine wave) when using VISA Serial Read.
    The only way to avoid this, is by making the VISA Read VI, read 2-bytes at a time (with no time delay in the main while loop). However, when I do this I see the CPU usage shoot up to around 60% (which is something I would expect anyway, as the main while loop is executing as fast as possible).
    I have attached the working code below and would appreciate ANY comments BIG or small.
    I am still puzzled as to why when I connect the ‘Bytes at Port’ Property Node, the data I get is not correct.
    I have gone through the Labview Examples, as well as the LV Basics 1 course examples (which are similar) and I have also looked in the Labview for Everyone / Labview Graphical Programming books.
    However, I have found the examples to be far too simple, for what I am trying to achieve.
    I am seriously thinking of purchasing the LV Instrument Control Self-Paced Course, but I am not quite certain this would help me much. I have read the Course outline provided by NI, but this did not provide me with more valuable information.
    Can anyone that has ‘done’ this course advice me as to whether the material contains info on ‘high’ speed acquisition using VISA Serial Read/Write?
    The course is slightly price at a cost of around £240(with academic discount) and as far as I understand the courses examples (might) use two HP instruments (Multimeter and Function Generator) and a Tektronix oscilloscope, all of which I am not in direct contact with.
    Regards
    Alex
    Attachments:
    Serial Client PIC24-Serial - Read 2-bytes.vi ‏42 KB

  • USB Sound Problem

    I'm having a problem with my Bose USB sound system that has just recently developed. The system is plugged directly into the back of my Mac Pro desktop so it's not going through any hubs or secondary systems. When I first start my computer the sound works just fine. But after about 10 to 15 minutes of use the sound stops completely - as if the sounds have been turned off. If I boot into Windows 7 using Boot Camp, the sound system there works just fine with no problems at all, so I do not believe this issue is hardware related but is something associated with OS X.
    This all started recently after installing Tinker Tool and then realizing that their latest version is not compatible with Snow Leopard. I followed their directions and told Tinker Tool to restore the previous settings and then I removed it from my system. Now, I'm having this USB sound problem. I think it's highly probable to be the cause of my problem.
    Is there anyway to reinstall the USB drivers in OS X without reinstalling the entire OS? Or, is there something else I can try to restore the USB function to Snow Leopard? Many thanks for any tips or suggestions.

    They are plug and play.
    I did try unplugging all of the USB devices and then powered off the computer and unplugged it for about 5 minutes as I heard that that sometimes solves USB problems. However, upon reconnecting the problem returned. All other USB devices seem to be working normally - it's only the Bose sound system. I tried plugging it into a different USB port in the back of the computer but the problem continued after about 10 minutes. Therefore, I am convinced this is not hardware related.
    At this point I am thinking I need to reinstall OS X Snow Leopard to undo whatever Tinker Tool damaged. Is it possible to just replace the USB drivers in OS X without reinstalling everything?

  • After upgrade to ios 6 usb connection problems with car stereo

    Hi Everyone,
    after ios upgrade to ios6 i am not further able to use the iPhone 4s as music device - having usb connection problems ("not readable"). I am sure, that the upgrade ist the culprit; worked fine before. My car stereo is built in a Volvo XC 60; the device is connected via the standard usb cable by apple.
    Any Ideas?
    Thanks
    Ivo

    (same problem thread): see also https://discussions.apple.com/message/20185146#20185146 (not fixed)

  • [N85] USB charging problem

    Hello all,
    I tried to charge my N85 with an [non-Nokia] USB battery charger (Lenovo 90W Slim AC/DC Combo Adapter) via the Nokia Connectivity Cable (CA-101) to keep down the amount of chargers I have to carry.
    But except of asking, which data connection profile I want to use, there is no charging at all.
    Am I doing something wrong or is the N85 only chargeable by the original Nokia wall charger?
    Thank you
    sicut

    30-Nov-2008 09:35 PM
    rbreton74 wrote:
    @sapporaby: Are you sure you have read my post completely? "Apple" is a brand o usb charger that does not work with my Nokia N85. It's a brand like "Kensington", with a usb charger that do work. Both usb charger worked with my old Nokia N95. I just want to know whether someone else has this problem usb charging problems too or if only my problem, and to make know @sicut that he is not the only one with usb charging problems with his Nokia N85 and his Lenovo charger.
    @sapporaby, is it "apple" a word taboo for you? Why "kensington" is not taboo? Why "lenovo" is not taboo either?
    1. I have had every Mac made since 2003.
    2. I am typing this on a Mac now.
    3. I have had and still have every iPhone made.
    4. Same with every brand iPod.
    5. I am running Apple software right now and the Nokia for Mac software.
    Is that taboo enough for you? DON'T ASSUME because now your taboo question is moot.
    As for your the Apple charger does not work issue, my question still stands. While your Apple charger may have worked with your N95 there is no reason why it should work with your N85. Are they the same phone?. Is the N85 made by Apple? No again. Does the Apple charger supply the same charging voltage as the Nokia charger that came with the phone? These are issues that come into play. What is so hard to use the cable that came with the phone. It seems, and maybe I am wrong but you and the OP are making a mountain out of a moe-hill.
    Just use the cable that came with the phone, in the USB port of your computer and be done with it. I am having a very hard time trying to understand what the problem is with using the cable.
    Message Edited by sapporobaby on 30-Nov-2008 10:07 PM
    Show the KUDOS button some love.... Hit that bad boy.... It don't hurt....
    Apple iPhone 5,
    Retina MacBook Pro, iPad Mini, Nikon D4

  • NI-VISA USB Devices

    I am having a couple of problems using a USB RAW device.  I have an interface module that has a PIC18F1450 micro to provide USB communications.  I used the driver wizard to configure it for LabVIEW.  The developer of the module provided a simple VB GUI, and after I used the wizard, the VB GUI could no longer see the module.  If I move it to a different USB port the VB GUI can see it, but LabVIEW can't.  Using a USB device monitor I see that when it is plugged into the port that it was in when I ran the wizard, it shows up as a NI-VISA USB Device.  When I plug it into another port it shows up as a USB Human Interface Device.  Why does the NI software have to change how the device registers in Windows?  Also, when I first connect the module and start my program, I typically have to try communicating with it a dozen times or so before I have any success.  After that, every attempt is successful.  Here is my communication code.
    Jim
    LV 2013
    Attachments:
    USBComm.png ‏28 KB

    The switch has to mostly with Windows device drviers. A device in Windows may only have one driver assigned to it. I have not seen the type of behaviour you are seeing where your device is exxentially locked to a specific port. We use VISA USB to communicate with printers all the time. What we have found is that once we assign the NI drvier, other tools that require a drvier can no longer communicate with the printer. Likewise if we install some other tool the NI VISA drivers can no longer communicate with the printer. We also use a .dll to effectively install the driver for the printer when it is first connected. This is the .dll example NI provided me when I was first getting this to work with our printers.
    We do a VISA resource lookup to get to the list of devices currently connected.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    ForceINF.zip ‏1614 KB

  • N78 USB CONNECTIVITY PROBLEMS

    Hy guys,
    Since i've bought my N78 i've been able to connect the phone via cable only one time. After that, every time i've tryed to connect my n78 via cable my computer doesn't recognize my Phone.
    When I plug USB cable in one of the USB ports, Windows XP gives me back an error that says "USB devices not recognized - One or more devices connected to the computer has not worked correctly. Windows is not able to recognize it".
    I've reinstalled PC suite thousands of times,but nothing changes.
    My phone has the 12.046 software version. I know that there'e a newer version but how I can update it if my PC does not recognize the phone, and hence, PC suite is not able to connect to the phone.
    Many thanks for you help
    m

    you have another option in updating via Firmware Over The Air. you can do this by entering *#0000# in the standby screen and selecting Options > Check for updates. if an update is not available over NSU, then it may be on FOTA instead for your product code. this method of updating only takes about three to five minutes anyway. remember to do a hard reset (three-finger hard reset) after updating your phone to the new firmware.
    so you can probably update from 12.046 to 20.149 or 21.002. USB connectivity problems are probably due to problems with the USB cable or the computer, i have had no problems at all with USB connectivity in all the time i've had my N78, even under 12.046 firmware.
    let us know how it goes.
    If you found this or someone's comments helpful or like what that person has to say, please give some Kudos to their post!

  • RS232 and PIC16F877A reading problem

    Hi, sorry my bad English.
    I have pic16f877a and labview 7.0. I try to transfer some information(e.g temperature) to my PIC and view that information on LCD-screen. A communication idea is following:
    Traffic if pic starts communication:
    1. PIC send int (e.g 123) to labview
    2. labview read int(and identify what measurement is equivalent with this int)
    3. labview send back string which includes measure value
    4. PIC prints this string to LCD-screen
    Traffic if labview starts communication:
    1. Labview send int to PIC
    2. Labview send string to PIC
    My problem is that I get wrong values from PIC. If I test algorithm on terminal program that is okay.
    For example if PIC try to send 125, I can see in labview 512 or 215.
    Does anyone have build good vi which reads characters from rs232? (I have downloaded and test labview's examples) What kind of vi structure is good? One difficult is that pic and labview both can start communication so I have to read characters all the time.

    Kheila,
    your problem sounds to me as missed synchronisation. As your protocol seems to contain just plain text, so please add a sync char to the end of ALL your messages. Define it as end_of_message in VISA and read complete messages. I'd suggest 0xA (LF) as sync char.
    You know, serial comm means, that all bytes are sent out in the order they appear at the send command (here VISA_write). AND they are usually read at the UART level in the very same order. But depending on the actual situation (system load, UART buffer size, system buffer size, but more important: your coding style) VISA may miss one or the other byte. If you have no sync mechanism, than you'll have no chance to regain sync state after you've lost it once. If you have a sync mechanism, you'll lose one or two messages in such a case and regain sync with every new complete message.
    Example messages (blank space meant as pause between each message)
    123 123 456 122 123
    read when byt 3 was missed:
    121 234 561 221 23
    If instead a sync mecanism is established, you'd get
    12- 123 456 122 123
    HTH and
    Greetings from Germany!

  • T 420s cooling air coming out is very hot, finger print reader problem

    I am living in ruwais, abudhabi.i bought T 420s in last June from LENOVO  authorized distributor. Model number is 4174-KK4 and the sr no ***.
    Sometime the cooling air coming out is very hot, unable to keep the laptop on the lap.
    The cooling fan also replaced still the temperature is high.
    After replacing the fan I noticed that I noticed one of the screws was not fixed, I asked them to fix it, then they fixed it.
    I traveled back to my home 240 KM from the  authorized distributor service  center. when I started the laptop, the fingerprint reader was not working . Then I traveled back 240 KM to the  authorized distributor service  center to fix the issue. They fixed the fingerprint reader problem.
    Then now the SD card reader is not working. I was asked to bring the laptop to the  authorized distributor service centre.
    Can any one experience the same type of problems  with T 420s the cooling air coming out is very hot, finger print reader problem, card reader not working?
    The authorized distributor says for the service they can only cover 50 KM form the  authorized distributor service  center to the customer point, what is the conditions for the On site warranty ?. I am living 240 KM away from the authorized distributor service center from whom I bought the laptop.
    Moderator comment: Serial number(s) removed to protect member from mischief.

    Well clearly after the first incident. You need to check and us it verifying everything is working before leaving the service center or town its in. Go to a coffee shop and spend time using it and test each option is working.
    When the notebook its opened the finger print reader, card reader etc may not be connect properly or connectors not snap fully and disconnect. Mouse ultranav I have heard may also. But clearly you assume too much and you need to spend the time testing its working before leaving.
    These service center are only paid a fixed amount so they won't spend anymore time then they have to and address one problem you brought it in for.
    As for heat out put and over heating. There are many threads on these systems you can find and read about.
    Advice:
    - install Core Temp, this will monitor and display on the task bar you CPU core temp and you can see CPU load & Temperature at a glance if it approaching or staying near the max levels which will kill the CPU and/or motherboard due to cooking it. Its free just be sure to deselect any additional software from installing during the process. I use it on my notebooks. If the system is running high core Temp all the time you need to have it resolved or it will die and most likely out of warranty and/or your data will be lost if you don't have a backup as well. http://www.alcpu.com/CoreTemp/
    - use a laptop cooler. Its a flat pad you sit the laptop on you lap or table with usually two cooling fans that plug into the USB port for power. It will help cool the base of the laptop and other components inside will not be as hot. This will do nothing for the CPU temperature though.
    T520 Model 4239 Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz
    Intel Sandy Bridge & Nvidia NVS 4200M graphics Intel N 6300 Wi-Fi adapter
    Windows 7 Home Prem - 64bit w/8GB DDR3

  • USB mounting problem

    I have done my best to research this, but have not found a solution.
    After a new Arch installation on a new machine (Dell Precision T3400) I am unable to change the permissions (even as root!) on files once they are transferred to the usbstick (a Code 1 error message is returned). Other operations, such as copying, moving and deleting occur as usual. I have also noticed that as soon as files are transferred to the USB stick, the permissions get changed (but not the ownership), as if whatever is reading the stick is also changing the permissions.
    It is not the stick -- the same stick performs normally on every other computer I use it on.
    fstab: /dev/sdc1   /mnt/usbstick  vfat   rw,user,auto,sync  0    0
    (basically the same as on 3 other Linux machines I use, all running Arch).
    When mounted, sdc1 has ownership  root:disk.  I have added myself to the disk group. /mnt/usbstick has myself as the owner.
    Not a major problem, just slightly irritating.
    Thea

    Thanks, Pheon --
    I just noticed I made a mistake in giving my fstab line, it should be:
    /dev/sdc1   /mnt/usbstick   vfat   rw,user,noauto,sync   0   0
    (so "noauto" instead of "auto" in the mount options)
    As I indicated, this is not a USB stick problem (same stick works just fine on other machines) -- also, in my attempts to troubleshoot this, I changed the filesystem on the USB stick to VFAT -- previously, it was whatever the default is when it comes out of the factory, and at that time the fstab line looked like:
    /dev/sdc1   /mnt/usbstick   auto   rw,user,noauto,sync   0   0
    Same situation, i.e. changing the filesystem did not affect the problem in any way.
    Any other ideas?

  • My previous Visa was giving problems. I introduced a new visa and still my account is blocked. Can you help me?

    Hello,
    My previous credit card (Visa) was giving problems.
    I introduced the details of a new card and still my account is blocked, so I can't use the programs.
    Can you help me solve this problem please?
    Thank you.

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • X6 8gb Usb Port Problem

    My x6 usb port not working and i took it to nokia care to fix that problem and they told me that we don't have that type of IC to fix your problem and we can't fix your usb port problem .....if u can't fix the problem they why the hell your running service centre i am totally fed up with this nokia ....guys pls tell what should i do now

    Can't they arrange for the part ? Insist on that.. if they agree, you may be asked to pay for the part upfront..If they do not, contact Nokia by using the 'Contact Us' tab at the top of this page and hope for a favourable resolution.

  • Usb ipod problems

    It recognized the new iPod as "Unknown Device" in Device Manager... I went through all the steps I found in the Apple support network - and to no avail...
    There's always that unrecognized yellow exclamation point on the question mark icon, even though the iPod is charging fine... What to do?
    Thank you in advance
    Ran Bleich

    I have exactly the same problem, my 4g 20 gb Ipod will report a fully charged battery when I connect it to the Apple USB AC adapter (or any other AC USB power adapter), connecting it to my Laptop USB 2.0 port gives the same indication, however, the battery is not really charged, upon disconnecting the cable from the AC adapter or the USB port, the battery icon reverts to its former status (almost completely discharged). The only way I can charge this Ipod is to connect it to a powered Firewire port or dock the Ipod in my Altec Lansing InMotion speakers, I know the USB AC charger used to work before I updated Ipod with the latest updater, I did the update just after it became available, I am not sure if this problem was caused by the update or not, I don't usually have to use the USB ac adapter, so I can't tell if the usb charging problem appeared right after the update or much later.
    It would be much appreciated if somebody posts a solution for this...
    IBM Thinkpad T42   Windows XP  
    IBM Thinkpad T42   Windows XP  

Maybe you are looking for

  • Selector in NIO notifies data to be read but bytes read 0

    Hi All, I am facing a problem in NIO which for which I have clue. The selector object notifies that data is ready to be read from a particular channel after which I execute the following to read the data into the buffer readBuffer.clear(); int count

  • Problem with hp photosmart r937.

    Hi I have got problem with hp photosmart r937. Two menu options dosent want works (''Stitch Panorama'' and ''Move images to card''). Before they works but i switch something and now dosent works. thx.

  • Deployement order of MDBs and SSBs

    Hi All, Facing the issue with deployment order of EJBs in one ear, MDBs start reading and processing message before SSBs are initialised in JNDI while server startup. And JNDI lookup for SSB from MDB failes JNDI lookup exception gets raised, failing

  • Resized firefox's zoom default and don't know how to fix it

    Hello, I have Firefox ver. 24.0 and it seemed that the zoom was larger than normal but it was it's default size. I've tried to find a solution and it showed going into config, ect. I've accidentally typed a certain number when I was carelessly typing

  • Complex many to many relationships

    I am new to Oracle ADF and i have a question about associations. I have 3 business objects: User, Position and Country. A User can have different Positions for each Country. Therefore, i decided to create another BO, named UserPosition which has 4 at