NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
rtessel
Posts: 6
0 Kudos
Accepted Solution

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()

}

 

 

 



 

Member
rtessel
Posts: 6
0 Kudos

Re: VISA usb, read problems

The program MAX (Measurement & Automation Explorer) I also get an error, see attachment. When I press the read button then I get the error "VISA: (Hex 0xBFFF003A) Unable to start operation Because setup is invalid (due to attributes being set to an inconsistent state).". The write function works, see data coming in the uC.

 

 

Also added a logfile, there are two failures, USB_BULK_IN_STATUS and viRead.

 

Regards,

Ronald

Active Participant
ThiCop
Posts: 1,662
0 Kudos

Re: VISA usb, read problems

Hello rtessel,

 

Were you able to resolve the issue?

Kind Regards,

Thierry C - Platinum Applications Engineer - NI Belgium
CLD

If someone helped you, let them know. Mark as solved and/or give a kudo. :smileywink:
Member
rtessel
Posts: 6
0 Kudos

Re: VISA usb, read problems

Active Participant
ThiCop
Posts: 1,662
0 Kudos

Re: VISA usb, read problems

Hello rtessel,

 

Thanks for sharing it!

 

This will for sure help other people who find your question/post..

Kind Regards,

Thierry C - Platinum Applications Engineer - NI Belgium
CLD

If someone helped you, let them know. Mark as solved and/or give a kudo. :smileywink:
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page