Home
Icon
Contents
1. myPanelCh02 Title Text FMI08 System Media SystemSounds Beep Play else if PWM_Duty lt 7 PWM_Freq lt 150 myPanelCh02 Title Text FMI08 System Media SystemSounds Beep Play else myPanelCh02 Title Text Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD myCurveCh02 Clear int vXIndex 0 while vXIndex lt x Length int pC 0 while pC lt PWM_Periode if PWM_Width gt pC myCurveCh02 AddPoint vXIndex 8 else myCurveCh02 AddPoint vXIndex 0 vXIndex if vXIndex gt x Length break pC Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD CAT LICA DEL PERU if m_DatalD gt x Length 1 IPointList plotPointsCh00 IPointList plotPointsCh01 PointList plotPointsCh02 plotPointsCh00 myCurveCh00 Points plotPointsCh01 myCurveCh01 Points plotPointsCh02 myCurveCh02 Points for int pX 0 pX lt x Length 1 pX plotPointsCh00 pX Y plotPointsChOO pX 1 Y plotPointsCh01 pX Y plotPointsCh01 pX 1 Y plotPointsCh02 pX Y plotPointsCh02 pX 1 Y plotPointsCh00 x Length 1 Y Signal_0 plotPointsCh01 x Length 1 Y Signal_1 plotPointsCh02 x Lengih 1 Y m_ADCValue_Ch02 myCurveCh00 Points plotPointsCh00 Te
2. Read a report using a control transfer success MyHid GetlnputReportViaControlTransfer hidHandle ref inputReportBuffer Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD CATOLICA DEL PER if success txtBytesReceived Text for count 0 count lt inputReportBuffer Length 1 count Display bytes as 2 character Hex strings byteValue String Format 0 X2 inoutReportBuffer count Display the received bytes in the text box txtBytesReceived SelectionStart txtBytesReceived Text Length TRANSINFO NET Equivalent of Microsoft VisualBasic NameSpace System Runtime InteropServices Marshal SizeOf txtBytesReceived Text txtBytesReceived SelectedText byteValue nn else CloseCommunications Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU ScrollToBottomOfListBox Enable requesting another transfer AccessForm EnableCmdOnce else Read a report using interrupt transfers To enable reading a report without blocking the main thread this application uses an asynchronous delegate lAsyncResult ar null transferlnProgress true Timeout if no report is available tmrReadTimeout Start if fileStreamDeviceData CanRead fileStreamDeviceData BeginRead inputRepor
3. Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Accepts _A handle returned by CreateFile A pointer to receive a HIDD_ATTRIBUTES structure Returns True on success False on failure kkk success Hid HidD_GetAttributes hidHandle ref MyHid DeviceAttributes if success Find out if the device matches the one we re looking for if MyHid DeviceAttributes VendorID myVendorlD amp amp MyHid DeviceAttributes ProductID myProductID Display the information in form s list box ScrollToBottomOfListBox myDeviceDetected true Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Save the DevicePathName for OnDeviceChange myDevicePathName devicePathName memberlndex else t s not a match so close the handle myDeviceDetected false hidHandle Close else There was a problem in retrieving the information myDeviceDetected false hidHandle Close Keep looking until we find the device or there are no devices left to examine Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU memberlndex memberlndex 1 while myDeviceDetected memberlndex devicePathName Length if
4. Get the bytes to send in a report from the combo boxes Increment the values if the autoincrement check box is selected if Convert ToDouble chkAutoincrement CheckState 1 if cboByte0 SelectedIndex lt 255 cboByte0 Selectedindex cboByte0 SelectedIndex 1 else cboByte0 Selectedindex 0 22 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU if cboByte1 SelectedIndex lt 255 cboByte1 Selectedindex cboByte1 SelectedIndex 1 else cboByte1 Selectedindex 0 An option button selects whether to exchange Input and Output reports or Feature reports if optinputOutput Checked true ExchangelnputAndOutputReports else ExchangeFeatureReports Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU catch Exception ex DisplayException this Name ex throw _ lt summary gt Uses a series of API calls to locate a HID class device by its Vendor ID and Product ID lt summary gt 111 lt returns gt True if the device is detected False if not detected 111 lt returns gt private Boolean FindTheHia Boolean deviceFound false String devicePathName new String 1 28 Tesis publicada con autorizaci n del autor No olvide citar esta tesi
5. No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU double m_ADCValue_Ch02 double m_ADCValue_Ch03 double m_DatalD bool m_EnableMonitoring string m_DataRead int m_ Status GraphPane myPanelCh00 GraphPane myPanelCh01 GraphPane myPanelCh02 Lineltem myCurveCh00 Lineltem myCurveCh01 Lineltem myCurveCh02 double x new double 200 double m_Table_Ch00 new double 200 double m_Table_Ch01 new double 200 double m_Table_Ch02 new double 200 private delegate void MarshalToForm String action String textToAdd Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU public APP_MAIN InitializeComponent private void APP_MAIN_Load object sender EventArgs e try FrmMy this Startup catch Exception ex MessageBox Show ex Message DisplayException this Name ex throw Plots m_Status 0 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD CAT LICA DEL PERU InitGraphicPanel lt summary gt Perform actions that must execute when the program starts lt summary gt private void Startup try MyHid new Hid Initialize Display tmrContinuousDataCollect new System Timers Timer 50 tmrContinuousDataCollect Elapsed new Elaps
6. APP_VIEWER_1 GraphPane Chart Fill Color Color Red APP_VIEWER_1 GraphPane Legend Fill Color Color Blue APP_VIEWER_2 GraphPane Fill Color Color Gray APP_VIEWER_2 GraphPane Chart Fill Color Color Red APP_VIEWER_2 GraphPane Legend Fill Color Color Blue APP_VIEWER_0 AxisChange APP_VIEWER_0 Invalidate APP_VIEWER_0 Refresh APP_VIEWER_1 AxisChange APP_VIEWER_1 Invalidate APP_VIEWER_1 Refresh Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU APP_VIEWER_2 AxisChange APP_VIEWER_2 Invalidate APP_VIEWER_2 Refresh void StopSetting myCurveCh00 Color Color LightGray myCurveCh01 Color Color LightGray myCurveCh02 Color Color LightGray APP_VIEWER_0 GraphPane Fill Color Color Gray APP_VIEWER_0 GraphPane Chart Fill Color Color LightGray APP_VIEWER_0 GraphPane Legend Fill Color Color Gray APP_VIEWER_1 GraphPane Fill Color Color Gray APP_VIEWER_1 GraphPane Chart Fill Color Color LightGray APP_VIEWER_1 GraphPane Legend Fill Color Color Gray APP_VIEWER_2 GraphPane Fill Color Color Gray APP_VIEWER_2 GraphPane Chart Fill Color Color LightGray APP_VIEWER_2 GraphPane Legend Fill Color Color Gray Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU APP_VIEWER_0 AxisChange APP_VIEWER_0 Invalidat
7. myDeviceDetected The device was detected Register to receive notifications if the device is removed or attached success MyDeviceManagement RegisterForDeviceNotifications myDevicePathName FrmMy Handle hidGuid ref deviceNotificationHandle Learn the capabilities of the device MyHid Capabilities MyHid GetDeviceCapabilities hidHandle if success Find out if the device is a system mouse or keyboard Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD y CAT LICA DEL PERU hidUsage MyHid GetHidUsage MyHid Capabilities Get the Input report buffer size GetInputReportBufferSize cmdInputReportBufferSize Enabled true Close the handle and reopen it with read write access hidHandle Close hidHandle FilelO CreateFile myDevicePathName FilelO GENERIC_READ FilelO GENERIC_WRITE FilelO FILE_SHARE_READ FilelO FILE_SHARE_WRITE IntPtr Zero FilelO OPEN_EXISTING O 0 if hidHandle IsInvalid exclusiveAccess true ScrollToBottomOfListBox else if MyHid Capabilities InputReportByteLength gt 0 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Set the size of the Input report buffer Byte inputReportBuffer null inputReportBuffer new Byte MyHid Capabilities InputReportByteLengih fi
8. tab order on disabling the button fraSendAndReceive Focus cmdOnce Enabled false ReadAndWriteT oDevice catch Exception ex DisplayException this Name ex 49 Tesis publicada con autorizaci n del autor No olvide citar esta tesis UNIVER TESIS PUCP a CATOLICA gt _ lt summary gt Start or stop a series of periodic transfers lt summary gt private void cmdContinuous_Click System Object eventSender System EventArgs eventArgs try if cmdContinuous Text Iniciar monitoreo Start doing periodic transfers if l cmdOnce Enabled AccessForm AddltemToListBox A previous transfer hasn t completed Please try again else Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU cmdOnce Enabled false Change the command button s text to Cancel Continuous ecmdContinuous Text Cancelar Enable the timer event to trigger a set of transfers tmrContinuousDataCollect Enabled true tmrContinuousDataCollect Start ReadAndWriteT oDevice Inicia monitoreo Plot m_EnableMonitoring true APP_TIMER Enabled m_EnableMonitoring RunningSetting else Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Stop doing continuous transfers Chan
9. 1 XAxis Title Text Tiempo Segundos myPanelCh01 Y Axis Title Text Presi n kPa myPanelCh01 Title Text APP_VIEWER_2 GraphPane CurveList Clear myPanelCh02 APP_VIEWER_2 GraphPane myPanelCh02 XAxis Scale Min 0 myPanelCh02 XAxis Scale Max 200 myPanelCh02 YAxis Scale Min 0 myPanelCh02 YAxis Scale Max 20 myPanelCh02 YAxis MajorGrid IsVisible true Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU myPanelCh02 YAxis MinorGrid IsVisible true myPanelCh02 XAxis Title Text Tiempo mS myPanelCh02 Y Axis Title Text Pos del Pedal myPanelCh02 Title Text for int i 0 i lt x Length i x i i m_Table_ChOO i 0 m_Table_Ch01 i 0 m_Table_Cho02 i 0 PointPairList holds the data for plotting X and Y arrays PointPairList spICh00 new PointPairList x m_Table_Ch00 PointPairList spICh01 new PointPairList x m_Table_Ch01 PointPairList spICh02 new PointPairList x m_Table_Ch02 Add cruves to myPanelCh00 object myCurveCh00 myPanelCh00 AddCurve ADC Value splCh00 Color Yellow SymbolType None myCurveCh00 Clear Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU myCurveCh00 Line Width 2 0F myCurveCh01 myPanelCh01 AddCurve ADC Value splCh01 Color Yellow SymbolTyp
10. 2 count 0 Byte inoutReportBuffer null Byte outputReportBuffer null Boolean success false try success false Don t attempt to exchange reports if valid handles aren t available as for a mouse or keyboard under Windows 2000 XP if hidHandle sInvalid Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Don t attempt to send an Output report if the HID has no Output report if MyHid Capabilities OutputReportByteLengih gt 0 Set the size of the Output report buffer outputReportBuffer new Byte MyHid Capabilities OutputReportByteLength Store the report ID in the first byte of the buffer outputReportBuffer 0 0 Store the report data following the report ID Use the data in the combo boxes on the form outputReportBuffer 1 m_USB_EndPoint_Command Convert ToByte cboByte0 SelectedIndex if int outputReportBuffer 1 m_USB_EndPoint_Command outputReportBuffer 2 m_USB_EndPoint_AnalogCh Convert ToByte cboByte1 Selectedindex m_USB_EndPoint_AnalogCh Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU if m_USB_EndPoint_AnalogCh gt 4 m_USB_EndPoint_AnalogCh 0 Write a report if chkUseControlTransfersOnly Checked true Use a control transfer to se
11. A TESIS PUCP A UNIVERSIDAD DEL PERU VoltageCHO m_ADCValue_Ch00 5 00 1023 00 VoltageCH1 m_ADCValue_Ch01 5 00 1023 00 if VoltageCH1 gt 2 00 Signal_1 151 else if VoltageCH1 lt 0 90 Signal_1 0 else Signal_1 151 00 VoltageCH1 0 90 1 1 VoltageCHO 4 585 Signal_0 20 00 LBL_CHO Text String Format 0 0 00 VoltageCHO V LBL_CH1 Text String Format 0 0 00 VoltageCH1 V LBL_CH2 Text String Format 0 0 00 PWM_Duty LBL_CH3 Text String Format 0 0 00 PWM_Freq Hz if VoltageCHO gt 4 8 Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD y CAT LICA DEL PERU myPanelCh00 Title Text FMI 03 System Media SystemSounds Beep Play else if VoltageCHO lt 0 2 myPanelCh00 Title Text FMI 04 System Media SystemSounds Beep Play else myPanelCh00 Title Text if VoltageCH1 gt 4 8 myPanelCh01 Title Text FMI 03 System Media SystemSounds Beep Play else if VoltageCH1 lt 0 2 Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD CAT LICA DEL PERU myPanelCh01 Title Text FMI 04 System Media SystemSounds Beep Play else myPanelCh01 Title Text if PWM_Duty gt 95 PWM_Freg gt 1000
12. Conexi n entre la tarjeta Simuladora de Se ales y computadora mediante el uso de un cable USB de impresora 2 Colocar el CD que contiene la aplicaci n y dar doble click al icono del programa con nombre USB_SCOPE a continuaci n aparecer la ventana de inicio del software Para iniciar la visualizaci n de las se ales dar click en el recuadro Iniciar Monitoreo Tesis publicada con autorizaci n del autor No olvide citar esta tesis ENERO UNIVERSIDAD TESIS PUCP 3 CAT LICA DEL PERU Iniciar monitoreo Fig 4 Ventana de inicio del software Simulador de se ales de sensores 3 Para variar la forma de onda de las se ales simuladas se debe girar el potenci metro del sensor que se desea observar La tarjeta simuladora tiene 4 potenci metros 1 potenci metro para la se al de temperatura del aire de admisi n 1 potenci metro para la se al de presi n del aire de admisi n 1 potenci metro para la frecuencia y 1 potenci metro para el ciclo de trabajo de la se al de posici n de pedal Tesis publicada con autorizaci n del autor No olvide citar esta tesis Fig 5 Tarjeta Simuladora de Se ales con 4 potenci metros que simulan tres sensores comunes de los motores Caterpillar Tesis publicada con autorizaci n del autor No olvide citar esta tesis Fig 6 Pantalla de monitoreo de las se ales simuladas por la tarjeta electr nica 4 Cuando se ha girado el potenci metro hasta obtener un va
13. TENEBey PONTIFICIA UNIVERSIDAD 3 al ey CAT LICA DEL PERU TESIS PUCP ndice Anexo 1 C digo fuente del programa para el microcontrolador PIC 18F2550 c oonccciicnnicnncnoncnncn 2 Anexo 2 C digo fuente del programa para la interfaz de usuario desarrollada en Visual Basic 7 Anexo 3 Manual de usuario Simulador de Sensores de Maquinaria Caterpillar 77 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Anexo 1 C digo fuente del programa para el microcontrolador PIC 18F2550 Project name Simulador de Se ales Nombre del proyecto Test configuration MCU PIC18F2550 Dev Board EasyPIC5 Oscillator HS 8 000 MHz USB osc is raised with PLL to 48 000MHz tenemos el oscilador de 8mhz en la tarjeta Ext Modules SW mikroBasic v7 1 Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk program Simulador de Se ales nombre del proyecto tkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk include USBdsc m dulo que incluye los descriptores para que funcione la comunicaci n HID entre el usb y la pc Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk DIM ADC_A AS WORD DIM KOMANDA AS byte absolute 28 DIM USB_START lO_PRO CH l as byte DIM userWR_buffer as byte 255 DIM userRD_buffer as by
14. duct id Delay_ms 4 para esperar el proceso de conversi n del ADC IF ADC_A gt 1020 THEN ADC_A ADC_A 1020 ADC_B 255 ADC_C 255 ADC_D 255 ADC_E 255 END IF IF ADC_A gt 765 THEN ADC_A ADC_A 765 ADC _B 255 ADC_C 255 ADC_D 255 END IF IF ADC_A gt 510 THEN ADC_A ADC_A 510 ADC_B 255 ADC_C 255 END IF IF ADC_A gt 255 THEN ADC_A ADC_A 255 ADC_B 255 END IF userWR_buffer 0 userRD_buffer 0 escribimos lo que leemos en el byte de lectura para enviarlo ala PC identificador userWR_buffer 1 usoReadADC userWR_buffer 2 ADC_A mando el ADC de cada canal userWR_buffer 3 userRD_buffer 1 identificador del canal que esta en el ADC Tesis publicada con autorizaci n del autor No olvide citar esta tesis ENERO A PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU IF O HID_Read THEN si no has recibido nada gt escribimos en el buffer de salida HID_Write userWR_buffer 8 escribimos en el buffer de salida que es un array de 8 bytes env o lo que leo Delay_ms 1 ELSE Delay_ms 1 END IF wend Ea wend HID_Disable deshabilitamos la comunicaci n Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk end Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Anexo 2 C digo fuente del programa para la interfaz de usuar
15. e APP_VIEWER_0 Refresh APP_VIEWER_1 AxisChange APP_VIEWER_1 Invalidate APP_VIEWER_1 Refresh APP_VIEWER_2 AxisChange APP_VIEWER_2 Invalidate APP_VIEWER_2 Refresh private void LBL_CHO_Click object sender EventArgs e Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU Anexo 3 Manual de usuario Simulador de Sensores de Maquinaria Caterpillar Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU SIMULADOR DE SENSORES DE MAQUINARIA CATERPILLAR Manual de Usuario Material educativo dirigido a los instructores de cursos de Electricidad aplicada a Maquinaria Pesada Caterpillar Tesis publicada con autorizaci n del autor No olvide citar esta tesis TENERey PONTIFICIA UNIVERSIDAD gt al ey CAT LICA DEL PERU TESIS PUCP Contenido 83 Introducci n Descripci n del Sistema Simulador de Se ales de Maquinaria Caterpillar Instalaci n y uso del Sistema Simulador de Se ales Tesis publicada con autorizaci n del autor No olvide citar esta tesis ENERO A PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Introducci n En este documento se describir de forma clara el prop sito del Sistema Simulador de Se ales de Maquinaria Caterpillar y c mo el facilitador de las capacitaciones debe utilizar esta he
16. e args _ lt summary gt Provides a central mechanism for exception handling Displays a message box that describes the exception lt summary gt 11 IIl lt param name moduleName gt the module where the exception occurred lt param gt lt param name e gt the exception lt param gt internal static void DisplayException String moduleName Exception e String message null String caption null Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Create an error message message Exception e Message Module moduleName O Method e TargetSite Name caption Unexpected Exception MessageBox Show message caption MessageBoxButtons Ok tmrContinuousDataCollect Enabled false tmrContinuousDataCollect Stop lt summary gt nitiates exchanging reports The application sends a report and requests to read a report lt summary gt private void ReadAndWriteT oDevice try Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU If the device hasn t been detected was removed or timed out on a previous attempt to access it look for the device if myDeviceDetected false myDeviceDetected FindTheHid if myDeviceDetected true
17. e None myCurveCh01 Clear myCurveCh01 Line Width 2 0F myCurveCh02 myPanelCh02 AddCurve ADC Value splCh02 Color Yellow SymbolType None myCurveCh02 Clear myCurveCh02 Line Width 2 0F APP_VIEWER_0 GraphPane Chart Fill Type ZedGraph FillType Solid APP_VIEWER_0 GraphPane Legend Fill Type ZedGraph FillType Solid APP_VIEWER_1 GraphPane Chart Fill Type ZedGraph FillType Solid APP_VIEWER_1 GraphPane Legend Fill Type ZedGraph FillType Solid APP_VIEWER_2 GraphPane Chart Fill Type ZedGraph FillType Solid APP_VIEWER_2 GraphPane Legend Fill Type ZedGraph FillType Solid StopSetting Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU private void Plot int PWM_Width int PWM_ Periode 60 int PWM_ Freq double PWM_Duty 0 double Signal_0 double Signal_1 PWM_Freq int 1500 00 m_ADCValue_Ch03 1024 00 if PWM_Freq lt 10 PWM_Freq 10 PWM_Periode int 20000 00 PWM_Freq PWM_Width int m_ADCValue_Ch02 double PWM_Periode 1024 00 PWM_Duty m_ADCValue_Ch02 100 1024 00 Signal_0 m_ADCValue_Ch00 40 00 1024 00 Canal 0 valor maximo 40 1023 valor maximo que toma la variable Signal_1 m_ADCValue_Ch01 200 00 1024 00 double VoltageCHO double VoltageCH1 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICI
18. e type of access requested read write FILE_SHARE attributes to allow other processes to access the device while this handle is open A Security structure or IntPtr Zero Acreation disposition value Use OPEN_EXISTING for devices Flags and attributes for files Not used for devices Handle to a template file Not used Returns a handle without read or write access This enables obtaining information about all HIDs even system keyboards and mice Separate handles are used for reading and writing kkk Open the handle without read write access to enable getting information about any HID even system keyboards and mice Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU hidHandle FilelO CreateFile devicePathName memberlndex 0 FilelO FILE_SHARE_READ FilelO FILE_SHARE_WRITE IntPtr Zero FilelO OPEN_EXISTING 0 0 functionName CreateFile if IhnidHandle IsInvalid The returned handle is valid so find out if this is the device we re looking for Set the Size property of DeviceAttributes to the number of bytes in the structure MyHid DeviceAttributes Size Marshal SizeOf MyHid DeviceAttributes kkk API function HidD_GetAttributes Purpose Retrieves a HIDD_ATTRIBUTES structure containing the Vendor ID Product ID and Product Version Number for a device
19. edEventHandler OnDataCollect imrContinuousDataCollect Stop tmrContinuousDataCollect SynchronizingObject this tmrReadTimeout new System Timers Timer 5000 tmrReadTimeout Elapsed new ElapsedEventHandler OnReadTimeout tmrReadTimeout Stop Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Default USB Vendor ID and Product ID txtVendorlD Text 0001 txtProductID Text 0020 catch Exception ex DisplayException this Name ex throw lt summary gt 1 Exchange data with the device lt summary gt lt param name source gt lt param gt lt param name e gt lt param gt lt remarks gt 1 The timer is enabled only if cndContinous has been clicked selecting continous periodic transfers 1 lt remarks gt private void OnDataCollect object source ElapsedEventArgs e Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU if transferInProgress false ReadAndWriteToDevice catch Exception ex DisplayException this Name ex throw lt summary gt ystem timer timeout if read via interrupt transfer doesn t return lt summary gt lt param name source gt lt param gt lt param name e gt lt param gt private void OnReadTimeout object so
20. ge the command button s text to Iniciar monitoreo cmdContinuous Text Iniciar monitoreo D isable the timer that triggers the transfers tmrContinuousDataCollect Enabled false tmrContinuousDataCollect Stop cmdOnce Enabled true Detiene monitoreo Plot m_EnableMonitoring false APP_TIMER Enabled m_EnableMonitoring StopSetting catch Exception ex DisplayException this Name ex Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU 11 lt summary gt Scroll to the bottom of the list box and trim as needed 1 lt summary gt private void ScrollToBottomOfListBox try Int32 count 0 f the list box is getting too large trim its contents by removing the earliest data catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt Retrieves a Vendor ID and Product ID in hexadecimal from the form s text boxes and converts the text to Int16s lt summary gt 111 1 lt param name myVendorlD gt the Vendor ID lt param gt 1 lt param name myProductID gt the Product ID lt param gt private void GetVendorAndProductIDsFromTextBoxes ref Int32 myVendorlD ref Int32 myProductID try myVendorlD I
21. gura todos los puertos con funciones anal gicas como digitales ADCON2 0 TRISA OxFF Configuramos portA como entrada LATA 0 end sub Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Main Program Routine HE AAE KEA AERE AE EK EE AE EK AEK AE A E A A E A E A E K AEE AE K AEK A A E A E III II ITI III I TI I IT III I II II III main Init_Main llamamos a la subrutina de configuraci n de puertos e interrupciones CLER_RD_USB CLER_WR_USB HID_Enable OuserRD_buffer userWR_buffer utilizamos las variables userRD y userWR en este proceso de habilitaci n de comunicaci n HID USB habilitamos Delay_mS 1000 Delay_mS 1000 tiempo para estabilizar la comunicaci n Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU while true bucle infinito USB_START HID_Read esta variable devuelve la cantidad de caracteres recibidos del host lo recibido se almacena en el buffer de lectura IO PRO 0 contador a 0 while lO_ PRO lt USB_ START funciona cuando recibo un llamado del host KOMANDA userRD_buffer 0 leemos la data del usb komanda al vendor id select case KOMANDA case usbReadADC rutina para mandar ADC por USB ADC_A ADC read userRD_buffer 1 ADC_ read lee el canal que solicita el buffer el 0 es el pro
22. io desarrollada en Visual Basic using Microsoft Win32 SafeHandles son librerias using System Globalization using System lO using System Runtime InteropServices using Microsoft VisualBasic using System using System Collections using System Data using System Diagnostics using System Drawing using System Timers using System ComponentModel using System Ling using System Text using System Windows Forms using System Media using ZedGraph namespace USBScope Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU public partial class APP_MAIN Form private IntPtr deviceNotificationHandle private Boolean exclusiveAccess private FileStream fileStreamDeviceData private SafeFileHandle hidHandle private String hidUsage private Boolean myDeviceDetected private String myDevicePathName private Boolean transferlnProgress false private DeviceManagement MyDeviceManagement new DeviceManagement private Hid MyHid new Hid private static System Timers Timer tmrReadTimeout private static System Timers Timer tmrContinuousDataCollect internal APP_MAIN FrmMy byte m_USB_EndPoint_Command 1 Lectura canales analogicos se envia un comando byte m_USB_EndPoint_AnalogCh 0 Lectura canales analogicos Plots double m_ADCValue_Ch00 double m_ADCValue_Ch01 Tesis publicada con autorizaci n del autor
23. is PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU a handle to a HID cmdInputReportBufferSize Focus cmdInputReportBufferSize Enabled false if MyHid IsWindowsXpOrLater chkUseControlTransfersOnly Enabled true else If the operating system is earlier than Windows XP disable the option to force Input and Output reports to use control transfers chkUseControlTransfersOnly Enabled false catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt 1 Performs various application specific functions that 1 7 involve accessing the application s form lt summary gt 11 lt param name action gt a String that names the action to perform on the form lt param gt 1 lt param name formText gt text that the form displays or the code uses for another purpose Actions that don t use text ignore this parameter lt param gt private void AccessForm String action String formText try Select an action to perform on the form switch action case AddltemToListBox break case AddltemToTextBox Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD y CAT LICA DEL PERU txtBytesReceived SelectedText formText n
24. leStreamDeviceData new FileStream hidHandle FileAccess Read FileAccess Write inputReportBuffer Length false if MyHid Capabilities OutputReportByteLength gt 0 Byte outputReportBuffer null outputReportBuffer new Byte MyHid Capabilities OutputReportByteLength Flush any waiting reports in the input buffer optional MyHid FlushQueue hidHandle Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU else The device wasn t detected cmdInputReportBufferSize Enabled false cmdOnce Enabled true ScrollToBottomOfListBox return myDeviceDetected catch Exception ex DisplayException this Name ex throw 11 lt summary gt Sends a Feature report then retrieves one Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Assumes report ID 0 for both reports lt summary gt private void ExchangeFeatureReports String byteValue null Int32 count 0 Byte inFeatureReportBuffer null Byte outFeatureReportBuffer null Boolean success false try inFeatureReportBuffer null if MyHid Capabilities FeatureReportByteLength gt 0 The HID has a Feature report Set the size of the Feature report buffer Subtract 1 from the value in the Capabilitie
25. lor de falla ejemplo 5 00 voltios aparecer en la ventana el nombre de la falla producida Tesis publicada con autorizaci n del autor No olvide citar esta tesis Simulador de se ales de sensores a Fig 7 Falla en la se al de Presi n se muestra el FMI 03 Tesis publicada con autorizaci n del autor No olvide citar esta tesis
26. n break case EnableCmdOnce If it s a single transfer re enable the command button if cmdContinuous Text Iniciar monitoreo cmdOnce Enabled true break case ScrollToBottomOfListBox break case TextBoxSelectionStart txtBytesReceived SelectionStart formText Length break default Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU break catch Exception ex DisplayException this Name ex throw _ lt summary gt Enables accessing a form s controls from another thread lt summary gt 11 lt param name action gt a String that names the action to perform on the form lt param gt 1 lt param name textToDisplay gt text that the form displays or the code uses for another purpose Actions that don t use text ignore this parameter lt param gt private void MyMarshalToForm String action String textToDisplay object args action textToDisplay MarshalToForm MarshalToFormDelegate null 19 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD CATOLICA DEL PER The AccessForm routine contains the code that accesses the form MarshalToFormDelegate new MarshalToForm AccessForm Execute AccessForm passing the parameters in args base Invoke MarshalToFormDelegat
27. nd the report even if the HID has an interrupt OUT endpoint success MyHid SendOutputReportViaControlTransfer hidHandle outputReportBuffer else If the HID has an interrupt OUT endpoint the host uses an interrupt transfer to send the report If not the host uses a control transfer if fileStreamDeviceData CanWrite Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU fileStreamDeviceData Write outputReportBuffer 0 outputReportBuffer Length success true if success txtBytesReceived Text for count 0 count lt outputReportBuffer Length 1 count Display bytes as 2 character hex strings byteValue String Format 0 X2 outputReportBuffer count else CloseCommunications Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Read an Input report success false Don t attempt to send an Input report if the HID has no Input report The HID spec requires all HIDs to have an interrupt IN endpoint which suggests that all HIDs must support Input reports if MyHid Capabilities InputReportByteLength gt 0 Set the size of the Input report buffer inputReportBuffer new Byte MyHid Capabilities InputReportByteLength if chkUseControlTransfersOnly Checked
28. ng byteValue null Int32 count 0 Byte inoutReportBuffer null Boolean success false Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU try inputReportBuffer byte ar AsyncState fileStreamDeviceData EndRead ar tmrReadTimeout Stop if ar IsCompleted MyMarshalToForm AddltemToListBox An Input report has been read MyMarshalToForm AddltemToListBox Input Report ID String Format 0 X2 inputReportBuffer 0 MyMarshalToForm AddltemToListBox Input Report Data Plots Int32 vADCValue 0 vADCValue Convert Tolnt32 inputReportBuffer 3 vADCValue Convert Tolnt32 inoutReportBuffer 4 vADCValue Convert Tolnt32 inputReportBuffer 5 vADCValue Convert Tolnt32 inputReportBuffer 6 vADCValue Convert Tolnt32 inputReportBuffer 7 switch inputReportBuffer 8 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP a UNIVERSIDAD DEL PERU case 0 m_ADCValue_Ch00 vADCValue break variable del tipo double case 1 m_ADCValue_Ch01 vADCValue break case 2 m_ADCValue_Ch02 vADCValue break case 3 m_ADCValue_Ch03 vADCValue break default break for count 0 count lt inputReportBuffer Length 1 count Display bytes as 2 character Hex strings byteValue String Format 0 X2 inputRepor
29. nt32 Parse txtVendorlD Text NumberStyles AllowHexSpecifier myProductID Int82 Parse txtProductID Text NumberStyles AllowHexSpecifier catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt Finds and displays the number of Input buffers the number of Input reports the host will store lt summary gt private void GetInputReportBufferSize Int82 numberOflnputBuffers 0 Boolean success try Get the number of input buffers success MyHid GetNumberOflnputBuffers hidHandle ref numberOflnputBuffers Display the result in the text box txtInputReportBufferSize Text Convert ToString numberOflnputBuffers catch Exception ex Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU DisplayException this Name ex throw lt summary gt Retrieves Input report data and status information This routine is called automatically when mylnputReport Read returns Calls several marshaling routines to access the main form lt summary gt 1 lt param name ar gt an object containing status information about the asynchronous operation lt param gt private void GetInputReportData lAsyncResult ar Stri
30. or a specific device 11 lt summary gt private void cmdFindDevice_Click System Object sender System EventArgs e try FindTheHia catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU private void chkAutoincrement_CheckedChanged object sender EventArgs e private void cmdinputReportBufferSize_Click object sender EventArgs e private void InitGraphicPanel APP_VIEWER_0 GraphPane CurveList Clear myPanelCh00 APP_VIEWER_0 GraphPane myPanelCh00 XAxis Scale Min 0 myPanelCh00 XAxis Scale Max 200 myPanelCh00 YAxis Scale Min 0 myPanelCh00 YAxis Scale Max 40 myPanelCh00 YAxis MajorGrid IsVisible true myPanelCh00 YAxis MinorGrid IsVisible true myPanelCh00 XAxis Title Text Tiempo Segundos Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD y CAT LICA DEL PERU myPanelCh00 YAxis Title Text Temperatura C myPanelCh00 Title Text APP_VIEWER_1 GraphPane CurveList Clear myPanelCh01 APP_VIEWER_1 GraphPane myPanelCh01 XAxis Scale Min 0 myPanelCh01 XAxis Scale Max 200 myPanelCh01 YAxis Scale Min 50 myPanelCh01 YAxis Scale Max 200 myPanelCh01 YAxis MajorGrid IsVisible true myPanelCh01 YAxis MinorGrid IsVisible true myPanelCh0
31. rizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Read a report success MyHid GetFeatureReport hidHandle ref inFeatureReportBuffer if success Display the report data received in the form s list box txtBytesReceived Text for count 0 count lt inFeatureReportBuffer Length 1 count Display bytes as 2 character Hex strings byteValue String Format 0 X2 inFeatureReportBuffer count Display the received bytes in the text box txtBytesReceived SelectionStart txtBytesReceived Text Length TRANSINFO NET Equivalent of Microsoft VisualBasic NameSpace System Runtime InteropServices Marshal SizeOf txtBytesReceived Text txtBytesReceived SelectedText byteValue nn Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU else CloseCommunications ScrollToBottomOfListBox cmdOnce Enabled true catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt Sends an Output report then retrieves an Input report Assumes report ID 0 for both reports lt summary gt private void ExchangelnputAndOutputReports String byteValue null Int3
32. rramienta en los cursos que brinda a los t cnicos mec nicos Para facilitar la comprensi n del manual se incluyen fotograf as Tesis publicada con autorizaci n del autor No olvide citar esta tesis Descripci n del Sistema Simulador de Se ales de Maquinaria Caterpillar El Sistema Simulador de Se ales de Maquinaria Caterpillar ha sido dise ado e implementado con la finalidad de proporcionar una herramienta de ense anza al facilitador de los cursos de electricidad El Sistema permite a los participantes de los cursos observar la forma de onda de los principales sensores que se encuentran en los motores electr nicos sensor de temperatura del aire de admisi n sensor de presi n del aire de admisi n y sensor de posici n del pedal El sistema Simulador consta de una tarjeta electr nica un conector USB para impresora y un CD que contiene la aplicaci n Fig 1 Tarjeta Electr nica del Sistema Simulador de Se ales Tesis publicada con autorizaci n del autor No olvide citar esta tesis Fig 2 Cable USB de impresora Tesis publicada con autorizaci n del autor No olvide citar esta tesis Instalaci n y uso del Sistema Simulador de Se ales A continuaci n se describen los pasos a seguir para utilizar el Sistema Simulador en las capacitaciones 1 Conectar la tarjeta electr nica a una computadora utilizando el cable USB de impresora El conector USB debe ir para el lado de la computadora Fig 3
33. s PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU String functionName Guid hidGuid Guid Empty Int32 memberlndex 0 Int32 myProductID 0 Int32 myVendorlD 0 Boolean success false try myDeviceDetected false CloseCommunications Get the device s Vendor ID and Product ID from the form s text boxes GetVendorAndProductIDsFromTextBoxes ref myVendorlD ref myProductID kkk API function HidD_GetHidGuid Purpose Retrieves the interface class GUID for the HID class Accepts A System Guid object for storing the GUID Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU kkk Hid HidD_GetHidGuid ref hidGuid functionName GetHidGuid Fillan array with the device path names of all attached HIDs deviceFound MyDeviceManagement FindDeviceFromGuid hidGuid ref devicePathName f there is at least one HID attempt to read the Vendor ID and Product ID of each device until there is a match or all devices have been examined if deviceFound memberlndex 0 do kkk API function CreateFile Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Purpose Retrieves a handle to a device Accepts A device path name returned by SetupDiGetDevicelnterface Detail Th
34. s structure because the array begins at index 0 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU outFeatureReportBuffer new Byte MyHid Capabilities FeatureReportByteLength Store the report ID in the buffer outFeatureReportBuffer 0 0 Store the report data following the report ID Use the data in the combo boxes on the form outFeatureReportBuffer 1 Convert ToByte cboByte0 SelectedIndex if int outFeatureReportBuffer 1 gt 1 outFeatureReportBuffer 2 Convert ToByte cboByte1 SelectedIndex Write a report to the device success MyHid SendFeatureReport hidHandle outFeatureReportBuffer if success Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP a CATOLICA o for count 0 count lt outFeatureReportBuffer Length 1 count Display bytes as 2 character Hex strings byteValue String Format 0 X2 outFeatureReportBuffer count else CloseCommunications Read a report from the device Set the size of the Feature report buffer Subtract 1 from the value in the Capabilities structure because the array begins at index 0 if MyHid Capabilities FeatureReportByteLength gt 0 inFeatureReportBuffer new Byte MyHid Capabilities Feature ReportByteLength 37 Tesis publicada con auto
35. sis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP PONTIFICIA UNIVERSIDAD y CAT LICA DEL PERU myCurveCh01 Points plotPointsCh01 myCurveCh02 Points plotPointsCh02 else myCurveCh00 AddPoint m_DatalD Signal_0 myCurveCh01 AddPoint m_DatalD Signal_1 myCurveCh02 AddPoint m_DatalD m_ADCValue_Ch02 m_DatalD APP_VIEWER_0 AxisChange APP_VIEWER_0 Invalidate APP_VIEWER_0 Refresh APP_VIEWER_1 AxisChange APP_VIEWER_1 Invalidate APP_VIEWER_1 Refresh APP_VIEWER_2 AxisChange APP_VIEWER_2 Invalidate Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU APP_VIEWER_2 Refresh private void APP_TIMER_Tick object sender EventArgs e APP_TIMER Enabled false try RefreshStatusParameters Plot catch Exception ex APP_TIMER Enabled m_EnableMonitoring void RunningSetting myCurveCh00 Color Color Yellow myCurveCh01 Color Color Yellow Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU myCurveCh02 Color Color Yellow APP_VIEWER_0 GraphPane Fill Color Color Gray APP_VIEWER_0 GraphPane Chart Fill Color Color Red APP_VIEWER_0 GraphPane Legend Fill Color Color Blue APP_VIEWER_1 GraphPane Fill Color Color Gray
36. tBuffer 0 inputReportBuffer Lengih new AsyncCallback GetInputReportData inputReportBuffer 46 Tesis publicada con autorizaci n del autor No olvide citar esta tesis TESIS PUCP CloseCommunications else AccessForm EnableCmdOnce else AccessForm EnableCmdOnce ScrollToBottomOfListBox catch Exception ex DisplayException this Name ex throw Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA UNIVERSIDAD PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt Close the handle and FileStreams for a device lt summary gt 11 private void CloseCommunications if fileStreamDeviceData null fileStreamDeviceData Close if hidHandle null amp amp hidHandle Isinvalid hidHandle Close The next attempt to communicate will get new handles and FileStreams myDeviceDetected false Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU lt summary gt Attempt to write a report and read a report lt summary gt private void cmdOnce_Click System Object eventSender System EventArgs eventArgs try Don t allow another transfer request until this one completes Move the focus away from cmdOnce to prevent the focus from switching to the next control in the
37. tBuffer count MyMarshalToForm AddltemToListBox byteValue MyMarshalToForm TextBoxSelectionStart txtBytesReceived Text MyMarshalToForm AddltemToTextBox byteValue else MyMarshalToForm AddltemToListBox The attempt to read an Input report has failed Tesis publicada con autorizaci n del autor No olvide citar esta tesis UNIVER TESIS PUCP al CATOLICA gt MyMarshalToForm ScrollToBottomOfListBox Enable requesting another transfer MyMarshalToForm EnableCmdOnce transferInProgress false catch Exception ex DisplayException this Name ex throw private void APP_MAIN_FormClosed object sender FormClosedEventArgs e try Shutdown Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU catch Exception ex DisplayException this Name ex throw lt summary gt Perform actions that must execute when the program ends lt summary gt private void Shutdown try CloseCommunications Stop receiving notifications MyDeviceManagement StopReceivingDeviceNotifications deviceNotificationHandle catch Exception ex Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP UNIVERSIDAD DEL PERU DisplayException this Name ex throw 11 lt summary gt 11 Search f
38. te 255 const usbConfirmAction 0 const usbReadADC 1 Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU Main Interrupt Routine Ikkxkkxkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkk sub procedure interrupt HID_InterruptProc se llama a la interrupci n de HID para mantener la comunicaci n viva entre USB y PC end sub Ikkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxkkk sub procedure CLER_WR_USB FOR l 0 TO 9 userWR_buffer I 0 NEXT limpiamos los registros de escritura y lectura del buffer 10 bits end sub sub procedure CLER_RD_USB FOR l 0 TO 9 userRD_buffer I 0 NEXT end sub Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk sub procedure Init Main procedimiento para configurar los puertos y se deshabilitan las interrupciones que no son necesarias INTCON 0 Disable GIE PEIE TMROIE INTOIE RBIE estan en todas las configuraciones INTCON2 0xF5 INTCONS 0xC0 Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU RCON IPEN 0 Disable Priority Levels on interrupts PIE1 0 PIE2 0 PIR1 0 PIR2 0 ADCON1 ADCON1 or OxOF Configure all ports with analog function as digital confi
39. urce ElapsedEventArgs e Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU MyMarshalToForm AddltemToListBox The attempt to read a report timed out CloseCommunications tmrReadTimeout Stop Enable requesting another transfer MyMarshalToForm EnableCmdOnce MyMarshalToForm ScrollToBottomOfListBox _ lt summary gt Initialize the elements on the form lt summary gt private void InitializeDisplay Int16 count 0 String byteValue null Tesis publicada con autorizaci n del autor No olvide citar esta tesis PONTIFICIA TESIS PUCP A UNIVERSIDAD DEL PERU try Create a dropdown list box for each byte to send in a report Display the values as 2 character hex strings for count 0 count lt 255 count byteValue String Format 0 X2 count FrmMy cboByte0 ltems Insert count byteValue FrmMy cboByte1 ltems Insert count byteValue Select a default value for each box FrmMy cboByte0 SelectedIndex 1 FrmMy cboByte1 SelectedIndex 0 Check the autoincrement box to increment the values each time a report is sent chkAutoincrement CheckState System Windows Forms CheckState Unchecked Don t allow the user to select an input report buffer size until there is 15 Tesis publicada con autorizaci n del autor No olvide citar esta tes
Download Pdf Manuals
Related Search
Icon icon iconnect icon size icon of the seas icons8 iconnect login icons on desktop iconfinder iconography icon pass icontact iconnect myisolved icon size settings icona pop icon size desktop iconnectdata login icon cache icon by design icon plc icon dynamics icon malabar icon of the seas royal caribbean icon archive icons free iconscout
Related Contents
2004 IMPREZA SERVICE MANUAL QUICK REFERENCE INDEX Kapitel 2 ¡IMPORTANTE! User Guide - Colorbeam SX106B - Sunex® Tools Samsung LE22A455 Manuel de l'utilisateur IAN 90981 Copyright © All rights reserved.
Failed to retrieve file