Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
Alber Moremont dijo:Ya he podido controlar con VISA de labView mi dispositivo HID, es una aplicacion sencila de encender y pagar un led, la cual desarrollo Moyano Jonathan (de otro foro), pero el lo hacia con VB. Ahora espero poder adentrarme mas y desarrllar alicaciones propias y enfocadas a lo que necesito.
Definitivamente estos foros me han servido mucho...
Saludos
pero que has intentado Hacer yo tengo por hay unos ejemplos que servirian este es uno basico ....Alber Moremont dijo:Hola otra vez jokelnice.
Una preguntota, sabes como puedo leer los datos del pic desde labView usando visa read?
es que la comunicacion ya esta establecida, puedo mandarle datos con visa write y el pic hace lo que le pido correctamente, pero no puedo por nada del mundo leer algo...
otra cosa mas, de donde bajo la mpusbapi.dll?
jokelnice dijo:listo aca esta el 8.2
Alber Moremont dijo:Ya he podido controlar con VISA de labView mi dispositivo HID, es una aplicacion sencila de encender y pagar un led, la cual desarrollo Moyano Jonathan (de otro foro), pero el lo hacia con VB. Ahora espero poder adentrarme mas y desarrllar alicaciones propias y enfocadas a lo que necesito.
Definitivamente estos foros me han servido mucho...
Saludos
' select MCU and clock speed
Device = 18F4550
XTAL = 48
'*****************************************************************
TRISD=0 'todo el puerto B como salida ***************************
PORTD=0
Symbol LED_1 PORTD.0
Symbol LED_2 PORTD.1
Symbol LED_3 PORTD.2
Symbol LED_4 PORTD.3
'*****************************************************************
' descriptor file, located in \inc\usb_18 - a copy
' is located in the same folder as this file
USB_DESCRIPTOR = "USBProjectDESC.inc"
' we are going to use an interrupt to keep the USB
' connection alive, so disable auto polling from within
' the USBIn and USBOut commands
USBIN_AUTO_POLL = OFF
USBOUT_AUTO_POLL = OFF
' USB buffer...
Symbol USBBufferSizeMax = 8
Symbol USBBufferSizeTX = 8
Symbol USBBufferSizeRX = 8
Dim USBBuffer[USBBufferSizeMax] As Byte
' some useful flags...
Dim PP0 As Byte SYSTEM ' USBPOLL status return
Symbol CARRY_FLAG = STATUS.0 ' high if microcontroller does not have control over the buffer
Symbol ATTACHED_STATE = 6 ' is USB attached
Symbol TRNIF = UIR.3 ' low if USB Busy
Dim TIMER1 As TMR1L.Word ' access 16 bits of TMR1
' use an interrupt to keep USB connection alive...
Symbol TimerPreload = $A23F ' approx 2ms
ON_HARDWARE_INTERRUPT GoTo USBServiceInterrupt
' indicador de conexión de usb, los leds se encienden antes de que el PC reconozca el dispositivo
LED_1 = 0 : DelayMS 500 : LED_1 = 1 : DelayMS 500 : LED_1 = 0
LED_2 = 0 : DelayMS 500 : LED_2 = 1 : DelayMS 500 : LED_2 = 0
LED_3 = 0 : DelayMS 500 : LED_3 = 1 : DelayMS 500 : LED_3 = 0
LED_4 = 0 : DelayMS 500 : LED_4 = 1 : DelayMS 500 : LED_4 = 0
GoTo ProgramStart
' ************************************************************
' * the USB interrupt service routine maintains the *
' * connection to the bus - without this routine, a *
' * call to USBPoll, USBIn or USBOut must be made *
' * every couple of milliseconds or so *
' ************************************************************
USBServiceInterrupt:
' don't poll USB if it's busy...
btfss TRNIF
bra ExitInterrupt
' poll the USB interface...
Call (Check@BusStatus)
Call (Driver@Service)
' clear interrupt flag and exit...
ExitInterrupt:
bcf PIR1,0
TIMER1 = TimerPreload
retfie fast
' ************************************************************
' * program starts here... *
' ************************************************************
ProgramStart:
GoSub AttachToUSB
' turn on interrupt timer...
TIMER1 = TimerPreload
T1CON = %10000001
PIE1 = %00000001 ' enable TMR1 overflow interrupt
INTCON = %11000000 ' enable global and peripheral interrupts
' ************************************************************
' * main program loop *
' ************************************************************
ProgramLoop:
' your code in here - to send data, load USBBuffer
' and then call DoUSBOut. To receive data, call DoUSBIn...
'*************************************************************
GoSub DoUSBIn '********************************************
'*************************************************************
GoTo ProgramLoop
' ************************************************************
' * receive data from the USB bus *
' ************************************************************
DoUSBIn:
USBIn 1, USBBuffer, USBBufferSizeRX, DoUSBIn
'**************************************************************
PORTD = USBBuffer[7] '**************************************
Return
' ************************************************************
' * transmit data *
' ************************************************************
DoUSBOut:
USBOut 1, USBBuffer, USBBufferSizeTX, DoUSBOut
Return
' ************************************************************
' * wait for USB interface to attach *
' ************************************************************
AttachToUSB:
Repeat
USBPoll
Until PP0 = ATTACHED_STATE
Return
Alber Moremont dijo:La parte de la logica es solo para mostrar el estado de los LED´s en el panel de LabView
edgarh44 dijo:hola agradezco a todos por el apoyo k brindan, me acabo de comprar un pic18f4550 y por favor si me pueden pasar su diagrama, para conectarlo al usb, y cual seria el driver para k pueda ser usado en win vista, ahora voy a empezar a hacer un fonocardiografo,.. y espero k me vaya bien.. muchas gracias.. ayudamen lo mas pronto k solo me queda 3 semanas.. Gracias