Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA RAW FOR USB USING PIC18F4550

Hello,
I am developing usb interface using pic18f4550 with micro c that just on and off LEDS and it works well with visual basic,but when I try labview VISA RAW as the control program the circuit does not respond
I tried all the examples in ni website USBRawBulkMain , USBRawControl ,interruptusb.  I worte my own and the result was the same no rsponse. I performed the wizard steps to create inf file and I can see that the device is working properly from hardware manager and from and measurement and automation window.
does anybody   have a simple labview VISA RAW program and firmware for pic18f4550 that just on and off LED that works and make me walk on the right way.

 

I used the firmware with the  file  mpusbapi.dll  with labview and I got response from the circuit

but it seems that usb visa raw is more reliable,

 

 

 

I attached the descriptor file and the labview file


Best Regards,

  

Download All
0 Kudos
Message 1 of 18
(9,060 Views)

Hello,

 

Have you tried following the steps in this document and this one? Also what exactly is happening when you try and communicate with the device in LabVIEW? Are you getting no response from the device?

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
Message 2 of 18
(9,026 Views)

Hi, I don't know which version of LabVIEW you are using. But since version 8.6 LabVIEW provide USB RAW example, you can search the keyword USB RAW in example finder.

USB RAW communication is more complicate through VISA. It would be more fluently if you know the USB 2.0 spec a bit.

0 Kudos
Message 3 of 18
(9,002 Views)

Hello,

I followed the procedure in this page

http://zone.ni.com/devzone/cda/tut/p/id/4478

 

I created the inf file and put it in inf folder and I can see the device in the Automation and Measurement window

 

when I connect the device the circuit i use is the Easypic Developing Board and accoring to the labview software I attached in the previous post when I enter  a number  and press send the LEDS connected to the b port of PIC18F4550 should give response if I enter 4 the LEDS should be (00000100)  , instead no LEDS GO ON nothing happen I attached the firmware main files USB1.C and USB1.HEX as I attached the descriptor file in the previous post.

 

accoring to USB1.C

 

if(Read_buffer[0] == 2 && Read_buffer[1] == 2 &&
Read_buffer[3] == 2)
{
//PORTD IS ADRESS
TRISD = 0;
PORTD =9;
//PORTB IS OUTPUT//
TRISB = 0;
PORTB = Read_buffer[2];

 

I programmed the controlout function to input four numeric control in one array

 

numeric0 =2

numreic1 =2

numeric3 =2

numeric2 = the number(data) i want to send to LEDS

I used this way using the dll file  mpusbapi.dll and it works but it didnt work with visa raw controlout function

 

Download All
0 Kudos
Message 4 of 18
(8,985 Views)

Hello,

I have labview 8.2 and we are looking foreward to upgrade to the profissional current edition

0 Kudos
Message 5 of 18
(8,986 Views)

Hello Mr Adam,

 

I'm still stuck with using visa raw for labview. all I need is simple labview software connect can communicate with usb using visa raw and simple firmware for PIC18F4550  using any compiler C18 , MICROC

the circuit just on and off an LED . do you have such application that will help me continue my work.

 

thank you

0 Kudos
Message 6 of 18
(8,916 Views)

Hi CYBORG7044,

 

We don't have an out of the box solution for what you are trying to do. Nor do we program specifically for certain PIC processor models. If you have questions about using the VISA to write to USB RAW then we might be able to help. As for making a full program to communicate with the PIC, we do not have anything that matches that criteria.

 

Basically, we have knowledge on VISA communication, but not as much in PIC processor, perhaps checking in with the company who produces the chip might help.

 

Thanks!

Chris T.
0 Kudos
Message 7 of 18
(8,883 Views)

Hello,

 

I have a similar problem with the PIC18F4550.

 

I have created a “inf” file with the VISA driver wizard and I can use VISA to write to the PIC based board without any problem, the “write” commands are very well interpreted. The coming when I am trying to read from the board. Not only nothing is transmitted to the computer but also the board seems to be blocked and does not receiving the following commands. I have then to reset manually the board in order to be able to send others commands. When I am using the NI example “USB RAW Control.vi”, the “Control In” gives an error: ”VISA:  (Hex 0xBFFF003D) Invalid buffer mask specified.” With the “USB RAW-Bulk.vi” after a “Bulk In” reading attempt I am getting an error: ” VISA: (Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state)”.

 

Please, help

0 Kudos
Message 8 of 18
(7,987 Views)

Hi,

 

It might help get a better idea of where your error is occurring if you attach a VI with your commands. Have you taken a look at this Knowledge Base or this Forum? They seem to suggest that this might be a buffer problem you are experiencing.

0 Kudos
Message 9 of 18
(7,975 Views)
Thank you for your prompt answer. OK, here is my configuration for my HID PIC based board: VI_ATTR_TMO_VALUE = 2000 VI_ATTR_MAX_QUEUE_LENGTH = 50 VI_ATTR_TERMCHAR = 0x0A VI_ATTR_TERMCHAR_EN = VI_FALSE VI_ATTR_IO_PROT = 1 VI_ATTR_SUPPRESS_END_EN = VI_FALSE VI_ATTR_USB_MAX_INTR_SIZE = 64 VI_ATTR_USB_CTRL_PIPE = 0x0000 VI_ATTR_USB_BULK_OUT_PIPE = 0x0001 VI_ATTR_USB_BULK_IN_PIPE = 0xFFFF VI_ATTR_USB_INTR_IN_PIPE = 0x0081 VI_ATTR_USB_ALT_SETTING = 0 VI_ATTR_USB_BULK_OUT_STATUS = 0 VI_ATTR_USB_BULK_IN_STATUS = -1 VI_ATTR_USB_INTR_IN_STATUS = 0 VI_ATTR_USB_END_IN = 5 With this simple program (see attached png) I am getting an error -1073807302 But when I am using only the “Visa Write «everything is OK and the board receiving well and truly the commands. The problem coming from the “Visa Read” component. With the NI examples I am getting the errors as described in my previous post. I’ll try to understand the “Buffer Mask” settings but it is new for me I was hoping that the “Visa Read” component make it easier. I was wrong, is it entirely manual?
0 Kudos
Message 10 of 18
(7,962 Views)