05-22-2007 09:11 AM
05-25-2007 02:16 AM
Hi Paul Bros,
Could you be a little more explicit about the problem? Screenshot of the error or code you use?
Regards,
05-25-2007 05:19 AM
Hi Julien,
I use the following functions to communicate with my ATMEL AT91SAM7S64 application.
I used nivisa development driver succesfull. I can see my USBapplication by the program "Test and measurement".
I use after I opened my appication and USB device
printf("USB1 Interrupt Event\n");
zend_buf[0]=stx;
zend_buf[1]=35+48;
zend_buf[2]=0+48;
Zet_Xor(3);
zend_buf[4]=dle;
zend_buf[5]=etx;
memset(&ontvang_buf[0],0,100);start_pos=0;aantal_char=6;
receivedreplyisOK==FALSE;
retnCount=VI_SUCCESS;
status=viWrite(instr,zend_buf ,aantal_char,retnCount);
status = viInstallHandler (instr, VI_EVENT_USB_INTR, usbHndlr,0);
status = viEnableEvent (instr, VI_EVENT_USB_INTR, VI_HNDLR, VI_NULL);
while(receivedreplyisOK==FALSE)
//correct reply from ATMEL received
printf("USB2 Interrupt Event\n");
zend_buf[0]=stx;
zend_buf[1]=35+48;
zend_buf[2]=0+48;
Zet_Xor(3);
zend_buf[4]=dle;
zend_buf[5]=etx;
memset(&ontvang_buf[0],0,100);start_pos=0;aantal_char=6;
retnCount=VI_SUCCESS;
status=viWrite(instr,zend_buf ,aantal_char,retnCount);
After USB1 Interrupt Event is transmitted
The message is received by the ATMEL uP and he arrage a reply with data. This datastring is received by the host perfectly.
When I do the viWrite again (USB2 Interrupt Event is transmitted) I get the following error on the screen.
"Could not perform operation because I/O error"
When I place the
status = viInstallHandler (instr, VI_EVENT_USB_INTR, usbHndlr,0);
status = viEnableEvent (instr, VI_EVENT_USB_INTR, VI_HNDLR, VI_NULL);
before the first viWrite opeartion there is no reply from the ATMEL.Why is this happening, I suppose that the activation of the viInstallHandler and viEnableEvent
infuent the viWrite operation and is that the reason why it works fine time and the second time not. Could it be that there must be a Flag resetting before I use viWrite?
With regards
Paul
06-07-2007 07:08 AM
Paul,
Have you any error code? It could help us. thanks
Regards,
07-17-2007 04:57 AM