08-12-2008 11:42 AM
08-12-2008 03:58 PM
08-12-2008 04:24 PM - edited 08-12-2008 04:24 PM
Did you read my replies? That's precisely what I said in reply #5. Also, it makes no sense that it requires a fixed byte array of 64 elements. If it did, then the read would not require a separate input of how many elements are in the array. Same goes for the write. In your example C program you were pre-allocating an array of 64 bytes, but tellng the functions that the array length was 4 for the receive and 2 for the send. Made no sense to me, but whatever.
@mchp1 wrote:
Ok, I think that the problem may be arising because I am not initializing the buffer that I am feeding the write or the buffer that I am reading from the read function . How can I do this? The Write function is expecting an array of type BYTE[64] and the Read function should return an array of type BYTE[64].
This allocates an array of 64 bytes and tells the function that you are providing an array of 64 bytes (not 4). The function will return how many bytes were read with its output parameters. Note that the output array will still be 64 bytes. You can use Split Array if you wish to chop off the extra zeros.
08-13-2008 08:40 AM
08-13-2008 08:58 AM
09-28-2009 03:17 AM
HI Mchp1
Please send me the correct labview code and the code of the controller for guidance.
09-28-2009 09:23 AM
Hi
What kind of application have you developed by using mpusbapi.dll ? Are you making DAQ card , please tell me about it.
09-28-2009 10:20 AM
09-28-2009 01:04 PM
Thanks for your help. I want to ask some questions
http://www.elektor.com/magazines/2007/november/usb-data-acquisition-card.271706.lynkx
I found the above link of usb data acquisition card , this daq card has eight analog channels , 8 digital inputs , 8 digital outputs and 2 pwm outputs. The software interface using this daq card is based on .NET Framework. This daq card uses PIC18f4550 microcontroller. I have understood the code of user.c but that code is compatible with Visual C++ application . I want to control this Daq card over labview8.2 . Please tell me how can i use your labview VI to control this DAQ card .
In your driverVI , i have to add the 8 analog inputs of ADC out of which the one i select sends a particular code to the pic18f4550 ,which recognizes that code and enables only that input channel. Similarly in your VI , i want to add two analog PWM outputs also and 8 digital inputs and outputs each.
You have worked before on the MCHPUSB Framework. , please just go through user.c and user.h for better understanding what i am trying to say. I have attached the firmware also or you can go to the link and download it from there.
Please help me in developing the labview application as i want , i am new to labview and learning call library function but i have to complete this application within a week.
Any help greatly appreciated
Regards
Simon
09-29-2009 07:59 AM
Hi mchp1
I sent you only the firmware of the 18f4550 , you can download the complete code from the link mentioned above.
Please just look into it.
Regards
Simon