|
|||||||||||||
07-10-2012 04:26 AM
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.
07-11-2012 01:29 AM
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
07-12-2012 03:36 AM
Hello rtessel,
Were you able to resolve the issue?
07-12-2012 05:08 AM
Yes I solved the problem.
I found the solution in this topic: http://forums.ni.com/t5/LabWindows-CVI/Control-PIC
And see the solution in topic:
Regards,
Ronald
07-18-2012 10:48 AM
Hello rtessel,
Thanks for sharing it!
This will for sure help other people who find your question/post..
My Profile | Privacy |
Legal |
Contact NI
© 2011 National Instruments Corporation. All rights reserved. | E-Mail this Page
|
||

E-Mail this Page