05-06-2009 06:23 AM
Hi Guys,
Recently I began a project trying to send and receive information from LABVIEW to my PIC18F2450 microncontroller.
So far I have made good progress, using the Visa driver wizard I have managed to create the driver for my USB RAW device.
I can also send and receive data packets from the VISA interactive control program very consistently, i have used this tool to help to check if the device is working correctly.
My next step is to get this working from LABVIEW itself, now I have read through lots and lots of the tutorials but the penny still hasnt dropped, so I just have a few questions.
I have also came to the conclusion that I will be using VISA USB Control in and VISA USB Control out .
From the interactive control utility when I go to the property node get tab I receive the following informationabout my device
Timeout Value = 50
Maximum Queue Length = 50
Termination Character = 0x0A
Termination Char Enable = VI_FALSE
IO Protocol = 1
Suppress End on Reads = VI_FALSE
USB Maximum Interrupt Size = 1
USB Control Pipe = 0x0000
USB Bulk-Out Pipe = 0x0001
USB Bulk-In Pipe = 0x0081
USB Interrupt-In Pipe = 0xFFFF
USB Alternate Setting = 0
USB Bulk-Out Pipe Status = 0
USB Bulk-In Pipe Status = 0
USB Interrupt-In Pipe Status = -1
USB End Mode for Reads = 5
In LABVIEW do i need to use a VISA open box ? Or can I just use Control In and Control out without VISA Open ?
In the connection named Visa Resource Name I have also connected on that little I-O box and right clicked it to select Visa Class >I-O Session>USB Raw or do I need to enter in (USB0::0x04D8::0x0011::NI-VISA-0::RAW ) somewhere ?
What about the connections on USB control out, " index,value,request type request " ? What should I put in there ?
Hope somebody can help me soon, if you need anymore info from my side just let me know,
Regards Eoin
05-06-2009 07:04 AM - edited 05-06-2009 07:04 AM
USB RAW communication is not trivial.
Have a look at my Nugget here.
Shane.
05-07-2009 08:16 AM
Great I managed to get it working with Visa Read and Write.
But now I have another issue, in the text box where I need to enter the name of my Raw Device Ive got a problem.
Sometimes when i connect my USB microcontroller it is assigend this name
"USB0::0x04D8::0x0011::NI-VISA-1::RAW"
and next time I reconnect its assigned a slightly different name which of course stops me from being able to open the device
"USB0::0x04D8::0x0011::NI-VISA-0::RAW "
Is there anyway of permanently setting the name to be 1 or 0 instead of it switching between the two ?
05-07-2009 08:53 AM - edited 05-07-2009 08:54 AM
You can do a VISA search and give in the PID and VID of the device so that it will only return instances of that particular device.
Use the String "USB0::0x04D8::0x0011::*" for the search. It should return only the devices you are looking for.
Shane.
12-18-2009 10:05 AM