Sony Ericsson Automatic meter reading with M bus Скачать руководство пользователя страница 9

  METERING AND M BUS 

 
 
 
 

 

 

 

 

 

 

else if(Recp[0] == 0x68) 

 

 

 

    if(index 

5) 

 

 

 

 

     int 

psz 

Recp[1]; 

     if(index 

>= 

psz 

6) 

 

 

 

 

 

 

 

 

 

 

 

  index = 0; 

       

if(Recp[psz 

5] 

== 

0x16) 

 

 

 

 

 

 

  { 

 

 

 

 

 

 

          len = psz + 6; 

 

 

 

 

 

 

    break; 

 

 

 

 

 

 

  } 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

else 

 

 

 

{  

 

 

 

 

index = 0; 

 

 

 

  } 
 

 

if( cnt++ < GETLOOPCNT) 

  { 
 

 

 

cnt = 0; /*check call status every 100 loops*/ 

 

 

 

st = chsts(1) & 0x02;     

  } 

 } 
 

if(st == 0) 

 { 
 

 

len = 0; 

 } 
 

return len;       


 
DoMBUS() 

 int 

Sz; 

 

int Cnt = 0; 

 

/*start transmission */ 

 

/* get whole MBUS packet from Data Channel */ 

 

Sz = GetMBUSData(1); 

 

/* send bytes over uart */ 

 

if(mxs(Recp,Sz) == Sz) 

 { 
 

 

prtf(“\n Sent data to Max3100”); 

 } 
 

Cnt = 0; 

 

while(gtf(MAXDATA) == 0 && Cnt < REC10MSCNT) 

 { 

  dlyms(2); 

/*wait 100ms for data*/ 

 

 

prtf(“\n wt resp!”); 

  Cnt++; 
 } 
 
 

if( Cnt < 10) 

 { 
 

 

/* receive whole MBUS packet from Max3100 */ 

 

 

Sz = GetMBUSData(0); 

 

 

/* send bytes back to data channel */ 

  chw(1,Recp,Sz); 
 } 

 

 else 
 { 
  /*no 

response*/ 

 } 

 

 
 
 

LZT 123 8014 R1A

  

Содержание Automatic meter reading with M bus

Страница 1: ...Application Note Embedded Applications Automatic meter reading with M bus...

Страница 2: ...Mobile Communications reserves the right to make modifications additions and deletions to this manual due to typographical errors inaccurate information or improvements to programs and or equipment a...

Страница 3: ...ntroduction 4 2 MBUS support in Embedded Applications 5 2 1 Implementation 5 2 1 1 Hardware Setup 6 2 2 The Script 6 2 3 Testing the Application 7 2 4 Flexibility 7 2 5 Metering Application Script MBU...

Страница 4: ...imply to the radio device s existing interfaces to provide an extra level of functionality This is done in the context of an application which uses MBUS as its communication mechanism the Metering Bus...

Страница 5: ...bits This can then be communicated to a metering device The embedded application has driver function calls for the MAX3100 device that allow simple configuration of and communication through the devic...

Страница 6: ...sits in a loop waiting for an incoming data call that requests an MBUS session be setup Once a call is received and checked to be from the correct number the module answers the call and calls the DoM...

Страница 7: ...Tool from www viddata com The debug prints from the application can be monitored if the service pin is asserted on the radio device and UART2 is monitored at 115200 baud 8 data 1 start 1 stop bit The...

Страница 8: ...NT 10 100ms receive wait char Recp 261 char iRec 261 int st operates on Recp and iRec GetMBUSData int RcNotRsp Get MBUS data from Channel or Device Contains MBUS packet validation algorithm int Size 0...

Страница 9: ...en 0 return len DoMBUS int Sz int Cnt 0 start transmission get whole MBUS packet from Data Channel Sz GetMBUSData 1 send bytes over uart if mxs Recp Sz Sz prtf n Sent data to Max3100 Cnt 0 while gtf M...

Страница 10: ...ng number prtf n Number s NumBuf if scmp NumBuf DATA_NUMBER 12 0 if number matches answer call chw 1 ata n r 5 wait for data mode for i 0 i CALL_COUNT i st chsts 1 prtf n chsts d st if st 0x02 check s...

Страница 11: ...METERING AND M BUS LZT 123 8014 R1A 11 3 References 1 MBUS A Documentation www m bus com 2 MAX3100 Component data sheet www maxim ic com...

Отзывы: