Autor Tema: ECAN1 con DMA y pasar valor RAM. No pasa valor en eds de ECAN1 a variable en ram  (Leído 1427 veces)

0 Usuarios y 2 Visitantes están viendo este tema.

Desconectado picandpc

  • PIC10
  • *
  • Mensajes: 4
Hola amigos,

Tengo este problema.
Uso el PIC24EP512GP806, MPLAB 8.85 compilando con C30.

Preliminar:
He modificado el codigo de ejemplo CE227 de microchip (comunicación cruzada entre CAN1 y CAN2) para usar solo el ECAN1 y comunicar con un nodo CAN externo ajeno.
El programa funciona como se esperaba, pueden ver un ejemplo aquí:
list=UUyH4afYWpKYrITqa8neS-_A

Y el código main acá:
Código: C
  1. #if defined(__dsPIC33F__)
  2. #include "p33fxxxx.h"
  3. #elif defined(__PIC24H__)
  4. #include "p24hxxxx.h"
  5. #elif defined(__PIC24E__)
  6. #include "p24exxxx.h"
  7. #endif
  8.  
  9. #include <ECAN1Config.h>
  10. #include <common.h>
  11.  
  12. //  Macros for Configuration Fuse Registers
  13. _FOSCSEL(FNOSC_FRC);
  14. _FOSC(FCKSM_CSECMD & POSCMD_XT);//_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF  & POSCMD_XT);  
  15.                                                                 // Clock Switching is enabled and Fail Safe Clock Monitor is disabled
  16.                                                                 // OSC2 Pin Function: OSC2 is Clock Output
  17.                                                                 // Primary Oscillator Mode: XT Crystanl
  18.  
  19.  
  20. _FWDT(FWDTEN_OFF);              // Watchdog Timer Enabled/disabled by user software
  21.                                                                 // (LPRC can be disabled by clearing SWDTEN bit in RCON register
  22. _FPOR(FPWRT_PWR1);
  23.  
  24. // Define ECAN Message Buffers
  25. #if defined (__PIC24E__)
  26. ECAN1MSGBUF ecan1msgBuf __attribute__((space(eds),aligned(ECAN1_MSG_BUF_LENGTH*16)));
  27. //ECAN2MSGBUF ecan2msgBuf __attribute__((space(eds),aligned(ECAN2_MSG_BUF_LENGTH*16)));
  28. #else
  29. ECAN1MSGBUF ecan1msgBuf __attribute__((space(dma),aligned(ECAN1_MSG_BUF_LENGTH*16)));
  30.  
  31. #endif
  32.  
  33. // CAN Messages in RAM
  34. mID rx_ecan1message;
  35.  
  36. // Prototype Declaration
  37. void oscConfig(void);
  38. void clearIntrflags(void);
  39. void ecan1WriteMessage(void);
  40.  
  41.  
  42. int main(void)
  43. {
  44.  
  45. /* Configure Oscillator Clock Source    */
  46.         oscConfig();
  47.  
  48. /* Clear Interrupt Flags                                */
  49.         clearIntrflags();
  50.  
  51.  
  52. /* ECAN1 Initialisation                
  53. *   Configure DMA Channel 0 for ECAN1 Transmit
  54. *   Configure DMA Channel 2 for ECAN1 Receive */
  55. #if defined (__PIC24E__)
  56.         MSTRPR = 0x20;
  57.         CNPUF= 0X000F;
  58. #endif
  59.         ecan1Init();
  60.         dma0init();    
  61.         dma2init();
  62.  
  63. /* Enable ECAN1 Interrupt */                           
  64.        
  65.         IEC2bits.C1IE = 1;
  66.         C1INTEbits.TBIE = 1;   
  67.         C1INTEbits.RBIE = 1;
  68.  
  69.  
  70. /* Write a Message in ECAN1 Transmit Buffer    
  71.    Request Message Transmission                 */
  72.         ecan1WriteMessage();
  73.         C1TR01CONbits.TXREQ0=1;
  74.        
  75. /* Loop infinitely */
  76.  
  77.         while (1);
  78.        
  79. }
  80.  
  81.  
  82. /* ECAN1 buffer loaded with Identifiers and Data */
  83. void ecan1WriteMessage(void){
  84.  
  85. /* Writing the message for Transmission
  86. ecan1WriteTxMsgBufId(unsigned int buf, long txIdentifier, unsigned int ide, unsigned int remoteTransmit);
  87. ecan1WriteTxMsgBufData(unsigned int buf, unsigned int dataLength, unsigned int data1, unsigned int data2, unsigned int data3, unsigned int data4);
  88.  
  89. buf -> Transmit Buffer number
  90.  
  91. txIdentifier -> SID<10:0> : EID<17:0>
  92.  
  93. ide = 0 -> Message will transmit standard identifier
  94. ide = 1 -> Message will transmit extended identifier
  95.  
  96. remoteTransmit = 0 -> Normal message
  97. remoteTransmit = 1 -> Message will request remote transmission
  98.  
  99. dataLength -> Data length can be from 0 to 8 bytes
  100.  
  101. data1, data2, data3, data4 -> Data words (2 bytes) each
  102.  
  103. */
  104.  
  105.         ecan1WriteTxMsgBufId(0,0x1FFEF243,0,0);//(0,0x1FFEFFFF,1,0);
  106.         ecan1WriteTxMsgBufData(0,3,0x1A02,0x000F,0x0000,0x0000);//(0,8,0x1111,0x2222,0x3333,0x4444);
  107.  
  108. }
  109.  
  110. /******************************************************************************
  111. *                                                                            
  112. *    Function:                  rxECAN1
  113. *    Description:       moves the message from the DMA memory to RAM
  114. *                                                                            
  115. *    Arguments:                 *message: a pointer to the message structure in RAM
  116. *                                               that will store the message.
  117. *        Author:            Jatinder Gharoo                                                      
  118. *                                                                        
  119. *                                                                              
  120. ******************************************************************************/
  121. void rxECAN1(mID *message)
  122. {
  123.         unsigned int ide=0;
  124.         unsigned int srr=0;
  125.         unsigned long id=0,d;
  126.                        
  127.         /*
  128.         Standard Message Format:
  129.         Word0 : 0bUUUx xxxx xxxx xxxx
  130.                              |____________|||
  131.                                         SID10:0   SRR IDE(bit 0)    
  132.         Word1 : 0bUUUU xxxx xxxx xxxx
  133.                                    |____________|
  134.                                                 EID17:6
  135.         Word2 : 0bxxxx xxx0 UUU0 xxxx
  136.                           |_____||           |__|
  137.                           EID5:0 RTR      DLC
  138.         word3-word6: data bytes
  139.         word7: filter hit code bits
  140.        
  141.         Substitute Remote Request Bit
  142.         SRR->   "0"      Normal Message
  143.                         "1"  Message will request remote transmission
  144.        
  145.         Extended  Identifier Bit                       
  146.         IDE->   "0"  Message will transmit standard identifier
  147.                         "1"  Message will transmit extended identifier
  148.        
  149.         Remote Transmission Request Bit
  150.         RTR->   "0"  Message transmitted is a normal message
  151.                         "1"  Message transmitted is a remote message
  152.         */
  153.         /* read word 0 to see the message type */
  154.         ide=ecan1msgBuf[message->buffer][0] & 0x0001;  
  155.         srr=ecan1msgBuf[message->buffer][0] & 0x0002;  
  156.        
  157.         /* check to see what type of message it is */
  158.         /* message is standard identifier */
  159.         if(ide==0)
  160.         {
  161.                 message->id=(ecan1msgBuf[message->buffer][0] & 0x1FFC) >> 2;           
  162.                 message->frame_type=CAN_FRAME_STD;
  163.         }
  164.         /* mesage is extended identifier */
  165.         else
  166.         {
  167.                 id=ecan1msgBuf[message->buffer][0] & 0x1FFC;           
  168.                 message->id=id << 16;
  169.                 id=ecan1msgBuf[message->buffer][1] & 0x0FFF;
  170.                 message->id=message->id+(id << 6);
  171.                 id=(ecan1msgBuf[message->buffer][2] & 0xFC00) >> 10;
  172.                 message->id=message->id+id;            
  173.                 message->frame_type=CAN_FRAME_EXT;
  174.         }
  175.         /* check to see what type of message it is */
  176.         /* RTR message */
  177.         if(srr==1)
  178.         {
  179.                 message->message_type=CAN_MSG_RTR;     
  180.         }
  181.         /* normal message */
  182.         else
  183.         {
  184.                 message->message_type=CAN_MSG_DATA;
  185.                 message->data[0]=(unsigned char)ecan1msgBuf[message->buffer][3];
  186.                 message->data[1]=(unsigned char)((ecan1msgBuf[message->buffer][3] & 0xFF00) >> 8);
  187.                 message->data[2]=(unsigned char)ecan1msgBuf[message->buffer][4];
  188.                 message->data[3]=(unsigned char)((ecan1msgBuf[message->buffer][4] & 0xFF00) >> 8);
  189.                 message->data[4]=(unsigned char)ecan1msgBuf[message->buffer][5];
  190.                 message->data[5]=(unsigned char)((ecan1msgBuf[message->buffer][5] & 0xFF00) >> 8);
  191.                 message->data[6]=(unsigned char)ecan1msgBuf[message->buffer][6];
  192.                 message->data[7]=(unsigned char)((ecan1msgBuf[message->buffer][6] & 0xFF00) >> 8);
  193.                 message->data_length=(unsigned char)(ecan1msgBuf[message->buffer][2] & 0x000F);
  194.         }      
  195. }
  196.  
  197.  
  198. void clearIntrflags(void){
  199. /* Clear Interrupt Flags */
  200.  
  201.         IFS0=0;
  202.         IFS1=0;
  203.         IFS2=0;
  204.         IFS3=0;
  205.         IFS4=0;
  206. }
  207.  
  208.  
  209. void oscConfig(void){
  210.  
  211. /*  Configure Oscillator to operate the device at 40Mhz
  212.         Fosc= Fin*M/(N1*N2), Fcy=Fosc/2
  213.         Fosc= 8M*40/(2*2)=80Mhz for 8M input clock */
  214.  
  215.         PLLFBD=38;                                      /* M=40 */
  216.         CLKDIVbits.PLLPOST=0;           /* N1=2 */
  217.         CLKDIVbits.PLLPRE=0;            /* N2=2 */
  218.         OSCTUN=0;                                       /* Tune FRC oscillator, if FRC is used */
  219.  
  220. /* Disable Watch Dog Timer */
  221.  
  222.         RCONbits.SWDTEN=0;
  223.  
  224. /* Clock switch to incorporate PLL*/
  225.         __builtin_write_OSCCONH(0x03);          // Initiate Clock Switch to Primary
  226.                                                                                                         // Oscillator with PLL (NOSC=0b011)
  227.         __builtin_write_OSCCONL(0x01);          // Start clock switching
  228.         while (OSCCONbits.COSC != 0b011);       // Wait for Clock switch to occur      
  229.  
  230.  
  231. /* Wait for PLL to lock */
  232.  
  233.         while(OSCCONbits.LOCK!=1) {};
  234. }
  235.  
  236.  
  237. void __attribute__((interrupt, no_auto_psv))_C1Interrupt(void)  
  238. {    
  239.         IFS2bits.C1IF = 0;        // clear interrupt flag
  240.         if(C1INTFbits.TBIF)
  241.     {
  242.         C1INTFbits.TBIF = 0;
  243.     }
  244.  
  245.     if(C1INTFbits.RBIF)
  246.     {      
  247.                 // read the message
  248.             if(C1RXFUL1bits.RXFUL1==1)
  249.             {
  250.                 rx_ecan1message.buffer=1;
  251.                 C1RXFUL1bits.RXFUL1=0;
  252.             }      
  253.             rxECAN1(&rx_ecan1message);             
  254.                 C1INTFbits.RBIF = 0;
  255.         }
  256. }
  257.  
  258.  
  259. //------------------------------------------------------------------------------
  260. //    DMA interrupt handlers
  261. //------------------------------------------------------------------------------
  262.  
  263. void __attribute__((interrupt, no_auto_psv)) _DMA0Interrupt(void)
  264. {
  265.    IFS0bits.DMA0IF = 0;          // Clear the DMA0 Interrupt Flag;
  266. }
  267.  
  268. void __attribute__((interrupt, no_auto_psv)) _DMA1Interrupt(void)
  269. {
  270.    IFS0bits.DMA1IF = 0;          // Clear the DMA1 Interrupt Flag;
  271. }
  272.  
  273. void __attribute__((interrupt, no_auto_psv)) _DMA2Interrupt(void)
  274. {
  275.    IFS1bits.DMA2IF = 0;          // Clear the DMA2 Interrupt Flag;
  276. }
  277.  
  278. void __attribute__((interrupt, no_auto_psv)) _DMA3Interrupt(void)
  279. {
  280.    IFS2bits.DMA3IF = 0;          // Clear the DMA3 Interrupt Flag;
  281. }

Problema
Al agregar los archivos fuente y headers a mi programa ya operante (con otras comunicaciónes pero por UART2, LCD y teclado) e incluso pasar el programa principal del ejemplo modificado del CE227, no se pasan los valores del dma a la variable en ram.
Pueden ver en el video que sí se captura con DMA lo recibido con ECAN1, pero no se pasa a la otra variable en espacio near:
index=2&list=UUyH4afYWpKYrITqa8neS-_A

No hago ninguna modificación a los archivos ni al programa, solo paso de un proyecto a otro y me encuentro con este efecto.

Alguna idea que me pueda sacar de este gran hoyo?

Saludos

Desconectado MerLiNz

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 2463
Re: ECAN1 con DMA y pasar valor RAM. No pasa valor en eds de ECAN1 a variable en ram
« Respuesta #1 en: 24 de Septiembre de 2014, 16:14:14 »
Sin ver estas funciones:
ecan1Init();
   dma0init();   
   dma2init();

poco, sobretodo las de DMA, suponiendo que el CAN va bien.

Desconectado picandpc

  • PIC10
  • *
  • Mensajes: 4
Re: ECAN1 con DMA y pasar valor RAM. No pasa valor en eds de ECAN1 a variable en ram
« Respuesta #2 en: 24 de Septiembre de 2014, 16:45:34 »
Sin ver estas funciones:
ecan1Init();
   dma0init();   
   dma2init();

poco, sobretodo las de DMA, suponiendo que el CAN va bien.

Gracias por tu pronta respuesta MerLiNz.

Ahora te adjunto el contenido de ECAN1Config.C, donde están las funciones ecan1Init(), dma0init() y dma2init():

Código: C
  1. #if defined(__dsPIC33F__)
  2. #include "p33fxxxx.h"
  3. #elif defined(__PIC24H__)
  4. #include "p24hxxxx.h"
  5. #elif defined(__PIC24E__)
  6. #include "p24exxxx.h"
  7. #endif
  8.  
  9. #include <ECAN1Config.h>
  10.  
  11.  
  12. /* Dma Initialization for ECAN1 Transmission */
  13. void dma0init(void){
  14.  
  15. #if defined (__PIC24E__)
  16.         DMAPWC=0;
  17.         DMARQC=0;
  18. #else
  19.          DMACS0=0;
  20. #endif
  21.      DMA0CON=0x2020;
  22.          DMA0PAD=0x0442;        /* ECAN 1 (C1TXD) */
  23.          DMA0CNT=0x0007;
  24.          DMA0REQ=0x0046;        /* ECAN 1 Transmit */
  25. #if defined (__PIC24E__)
  26.          DMA0STAL=  __builtin_dmaoffset(ecan1msgBuf);  
  27.          DMA0STAH=0X0000;
  28. #else
  29.          DMA0STA=  __builtin_dmaoffset(ecan1msgBuf);   
  30. #endif
  31.          DMA0CONbits.CHEN=1;
  32.          
  33. }
  34.  
  35.  
  36. /* Dma Initialization for ECAN1 Reception */
  37. void dma2init(void){
  38.  
  39. #if defined (__PIC24E__)
  40.         DMAPWC=0;
  41.         DMARQC=0;
  42. #else
  43.          DMACS0=0;
  44. #endif
  45.      DMA2CON=0x0020;
  46.          DMA2PAD=0x0440;        /* ECAN 1 (C1RXD) */
  47.          DMA2CNT=0x0007;
  48.          DMA2REQ=0x0022;        /* ECAN 1 Receive */
  49. #if defined (__PIC24E__)
  50.          DMA2STAL= __builtin_dmaoffset(ecan1msgBuf);   
  51.          DMA2STAH= 0x0000;     
  52. #else
  53.          DMA2STA= __builtin_dmaoffset(ecan1msgBuf);    
  54. #endif
  55.          DMA2CONbits.CHEN=1;
  56.          
  57. }
  58.  
  59.  
  60.  
  61. void ecan1ClkInit(void){
  62.  
  63. /* FCAN is selected to be FCY
  64. /* FCAN = FCY = 40MHz */
  65.         C1CTRL1bits.CANCKS = 0x1;
  66.  
  67. /*
  68. Bit Time = (Sync Segment + Propagation Delay + Phase Segment 1 + Phase Segment 2)=20*TQ
  69. Phase Segment 1 = 8TQ
  70. Phase Segment 2 = 6Tq
  71. Propagation Delay = 5Tq
  72. Sync Segment = 1TQ
  73. CiCFG1<BRP> =(FCAN /(2 ×N×FBAUD))– 1
  74. */
  75.  
  76.         /* Synchronization Jump Width set to 4 TQ */
  77.         C1CFG1bits.SJW = 0x3;
  78.         /* Baud Rate Prescaler */
  79.         C1CFG1bits.BRP = BRP_VAL;
  80.        
  81.  
  82.         /* Phase Segment 1 time is 8 TQ */
  83.         C1CFG2bits.SEG1PH=0x7;
  84.         /* Phase Segment 2 time is set to be programmable */
  85.         C1CFG2bits.SEG2PHTS = 0x1;
  86.         /* Phase Segment 2 time is 6 TQ */
  87.         C1CFG2bits.SEG2PH = 0x5;
  88.         /* Propagation Segment time is 5 TQ */
  89.         C1CFG2bits.PRSEG = 0x4;
  90.         /* Bus line is sampled three times at the sample point */
  91.         C1CFG2bits.SAM = 0x1;
  92.  
  93.  
  94.  
  95. }
  96.  
  97.  
  98.  
  99. void ecan1Init(void){
  100. /* Request Configuration Mode */
  101.         C1CTRL1bits.REQOP=4;
  102.         while(C1CTRL1bits.OPMODE!=4);
  103.  
  104.         ecan1ClkInit();
  105.  
  106.         C1FCTRLbits.DMABS=0b000;                /* 4 CAN Message Buffers in DMA RAM */
  107.        
  108. /*      Filter Configuration
  109.  
  110.         ecan1WriteRxAcptFilter(int n, long identifier, unsigned int exide,unsigned int bufPnt,unsigned int maskSel)
  111.  
  112.         n = 0 to 15 -> Filter number
  113.  
  114.         identifier -> SID <10:0> : EID <17:0>
  115.  
  116.         exide = 0 -> Match messages with standard identifier addresses
  117.         exide = 1 -> Match messages with extended identifier addresses
  118.  
  119.         bufPnt = 0 to 14  -> RX Buffer 0 to 14
  120.         bufPnt = 15 -> RX FIFO Buffer
  121.  
  122.         maskSel = 0     ->      Acceptance Mask 0 register contains mask
  123.         maskSel = 1     ->      Acceptance Mask 1 register contains mask
  124.         maskSel = 2     ->      Acceptance Mask 2 register contains mask
  125.         maskSel = 3     ->      No Mask Selection
  126.        
  127. */
  128.  
  129.         ecan1WriteRxAcptFilter(0,0x0643,0,1,0);//(1,0x1FFEFFFF,1,1,0);
  130.  
  131.  
  132. /*      Mask Configuration
  133.  
  134.         ecan1WriteRxAcptMask(int m, long identifierMask, unsigned int mide, unsigned int exide)
  135.  
  136.         m = 0 to 2 -> Mask Number
  137.  
  138.         identifier -> SID <10:0> : EID <17:0>
  139.  
  140.         mide = 0 -> Match either standard or extended address message if filters match
  141.         mide = 1 -> Match only message types that correpond to 'exide' bit in filter
  142.  
  143.         exide = 0 -> Match messages with standard identifier addresses
  144.         exide = 1 -> Match messages with extended identifier addresses
  145.        
  146. */
  147.  
  148.         ecan1WriteRxAcptMask(0,0x1FFFFFFF,1,0);//(1,0x1FFFFFFF,1,1);//(0,0x0643,1,0);//
  149.        
  150.  
  151. /* Enter Normal Mode */
  152.         C1CTRL1bits.REQOP=0;
  153.         while(C1CTRL1bits.OPMODE!=0);
  154.        
  155. /* ECAN transmit/receive message control */
  156.  
  157.         C1RXFUL1=C1RXFUL2=C1RXOVF1=C1RXOVF2=0x0000;
  158.         C1TR01CONbits.TXEN0=1;                  /* ECAN1, Buffer 0 is a Transmit Buffer */
  159.         C1TR01CONbits.TXEN1=0;                  /* ECAN1, Buffer 1 is a Receive Buffer */
  160.         C1TR01CONbits.TX0PRI=0b11;              /* Message Buffer 0 Priority Level */
  161.         C1TR01CONbits.TX1PRI=0b11;              /* Message Buffer 1 Priority Level */
  162.  
  163. #if defined (__PIC24HJ128GP504__)
  164. /* Setup I/O pins */
  165.     // The PPS configuration varies from device to device. Refer the datasheet of the device being used and
  166.     // use the appropriate values for the RPINR/RPOR registers.
  167.     RPINR26 = 0;                    //clear register
  168.     RPINR26bits.C1RXR =5;         //set CAN1 RX to RP96    (87)
  169.     RPOR3bits.RP6R = 16;           //RPOR7bits.RP97R = 14; set CAN1TX to RP97        (88)
  170. #endif
  171. #if defined (__PIC24EP512GP806__)
  172. /* Setup I/O pins */
  173.     // The PPS configuration varies from device to device. Refer the datasheet of the device being used and
  174.     // use the appropriate values for the RPINR/RPOR registers.
  175.     //RPINR26 = 0;                    //clear register
  176.     RPINR26bits.C1RXR =97;         //set CAN1 RX to RP96    (87)
  177.     RPOR7bits.RP96R = 14;           //RPOR7bits.RP97R = 14; set CAN1TX to RP97        (88)
  178. #endif
  179.                
  180. }

Pero creo que ya encontré la respuesta; de alguna forma en el programa ejemplo, con poco código y pocas variables, todo funciona bien. Cuando lo agrego a un programa más grande con más archivos fuentes y sus respectivas variables fué cuando ya no pasó los valores de DMA (o datos eds) a la variable en la ram.

Acabo de probar en una versión modificada de mi programa completo haciendo el "Acceso a EDS administrado por usuario", según la sección 3 (Memoria de datos) del manual de la familia (dsPIC33E/PIC24E), en lugar del "Acceso a EDS administrado por el compilador" (que obviamente no funcionó).

De esta forma ya logré pasar los datos de la eds a la near ram (la variable que esperaba el dato).

Voy a agregar las modificaciones a mi programa original y veremos, pero tengo muy buenas esperanzas con este cambio (administración de acceso a EDS).

Saludos

Desconectado picandpc

  • PIC10
  • *
  • Mensajes: 4
Re: ECAN1 con DMA y pasar valor RAM. No pasa valor en eds de ECAN1 a variable en ram
« Respuesta #3 en: 25 de Septiembre de 2014, 13:12:32 »
[SOLUCIONADO]

Funcionó ya el código.

Les explico por si a alguien le sirve.

Contexto
Controlador:PIC24EP512GP806
Usando ECAN1 con DMA (en espacio de memoria EDS que va de 0xD001 A 0XDFFE)
Mplab 8.85, Compilador C30

Problema
Al querer pasar el valor de la variable en EDS a una variable en la near RAM en ésta última el valor recibido siempre es 0xff, es decir, no se puede leer la memoria EDS.
Sin embargo, el debug muestra un valor correcto en la EDS.

Solución
La solución fué accesar a la memoria extendida EDS mediante "acceso a memoria extendida administrado por usuario", en lugar de "acceso a memoria extendida administrado por compilador".

Para esto, al iniciar la función en donde se tendría acceso a la EDS hay que especificar la página de EDS a la que se quiere accesar, y el tipo de acceso (sea escritura o lectura).

Así, en cuanto inicia la función y justo antes de terminala agregué lo siguiente:

Código: C
  1. int temp1; //variable para almacenar el valor actual de la pagina para acceso a lectura
  2. temp1=DSRPAG; //Registro de Pagina de Datos para Lectura (el valor actual)
  3. DSRPAG = __builtin_edspage(variableEnEDS);//Al registro DSRPAG se le indica la pagina para lectura de EDS en donde se encuentra la variable a la que quiero accesar
  4.  
  5. ... //codigo de la funcion
  6.  
  7. DSRPAG=temp1;//al terminar la funcin le devolvemos el valor inicial

Espero a alguien le sirva; a mí me quitó mucho tiempo.

Saludos


 

anything