کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

لوپ در جدول با بازشدن رکوردست در اکسس



If Not rs.BOF And Not rs.EOF Then
        rs.MoveFirst
        While (Not rs.EOF)
            Debug.Print rs.Fields("Employee Name")
            rs.MoveNext
        Wend
    End If
    rs.Close
    Set rs = Nothing













معنی Dia inch یا قطر اینچ


قطر اینچ به معنی سایز لوله ای است که به لوله هم سایز خودش متصل شده - میگن یک لوله ۱۰ اینچ قطر اینچی برابر ۱۰ دارد بنابراین برای هدف پیشرفت/گزارش/محاسبه زمانیکه یک لوله ۱۰ اینچ به یک لوله ۱۰ اینچ دیگر جوش داده شده خروجی ۱۰ قطر اینچ است.


مثال دیگر : اگر یک سه راهه کاهنده ۴×۱۰ جوش داده شود در نتیجه جوشکاری می شود ۲۴=۴+۱۰+۱۰ ( سه راهه سه اتصال دارد) >>> اتصال سه راهه بین دو لوله جوش داده می شود در نتیجه ۳ سر دارد دو تا ۱۰ و یکی ۴ که جمعشون شده ۲۴ قطر اینچ !!!


در پروژه های ساخت قطر اینج برای اندازه گیری / ارزیابی پیشرفت ساخت اسپول لوله کشی ( Fabrication ) بکار برده می شود.اتصال جوش سایز لوله به معادل قطر اینچ جوشکاری تبدیل می شود.


فرمول قطر اینچ : 


:

Dia-Inch = Number of joints  Size of joint per Inch




inch meter برای ارزیابی پیشرفت کار در سایت هست مخصوصاً در تست پکیج هم استفاده می کنند.



لطفا نظر سنجی فراموش نشود

















عمل Transpose یا جابجائی در اکسل



جابجایی محتویات داخل ستون داخل سل های یک  ردیفی و بالعکس










تاریخ قمری




سرآغاز گاه‌شماری هجری قمری روز جمعه «۱ محرم سال ۱ هجری قمری» (۲۷ تیر سال ۱ هجری خورشیدی) برابر با ۱۶ ژوئیه ۶۲۲ میلادی قدیم (ژولینی) و ۱۹ ژوئیه ۶۲۲ میلادی جدید (گریگوری) است.[۸]



گاه‌شماری هجری قمری قراردادی یا حسابی یا رسمی به‌عنوان گاه‌شماری قمری یکنواخت در سطح جهان شناخته شده‌است. در این گاه‌شماری از روش محاسباتی خطی و غیرتجربی برای تقریب زدن طول ماه‌های قمری استفاده می‌شود. ماه‌های قمری در آن به‌طور متناوب ۳۰ روزه (ماه‌های فرد) و ۲۹ روزه (ماه‌های زوج) در نظرگرفته می‌شود و در هر سی سال، ۱۱ سال، با ۳۰ روزه کردن آخرین ماه (ذیحجه) کبیسه می‌شود. بر اساس کبیسه‌گیری رایج در یک دورهٔ سی‌ساله، سال‌های متوالی ۲، ۵، ۷، ۱۰، ۱۳، ۱۶، ۱۸، ۲۱، ۲۴، ۲۶، ۲۹ طول سال به صورت کبیسه (۳۵۵ روزه) است، یعنی چنانچه باقی‌مانده حاصل تقسیم سال قمری به عدد ۳۰ یکی از اعداد مذکور باشد آن سال کبیسه‌است؛ و در نوزده سال دیگر طول سال عادی (۳۵۴ روزه) می‌باشد.[۱۳][۱۴] با توجه به خطی و قراردادی بودن محاسبه این گاه‌شماری نسبت به سال قمری حقیقی (برابر  ۳۵۴.۳۶۷۰۸ روز) طی حدود ۲۴۱۹ سال یکبار به اندازهٔ یک روز نیاز به تصحیح دارد.[۱۵]



روزهای همۀ ماه‌های قمری با هم برابر و دقیقاً 29 روز و 12 ساعت و 44 دقیقه و 3 ثانیه یا 53059028/29 روز است. همچنین ماه‌های همۀ سال‌های قمری با هم برابر و دقیقاً دوازده ماه و برابر با 3670834/354 روز است. اما برای سهولت محاسبات هر سال قمری را 354 روز در نظر می‌گیرند، بدین جهت در یک سال، 6 ماه سی روزی و 6 ماه 29 روزی وجود دارد.

برای جبران کسری سال، هر سه سال یکبار، یک روز اضافه می‌شود؛ یعنی سال سوم 355 روز خواهد بود؛ چرا که مقدار کسری در سه سال، 3670834/0× 3 یا برابر 101/1 روز می‌شود.

نتیجه‌ی مهمی که این محاسبه دارد و نباید از آن غفلت نمود، «قاعده یک در میان» است؛ یعنی در سال قمری، ماه‌‌ها یک در میان 30 و 29 روز، هستند.






باتوجه به اینکه شروع هرماه قمری طبق رصد هلال ماه انجام میشه پس دنبال تبدیل دقیق میلادی به قمری نباشید طبق روش قراردادی می توانید پیش بروید آما در بعضی سال ها ممکن است آن روزی که باید باشد نشود ( چون برنامه نوشته شده شما رصد هلال بلد نیست )



در تصویر بالا 11 دسامبر سال 2028 را برابر 24 رجب 1450 قرار داده.

7/19/622=1/1/1 محرم

12/11/2028

datediff

Diff=513677


در جستجوی گوگل می توانید فرمول زیر برای تبدیل سال میلادی به قمری را بیابید.

H=G-622+(G-622)÷32

H=2028-622+(2028-622)÷32=1449.9375~1450


Jalali:1300/06/20

Hijri : 1340/01/08 محرم

G(MM/DD/YYYY) : 9/11/1921

Diff :  474504



جمعه ۱۳۹۱/۸/۲۶ معادل یک محرم(۱) سال ۱۴۳۴ و ۱۱/۱۶/۲۰۱۲ ( ۱۶ نوامبر)


۱۴۰۰/۶/۲۰ (۹/۱۱/۲۰۲۱:MM/DD/YYYY)

۱-بدست آوردن اختلاف روزهای دو تاریخ شمسی

سال ۱۳۹۱ کبیسه است

-تعداد روزها : از ۱۳۹۱/۸/۲۶ تا آخر سال ۱۳۹۱

۳۰+۳۰+۳۰+۳۰+۳۰-۲۶=۱۲۴

Jalali Leap Years:

۱۳۷۹، ۱۳۸۳، ۱۳۸۷، ۱۳۹۱، ۱۳۹۵، ۱۳۹۹، ۱۴۰۳، ۱۴۰۸

-تعداد روزهای ۱۳۹۲تا ۱۳۹۹ را محاسبه می کنیم بین ۱۳۹۱ تا ۱۳۹۹ تنها ۲ سال کبیسه داریم:

۱۳۹۹-۱۳۹۲+۱=۸×۳۶۵+۲=۲۹۲۲

در بالا چون سال ۹۵و۹۹کبیسه بود اختلاف ۳۶۶و۳۶۵ را برای دوسال که عدد ۲ میشد را در نظر گرفتیم.

-تعداد روزها از اول سال ۱۴۰۰ تا ۱۴۰۰/۰۶/۲۰ :

۵×۳۱+۲۰=۱۷۵


-۳ عدد بدست آمده بالا را با هم جمع می کنیم

۱۲۴+۲۹۲۲+۱۷۵=۳۲۲۱

SELECT DateDiff("d", #11/16/2012#, #09/11/2021#);3221


در تصویر زیر از آغاز تا پایان را ذکر کرده ولی در DateDiff اکسس اختلاف بین دوتاریخ را... توجه کنید که این دو باهم فرق دارند!!!




کبیسه قمری : 

سال Mod 30=2,5,7,10,13,16,18,21,24,26,29


تاریخ قمری ۱/۱/۱۴۳۴ ( ۱۳۹۱/۸/۲۶ )

اضافه کردن عدد ۳۲۲۱ به آن ( ۳۲۲۲ در باحساب)

سال های ۱۴۳۴ ، ۱۴۳۶ ، ۱۴۳۹ ، ۱۴۴۲ کبیسه هستند البته طبق فرمول بالاتر

اگر اختلاف رو ۳۲۲۲ بگیریم و نه ۳۲۲۱ معادله تابع اکسس داریم : 

۳۲۲۱-(۳۵۵-۱)-۳۵۴-۳۵۵-۳۵۴-۳۵۴-۳۵۵

-۳۵۴-۳۵۴-۳۵۵=۳۳


نتیجتا مشخص شد که تبدیل بر اساس تقویم هلالی است و نه قراردادی چون محرم سال ۹۱ بیست و نه روزه است در صورتیکه طبق تقویم قراردادی روزهای فرد ۳۰ روزه و روزهای زوج ۲۹ روزه در نظر گرفته میشود و ماه ۱۲ قمری در سال کبیسه ۳۰ روزه محاسبه می شود.


پس خودتون رو برای تبدیل به قمری یا بالعکس خسته نکنید چون قانون درستی مثل شمسی یا میلادی برا آن حکمفرما نیست.


۱۳۹۱/۸/۲۶ طبق تقویم آن زمان اول محرم است ولی تبدیل زیر ۲ محرم را نشان می دهد چرا که طبق تقویم قراردادی است و نه هلالی

tabdil




حالا خودتون قضاوت کنید 
















فرآیند ایجاد تقویم شمسی در اکسس



۱-فرمی را ایجاد می کنید شامل ۷ باتن در بالا یا بغل با نام گذاری در ویژگی کپشن آنها البته از سمت راست به چپ شامل : شنبه ، یکشنبه ، ... و جمعه 


۲-اگر روزیکم ماهی از یکسالی جمعه باشد در نتیجه باید طبق تصویر زیر ۵ ردیف ۷ تایی باتن یا لیبل داشته باشید



۳-کنترل کمبو باکس یا لیست باکسی ایجاد کنید که سال ها و نام ماه ها در آن فهرست شوند چرا که باتوجه به سال و ماه انتخابی کنترل ها یا لیبل های ایجاد شده در مرحله ۲  پر خواهندشد.

-نحوه پرشدن یا Filling : باید مشخص کنید ، اولِ هرماه چه روزی در هفته است >> شنبه ، یکشنبه و یا جمعه ، سپس در اولین ردیف در ستون شنبه تا جمعه نسبت به قرار دادن اعداد یک تا ۳۰ یا ۳۱ با توجه به ماه انتخابی اقدام کنید.


در تصویر اول فروردین ۷۱ روز شنبه است و چون فروردین ۳۱ روزه است از لیبل ۱ تا ۳۵ اعداد یک تا سی و یک در کپشن کنترل ها قرار گرفته خواهندشد.

bahesabtimeconversion

اختلاف روزهای بین دو تاریخ ۱/۱/۱ (جمعه) تا ۱۳۷۱/۱/۱ (شنبه) عدد ۵۰۰۳۸۳ روز است می توانید در آدرس اینترنتی >>باحساب<< این مقدار را بدست آورید.


اگر فرض شود که یکم جمعه باشدو ماه ۳۱ روزه ، باید از باکس  یا لیبل ۷ شروع به پر کردن  اعداد ۱ تا ۳۱ کنیم :




















این تقویم بر پایه سال اعتدالی خورشیدی برابر با ۳۶۵٫۲۴۲۱۹۸۷۸ روز است؛ که سال تقویمی آن ۳۶۵ و ۳۶۶روزه (کبیسه) می‌باشد.





















تاریخ های میلادی و معادل های شمسی


بازیگر رنج کشیده گذر از رنج ها : 




در گاه‌شماری گرگوری ده روز از تاریخ حذف گردید و کبیسه‌گیری‌های یکنواخت چهارساله نسبتاً کاهش یافت بدینگونه که سال‌های قرن غیرقابل قسمت به ۴۰۰ (مانند: ۱۷۰۰، ۱۸۰۰ و ۱۹۰۰) بدون کبیسه‌گیری باشند. در نتیجه، با احتساب سال گریگوری ۳۶۵٫۲۴۲۵ روز (نسبت به سال حقیقی ۳۶۵٫۲۴۲۱۹۸۷۹ روز) میزان دقت گاه‌شماری میلادی را به عقب‌ماندگیِ یک روز در هر ۳٬۳۲۰ سال رساند.[۶]



DateDiff from 3/22/622 ( 1/1/1 : Jalali  : Friday)

Defaults: vbSunday = 1, vbSaturday = 7


MM/DD/YYYY

datediff

bahesab


1/1/2500

DateDiff:685846

۱۸۷۸/۱۰/۱۲

0+6=6 Friday


2/18/2102

DateDiff:540527

۱۴۸۰/۱۱/۲۹

1+6=7 Saturday


3/20/2999

DateDiff:868180

۲۳۷۷/۱۲/۳۰

Wednsday


2/28/2000

DateDiff:503282

۱۳۷۸/۱۲/۹

Monday


5/23/2012

DateDiff:507750

۱۳۹۱/۳/۳

Wednesday


12/23/1978

DateDiff:495545

۱۳۵۷/۱۰/۲

Saturday


9/11/1978

DateDiff:495442

۱۳۵۷/۶/۲۰

Monday


3/20/2005

DateDiff:505129

۱۳۸۳/۱۲/۳۰

Sunday


3/19/2017

DateDiff:509511

۱۳۹۵/۱۲/۲۹


8/3/2015

DateDiff:508917

۱۳۹۴/۵/۱۲


4/1/2013

DateDiff:508063

۱۳۹۲/۱۰/۱۲


1/2/1979

DateDiff:495555

۱۳۵۷/۱۰/۱۲


1/1/2012

DateDiff:507607

۱۳۹۰/۱۰/۱۱


3/17/2012

DateDiff:507683

۱۳۹۰/۱۲/۲۷


9/21/2021

DateDiff:511158

۱۴۰۰/۶/۳۰


11/22/2026

DateDiff:513046

۱۴۰۵/۹/۱


12/10/2024

DateDiff:512334

۱۴۰۳/۹/۲۰


11/9/2026

DateDiff:513033

۱۴۰۵/۸/۱۸


11/7/1972

DateDiff:493308

۱۳۵۱/۸/۱۶


10/8/2020

510810

۱۳۹۹/۷/۱۷


3/5/2024

512054

۱۴۰۲/۱۲/۱۵


6/6/2024

512147

۱۴۰۳/۳/۱۷


10/9/2023

511906

۱۴۰۲/۷/۱۷


12/31/2023

511989

یکشنبه

۱۴۰۲/۱۰/۱۰


2/5/2023

511660

یکشنبه

۱۴۰۱/۱۱/۱۶


2/8/2023

511663

چهارشنبه

۱۴۰۱/۱۱/۱۹


9/22/2029

514081

۱۴۰۸/۷/۱

شنبه


12/31/2936

516738

۱۴۱۵/۱۰/۱۱

چهارشنبه


3/31/2036

516463

۱۴۱۵/۰۱/۱۲

دوشنبه


12/11/1961

489324

۱۳۴۰/۰۹/۲۰

دوشنبه
















روز عرفه، روز دعاونیایش/ مَاذَا وَجَدَ مَنْ فَقَدَکَ وَ مَاالَّذِی فَقَدَ مَنْ‌وَجَدَک... آن‌کس که تو را ندارد، چه‌دارد؟ و آن‌کس که تو را یافته، چه‌ندارد؟




6 تیر 1402 : مصرف الکل تقلبی


وی گفت: در بخش مراقبت‌های ویژه برخی از بیمارستان‌های خصوصی تعدادی از بیماران ناشی از مسمومیت مصرف الکل بستری هستند و همچنین در بیمارستان‌هایی که مخصوص مسمومیت است نیز نمونه‌هایی مشاهده شده است.

استاد تمام دانشگاه و فوق تخصص مراقبت‌های ویژه ادامه داد: کاهش سطح هوشیاری مسمومیت با متانول، درگیری چشمی، تاری دید است به طوری که بیمارستان‌های تخصصی چشم باید در این خصوص با ما همکاری کنند اما متأسفانه تاکنون این بیماران را پذیرش نکردند و ما فقط با متخصصینی که در بیمارستان هستند ارتباط داریم.

هاشمیان گفت: تاری دید در برخی موارد تبدیل به نابینایی می‌شود بنابراین لازم است اورژانس مخصوص چشم پزشکی برای این بیماران راه اندازی شود تا بتوان مشکلات ناشی از مسمومیت متانول را در آن سریع درمان کرد چرا که از دست رفتن زمان منجر به اتفاقات ناگواری برای این افراد می‌شود که ممکن است بیمار فوت کند.




بنا به نقل وقایع‌نگاران عاشورا وقتی یاران امام حسین(ع) شهید شدند و او تنها ماند این جملات را بر زبان راند که «هَلْ مِنْ ذَابٍّ یَذُبُّ عَنْ حَرَمِ رَسُولِ اللَّهِ ص هَلْ مِنْ مُوَحِّدٍ یَخَافُ اللَّهَ فِینَا هَلْ مِنْ مُغِیثٍ یَرْجُو اللَّهَ بِإِغَاثَتِنَا هَلْ مِنْ مُعِینٍ یَرْجُو مَا عِنْدَ اللَّهِ فِی إِعَانَتِنَا؛ آیا دفاع‌کننده‌ای هست که از حرم رسول خدا دفاع کند؟ آیا یگانه‌پرستی هست که درباره ما از خدا بترسد؟ آیا فریادرسی هست که با فریادرسی از ما به خدا امید داشته باشد؟ آیا مددکاری هست که با کمک به ما امید به آنچه نزد خداست داشته باشد؟»



مطلب زیر خرافه ای بیش نیست  چرا که علما در وجودش شک دارند چون به چشم  ندیده اند یا حداقل روایتی در این مورد از انبیاء نیست.

جناب زعفر جِنی حکایت رسیدن به محضر امام حسین (ع) را برای یکی از علما تعریف نموده که مرحوم دربندی مفصلاً آن قضیه را در کتاب مقتلش آورده:
زعفر گفت: وقتی وارد زمین کربلا شدم دیدم از چهار فرسخ تا چهار فرسخ، لشگر دشمن، امام و یارانش را محاصره کرده اند. همچنین دیدم که فوج عظیم ملائکه که به شمارش نمی آمدند، پَر در پَر ایستاده اند. در یک سمت، منصور ملک با سپاهی از ملائکه و در یک طرف میکائیل با سپاهی از ملائکه، در طرف دیگر اسرافیل با گروه عظیمی از ملائکه، همچنین ملک الرّیاح و ملک البحار و ملک الجبال و ملک دوزخ و ملک النار و ملک العذاب با لشگر خود منتظر اجازه و فرمانند. ارواح صد و بیست و چهار هزار پیغمبر از حضرت آدم(ع) تا حضرت خاتم(ص) هم صف کشیده اند. حضرت خاتم انبیاء (ص) آغوش گشوده و می فرماید: «العجل العجل انّا مشتاقون»: فرزندم شتاب و عجله کن که ما بسیار مشتاق تو هستیم».

امام با گوشه چشم به سوی من نگاه کرد، من لشگر خود را عقب گذاشته و خود را به حضور رساندم، رکاب بوسیدم و بر امام (ع) سلام نمودم، حضرت جواب سلام داد و فرمود: زعفر کجا بودی؟ عرض کردم قربانت گردم، در بئرالعلم مجلس عروسی داشتم. خبر از این واقعه شما نداشتم، خبر بی کسی و غریبی شما را که شنیدم با سی و شش هزار جن آمده ام تا یاری شما نمایم.
حضرت فرمود: وفای شما جنیان از آدمی بیشتر است. خدا و رسول از تو راضی باشند، خدمت تو را خداوند قبول نموده، لازم به زحمت تو نیست، چرا که این ها همه ملائکه فتح و ظفرند. عرض کردم: قربانت شوم چرا اجازه نمی دهی با آنان بجنگیم؟ حضرت فرمود: شما آن ها را می بینید ولی آن ها شما را نمی بینند و این از جوانمردی به دور است.
زعفر عرض کرد: آقاجان! ما هم به صورت انسان ظاهر می شویم، اگر هم کشته شویم، در راه خدا کشته و شهید شده ایم.
حضرت اجازه ندادند و به زعفر جِنی فرمودند بجای خودت برگرد.





























تبدیل شمسی و میلادی



در گاه‌شماری گرگوری ده روز از تاریخ حذف گردید و کبیسه‌گیری‌های یکنواخت چهارساله نسبتاً کاهش یافت بدینگونه که سال‌های قرن غیرقابل قسمت به ۴۰۰ (مانند: ۱۷۰۰، ۱۸۰۰ و ۱۹۰۰) بدون کبیسه‌گیری باشند. در نتیجه، با احتساب سال گریگوری ۳۶۵٫۲۴۲۵ روز (نسبت به سال حقیقی ۳۶۵٫۲۴۲۱۹۸۷۹ روز) میزان دقت گاه‌شماری میلادی را به عقب‌ماندگیِ یک روز در هر ۳٬۳۲۰ سال رساند.[۶]









سال های کبیسه شمسی و بررسی تاریخ میلادی به شمسی



In Memory Of


<<فقط جهت مطالعه>>


برای صِحَّت و سُقم فرمول اعمال شده  در مطالب زیرین لازم است با موارد خیلی بیشتری مورد آزمون قرار گیرد در نتیجه فقط جهت مطالعه قرار داده شده !!! .  اعمال آن در برنامه ها به اختیار مجری است ولی توصیه به  استفاده نمی شود.برای درآورن اختلاف دو تاریخ یا اضافه کردن تعداد روزهایی به تاریخ مد نظر می بایست سال های کبیسه از تاریخ مبنا تا تاریخ درخواستی اعمال گردد تا تاریخ دقیقی بدست آید.


در ابتدا و پایان محاسبات در متن به اختلاف یک تا چند روز در سال های بزرگتر و فاصله دار طبق این روش پی خواهید برد.پس باماباشید



برای سال‌های ۱۲۴۴ تا ۱۳۴۲ چنانچه باقی‌ماندهٔ حاصل تقسیم سال مورد نظر بر عدد ۳۳، یکی از اعداد (۱، ۵، ۹، ۱۳، ۱۷، ۲۱، ۲۶ و ۳۰) باشد آن سال کبیسه خواهد بود. و برای سال‌های اخیر (سال‌های ۱۳۴۳ تا ۱۴۷۲)، به‌جای ۲۱، باقی‌ماندهٔ ۲۲ ملاک خواهد بود.


گاه‌شماری جلالی با حفظ سرآغاز و طول سال با تغییر مبدأ، اسامی و طول ماه‌ها در قالب گاه‌شماری هجری شمسی برجی درآمده و باز با تغییراتی در طول ماه‌ها ضمن تنوع اسامی آنها، عنوان تقویم هجری شمسی پیدا کرد.

این تقویم بر پایه سال اعتدالی خورشیدی برابر با ۳۶۵٫۲۴۲۱۹۸۷۸ روز است؛ که سال تقویمی آن ۳۶۵ و ۳۶۶روزه (کبیسه) می‌باشد.



بر اساس محاسبات مرکز تقویم مؤسسهٔ ژئوفیزیک دانشگاه تهران که مرجع رسمی تقویم ایران است، از سال ۱۲۰۶ تا ۱۴۹۸ هجری شمسی این سالها کبیسه بوده‌اند یا خواهند بود:[۱۵]

۱۲۱۰، ۱۲۱۴، ۱۲۱۸، ۱۲۲۲، ۱۲۲۶، ۱۲۳۰، ۱۲۳۴، ۱۲۳۸، ۱۲۴۳

(۳۳ساله)، ۱۲۴۷، ۱۲۵۱، ۱۲۵۵، ۱۲۵۹، ۱۲۶۳، ۱۲۶۷، ۱۲۷۱، ۱۲۷۶

(۳۳ساله)، ۱۲۸۰، ۱۲۸۴، ۱۲۸۸، ۱۲۹۲، ۱۲۹۶، ۱۳۰۰، ۱۳۰۴، ۱۳۰۹

 (۳۳ساله)، ۱۳۱۳، ۱۳۱۷، ۱۳۲۱، ۱۳۲۵، ۱۳۲۹، ۱۳۳۳، ۱۳۳۷، ۱۳۴۲

(۳۳ساله)، ۱۳۴۶، ۱۳۵۰، ۱۳۵۴، ۱۳۵۸، ۱۳۶۲، ۱۳۶۶، ۱۳۷۰، ۱۳۷۵

(۳۳ساله)، ۱۳۷۹، ۱۳۸۳، ۱۳۸۷، ۱۳۹۱، ۱۳۹۵، ۱۳۹۹، ۱۴۰۳، ۱۴۰۸

(۳۳ساله)، ۱۴۱۲، ۱۴۱۶، ۱۴۲۰، ۱۴۲۴، ۱۴۲۸، ۱۴۳۲، ۱۴۳۶، ۱۴۴۱

 (۳۳ساله)، ۱۴۴۵، ۱۴۴۹، ۱۴۵۳، ۱۴۵۷، ۱۴۶۱، ۱۴۶۵، ۱۴۶۹، ۱۴۷۴

(۳۳ساله)، ۱۴۷۸، ۱۴۸۲، ۱۴۸۶، ۱۴۹۰، ۱۴۹۴، و ۱۴۹۸.


جدول اعداد تعیین‌کننده کبیسه «تقویم حسابی بهروز-بیرشک» تا سال ۳۲۹۳ هجری خورشیدی حسابی

۰ – ۴ – ۸ – ۱۲ – ۱۶ – ۲۰ – ۲۴ (۲۵) – ۲۹ – ۳۳ – ۳۷ – ۴۱ – ۴۵ – ۴۹ – ۵۳ – ۵۷ (۵۸) – ۶۲ – ۶۶ – ۷۰ – ۷۴ – ۷۸ – ۸۲ – ۸۶ – ۹۰ (۹۱) – ۹۵ – ۹۹ – ۱۰۳ – ۱۰۷ – ۱۱۱ – ۱۱۵ – ۱۱۹ (۱۲۰) – ۱۲۴

طبق جدول عددی فوق اگر در باقیمانده تقسیم سال حسابی موردنظر بر عدد ۱۲۸ (میان‌دوره متوالی) یکی از اعداد جدول فوق باقی مانده باشند آن سال کبیسه خواهد بود. با این تفاوت که برای سال‌های ۱ تا ۴۷۳ هجری خورشیدی حسابی اعداد اصلاح شده داخل (دوکمان) که یک شماره بیشتر نسبت به عدد همجوار آن است به‌جای آن به عنوان باقی مانده ملاک خواهد بود (بعلت شکاف بین دو دوره بزرگ).


سرآغاز گاه‌شماری

سرآغاز گاه‌شماری هجری خورشیدی روز جمعه «۱ فروردین سال ۱ هجری خورشیدی» (۲۹ شعبان ۱ سال پیش از هجرت) برابر با ۱۹ مارس ۶۲۲ میلادی قدیم (ژولینی) و ۲۲ مارس ۶۲۲ میلادی جدید (گرگوری) است.[۳] البته روز اول سال یک هجری خورشیدی (از ۱ فروردین تا ۲۴ شهریور) ۵ ماه و ۲۴ روز پیش از هجرت محمد (کمتر از یک سال) است.





کبیسه میلادی نو (گریگوری)

در تقویم میلادی نو سال‌هایی که بر ۴ بخش‌پذیر باشند (باقی‌ماندهٔ تقسیم آن سال بر ۴ برابر ۰ باشد) کبیسه هستند با این استثنا که از میان سال‌هایی که بر ۱۰۰ بخش‌پذیرند (سال‌های انتهای سده)، تنها آنهایی که بر ۴۰۰ نیز بخش‌پذیرند کبیسه هستند.




Leap year List from 1600 to 2100

YearYearYearYearYear
16001696179618961996
16041704180419042000
16081708180819082004
16121712181219122008
16161716181619162012
16201720182019202016
16241724182419242020
16281728182819282024
16321732183219322028
16361736183619362032
16401740184019402036
16441744184419442040
16481748184819482044
16521752185219522048
16561756185619562052
16601760186019602056
16641764186419642060
16681768186819682064
16721772187219722068
16761776187619762072
16801780188019802076
16841784188419842080
16881788188819882084
16921792189219922088
----2092
----2096

Note: 2100 will not be a leap year.





روش زیر برای تبدیل تاریخ میلادی به شمسی ثابت شده نیست ولی با کمک تابع DateDiff در اکسس می توان تا حدی  به جواب نزدیک رسید مثال هایی در زیر  برای درک بیشتر آورده ایم : 



این مطلب برای اشخاصی است که بخواهند بدون اثبات علمی به نتیجه خیلی نزدیک برسند ( مشخص کردن تاریخ شمسی و میلادی  مبنا و بدست آوردن معادل های آنها ) ... مثال های زیر خوانده شود اینجا کد نویسی آموزش داده نمی شود فقط روش برای افرادی که می توانند کد نویسی نُمایند !!! ... کد آماده در وب موجود است شما عزیزان دل می  توانید Google Search کنید . توابع اکسس ( DateDiff و DateAdd ) هم به یاری شما خواهند آمد  احتیاجی به  کد نویسی اضافه نخواهید داشت.شاد و پیروز باشید.



تبدیل تاریخ میلادی به شمسی  : ( اختلاف یک تا چند روز)


مبنای میلادی : 1/1/1922

مبنای شمسی :1300/10/11

روز هفته : یکشنبه


در مثال زیر اختلاف ۴ روز بدست آمد .

MM/DD/YYYY

1/1/2500

SELECT DateDiff("d", #01/01/1922#, #1/1/2500#)=211111

211111\365.25=577+1300=1877

211111-577×365.25=361.75~362

سال ۱۸۷۷ کبیسه نیست

362+11-30-30-29=284

یک عدد به عدد سال اضافه می شود

284-6×31-3×30=8

نتیجه باید 1878/10/12 باشد ولی روز را ۸ بدست آوردیم !!! اختلافی در حدود ۴ روز 

پس متوجه شدید که عدد ۳۶۵.۲۵ که در یکسری سایت ها بیان شده قابل اطمینان نمی باشد.

bahesab



MM/DD/YYYY

2/18/2102

SELECT DateDiff("d", #01/01/1922#, #2/18/2102#)=65792

65792\365.25=180+1300=1480

65792-180×365.25=47

47+11-30=28??? 29 is True

اختلاف یکروز 

نتیجه : شنبه 1480/11/29

bahesab

۶+۱=۷(۱ Sunday On 1922)

saturday=۷


MM/DD/YYYY

3/20/2999

SELECT DateDiff("d", #01/01/1922#, #3/20/2999#)=393445

393445\365.25=1077+1300=2377

393445-1077×365.25=70.75~71

71+11-30-30=22???? 30 is True

اختلاف ۸ روز !!!

نتیجه : 2377/12/30

bahesab



-فرض کنید تاریخ 2000/02/28 باشد



نتیجه : دوشنبه 1378/12/09 


SELECT DateDiff("d", #01/01/1922#, #02/28/2000#)=28547

28547\365.25=78

28547-78×365.25=57.5~58

58-(30-11)-30=9

bahesab

۱+۱=۲


-فرض کنید ، تاریخ 2012/05/23 باشد :


نتیجه :  چهارشنبه 1391/03/03


SELECT DateDiff("d", #01/01/1922#, #05/23/2012#)=33015

33015\365.25=90

33015-90×365.25=142.5~143

سال 90 کبیسه نیست

143-(30-11)-30-29=65

ورود به سال جدید >>> 91

65-31-31=3


91×365.25234×313×3011+3=33015.9593

۳+۱=۴(۱ sunday on 1922)



-فرض کنید تاریخ ، 1978/12/23 باشد :


نتیجه : شنبه 1357/10/2


SELECT DateDiff("d", #01/01/1922#, #12/23/1978#)=20810

20810\365.25=56

20810-56×365.25=356

سال 56 کبیسه نیست

356-(30-11)-30-29=278

ورود به سال جدید >>> 57

278-6×31-30-30-30=2


57×365.2523-11+2=20810.3811

۶+۱=۷(۱ sunday on 1922)


-فرض کنید تاریخ ، 1978/09/11 باشد :

Diff=20203

1+1=2(1 Sunday on 1922)

نتیجه : دوشنبه 1357/06/20



-فرض کنید تاریخ ، 2005/03/20 باشد :


نتیجه : یکشنبه 1383/12/30


SELECT DateDiff("d", #01/01/1922#, #03/20/2005#)=30394

30394\365.25=83

30394-83×365.25=78.25~79

سال 83 کبیسه است.اسفند ۳۰ روزه در نظر گرفته می شود.


79-(30-11)-30=30


۰+۱=۱(۱ sunday on 1922)






MM/DD/YYYY

10/03/2004

SELECT DateDiff("d", #01/01/1922#, #10/03/2004#);=30226

Never do following

--2004-1922=82

--82×365.25=29950.5

--29950.5+30+28+31+30+31+30+31+31

+30+3=30225.5~30226

30226\365.25=82

30226-82×365.25=275.5~276

سال 82 کبیسه نیست

276+11-30-30-29=198

یک عدد به عدد سال اضافه می شود : 83

198-31-31-31-31-31-31=12

نتیجه : یکشنبه ۱۳۸۳/۰۷/۱۲

bahesab

۰+۱=۱(۱ sunday on 1922)










-فرض کنید تاریخ ، 2017/03/19 باشد :


نتیجه : یکشنبه 1395/12/29


Diff : 34776

---2017-1922=95

--95×365.25+31+28+19-1=34775.75~34776

34776\365.25=95

34776-95×365.25=77.25~78(Round-Up)

سال ۹۵ کبیسه است لذا ماه ۱۲ در محاسبات و کسر از Diff در جایی که نیاز است ۳۰ روزه اعمال می گردد.

78+11-30-30=29

bahesab

۰+۱=۱(۱ sunday on 1922)





-فرض کنید تاریخ ، 2017/03/21 باشد :



 نتیجه : سه شنبه 1396/01/01


msaccess_datediff

SELECT DateDiff("d", #01/01/1922#, #03/21/2017#)=34778

34778\365.25=95

34778-95×365.25=79.25~80

سال ۹۵ کبیسه است.و ماه اسفند ۳۰ روزه در نظر گرفته می شود.

80-(30-11)-30-30=1

ورود به سال جدید 96

bahesab

۲+۱=۳(۱ sunday on 1922)



msaccess_datediff

SELECT DateDiff("d", #01/01/1922#, #03/20/2017#)=34777

34777\365.25=95

34777-95×365.25=78.25~79

سال ۹۵ کبیسه است.

79-(30-11)-30=30

۱+۱=۲(۱ Sunday on 1922)

نتیجه : دوشنبه 1395/12/30

bahesab



msaccess_datediff

SELECT DateDiff("d", #01/01/1922#, #03/17/2017#)=34774

34774\365.25=95

34774-95×365.25=75.25~76

سال ۹۵ کبیسه است.

76-(30-11)-30=27

نتیجه : جمعه 1395/12/27

۵+۱=۶(۱ sunday on 1922)

bahesab







-فرض کنید تاریخ ، 2017/06/01  باشد :

Diff=34850

نتیجه : پنج شنبه 1396/3/11

۴+۱=۵(۱ Sunday On 1922)




-تاریخ مبنای میلادی : اول ژانویه 1922

-برگردان شمسی : 11 دی 1300

SELECT DateDiff("d", #01/01/1922#, #01/02/2000#)=28490

28490\365.25=78

28490-78×365.25=0.5~1

1300+78/10/11+1=1378/10/12


۰+۱=۱(۱ Sunday 1922)




-فرض کنید تاریخ ، 2013/04/01  باشد :


نتیجه : دوشنبه 1392/01/12


SELECT DateDiff("d", #01/01/1922#, #04/01/2013#)=33328

33328\365.25=91

33328-91×365.25=90.25~91

سال 91 کبیسه است در نتیجه ماه اسفند ۳۰ روزه در نظر گرفته می شود.


91-(30-11)-30-30=12

چون باقیمانده دارد پس یک عدد به سال اضافه می شود یعنی 1392


۱+۱=۲(۱ Sunday On 1922)




-فرض کنید تاریخ ، 2012/03/20  باشد :


نتیجه : سه شنبه 1391/01/01



SELECT DateDiff("d", #01/01/1922#, #03/20/2012#)=32951

32951\365.25=90

32951-90×365.25=78.5~79

سال 90 کبیسه نیست و ماه اسفند۲۹ روزه است.

79-(30-11)-30-29=1

یک عدد به عدد سال اضافه می کنیم

1391


۲+۱=۳(۱ Sunday On 1922)




-فرض کنید تاریخ ، 2023/06/23  باشد :


نتیجه : جمعه 1402/04/02


SELECT DateDiff("d", #01/01/1922#, #06/23/2023#)=37063

37063\365.25=101=1300+101=1401

37063-101×365.25=172.75~173

سال 1401 کبیسه نیست  ( مبنا ۱۳۰۰/۱۰/۱۱ )

173-(30-11)-30-29=95

یک عدد بعدد سال اضافه میشود 1402

95-31-31-31=2


۵+۱=۶(۱ Sunday On 1922)




ms_datediff

SELECT DateDiff("d", #01/01/1922#, #12/30/2016#)=34697

34697\365.25=94

34697-94×365.25=363.5~364

364-(30-11)-30-29=286

Year=Year+1=94+1=95

286-6×31-30-30-30=10

نتیجه : جمعه 1395/10/10

bahesab

۵+۱=۶(۱ Sunday On 1922)




ms_datediff

SELECT DateDiff("d", #01/01/1922#, #8/30/2020#)=36036

36036\365.25=98

36036-98×365.25=241.5~242

سال 98 کبیسه نیست.

242-(30-11)-30-29=164

Year=Year+1=98+1=99

164-5×31=9

نتیجه : یکشنبه 1399/06/09

bahesab

۰+۱(۱ Sunday On 1922)


ms_datediff

SELECT DateDiff("d", #01/01/1922#, #11/22/2014#)=33928

33928\365.25=92

33928-92×365.25=325

سال 92 کبیسه نیست.

325-(30-11)-30-29=247

Year=Year+1=92+1=93

247-6×31-30-30=1

نتیجه : شنبه 1393/09/01

bahesab

۶+۱(۱ Sunday On 1922)



ms_datediff

SELECT DateDiff("d", #01/01/1922#, #1/31/2024#)=37285

---2024-1922=102

---102×365.25+31-1=37285.5

37285\365.25=102(1300+102=1402)

37285-102×365.25=29.5~30

سال 1402 کبیسه نیست.

30-(30-11)=11


نتیجه : چهارشنبه 1402/11/11

bahesab


۳+۱=۴(۱ Sunday On 1922)



برگردان شمسی به میلادی ( طبق تاریخ شمسی مبنا )  ... نیازمند آزمون و خطاست با چک کردن موارد بیشتر

1,4021,300=102

102×365.25+30+1111=37285.5

ms_dateadd

SELECT DateAdd("d",37285, #01/01/1922#);=1/31/2024 







MM/DD/YYYY

01/01/1964

ms_datediff

SELECT DateDiff("d", #01/01/1922#, #1/1/1964#)=15340

15340\365.25=41

15340-41×365.25=364.75~365

سال 41 کبیسه نیست.

365-30-30-29-6×31-3×30+11=11

Year=Year+1=1341+1=1342

Month:10,11,12,1...6,7..9,10

نتیجه : چهارشنبه 1342/10/11

bahesab

ms_dateadd

۳+۱=۴(۱ Sunday On 1922)




MM/DD/YYYY

03/20/1964

ms_datediff

SELECT DateDiff("d", #01/01/1922#, #3/20/1964#)=15419

15419\365.25=42

15419-42×365.25=78.5~79


42:Kabiseh


79+11-30-30=30

Month:10,11,12

نتیجه : جمعه 1342/12/30

bahesab

ms_dateadd

۵+۱=۶(۱ Sunday On 1922)




ms_datediff

SELECT DateDiff("d", #01/01/1922#, #2/24/1964#)=15394

15394\365.25=42

15394-42×365.25=53.5~54

سال 42 کبیسه است.

54+11-30-30=5

Month:10,11,12

نتیجه : دوشنبه 1342/12/05

bahesab

ms_dateadd

۱+۱=۲(۱ Sunday On 1922)





ms_datediff

SELECT DateDiff("d", #01/01/1922#, #7/20/1964#);=15541

15541\365.25=42

15541-42×365.25=200.5~201

سال 42 کبیسه است 

201+11-30-30-30=122

یک عدد به عدد سال اضافه می شود.

42+1=43

122-31-31-31=29

1+1=2(1 sunday on 1/1/1922)

نتیجه دوشنبه 1343/04/29

bahesab

ms_dateadd




MM/DD/YYYY

11/5/1996

ms_datediff

-DateDiff :

1996-1922=74

74×365.25=27028.5~27029

27029+(31-1)+28+31+30+31+30+31+31+30+31+5=27337

Or

27029+31+28+31+30+31+30+31+31+30

+31+5-1=27337

-Convert to Jalali :

27337\365.25=74

27337-74×365.25=308.5~309

سال ۷۴ کبیسه نیست در نتیجه اسفند ماه ۲۹ روزه است

309+11-30-30-29=231

Month:10,11,12

231-6×31-30=15

Month:1....6,7,8(Aban)

Year=Year+1=74+1=75

1+2=3(1 sunday on 1/1/1922)

نتیجه : سه شنبه ۱۳۷۵/۰۸/۱۵

bahesab






1/1/1940

SELECT DateDiff("d", #01/01/1922#, #1/1/1940#);=6574

6574\365.25=17

6574-17×365.25=364.75~365

سال ۱۳۱۷ کبیسه است در نتیجه ماه اسفند ۳۰ روزه در نظر گرفته می شود.

365+11-30-30-30=286

یک عدد به عدد سال اضافه می شود : 1318

286-6×31-3×30=10

نتیجه :  دوشنبه ۱۳۱۸/۱۰/۱۰

۱+۱=۲(۱ Sunday On 1922)
















اکثرا دنبال این هستیم ( حتی خود بنده ) که بتوانیم به راحتی و در کوتاهترین زمان کد  نویسی ، معادل شمسی تاریخ میلادی روز را بدست آوریم محاسبات بالا کوتاهترین راه ممکن را به نمایش در آورده ( دقیق بودن مطلب فوق باید با بررسی تاریخ های بیشتر در سال کبیسه یا غیر کبیسه مورد آزمون قرار گیرد ) . معادله بالا برای کسانیکه میخواهند یاد بگیرند که چگونه تاریخ شمسی روز را در فرم اصلی نمایش دهند مفید خواهد بود.


روش کار :

۱-در نظر گرفتن یک تاریخ میلادی و شمسی بعنوان پایه و مبنا

1922/01/01 Miladi

1300/10/11 Jalali

۲-با تابع DateDiff در اکسس تعداد روزهای بین دو تاریخ میلادی مبنا ( 1922/01/01 ) و تاریخ میلادی مورد نظر که باید تبدیل شود را استخراج می کنیم.

۳-Diff یا اختلاف روزهای دو تاریخ میلادی گفته شده در مورد ۲  را بر 365.25 تقسیم و عدد صحیح آن را بعنوان سال مورد نظر بصورت موقت در متغیری ذخیره  می کنیم.

۴-عدد صحیحِ حاصل از تفریق دو عدد Diff و مورد ۳ در 365.25 ، عددی است که باید به روز و ماه شمسی مبنا ( 10/11 ... یازده دی )  اضافه یا Add گردد.( عدد تا یک عدد بالاتررُند شود: اگر اعشار داشت اعشار حذف و یک رقم به عدد صحیح اضافه شود با توابع Fix و Abs و Int هم می توان کار را پیش برد)

۵-چنانچه سال فرضی یا موقت در مورد ۳ ، کبیسه بود اسفندماه برای کسر از عدد Diff ، سی روزه در نظر گرفته می شود. 

بطور مثال اگر سال موقت ۹۵ بدست آمد و قرار شد 102 روز به تاریخ مبنا ( غیر از در نظر گرفتن سال ) اضافه شود داریم :

Mah 10 : (30-11)=19

Mah 11 : 30

Mah 12 : 30 ( 95>>Kabiseh)

19+30+30=79

عدد 102 از 79 بیشتر است لذا یک عدد به سال اضافه شده و سال واقعی 96 خواهد بود.

102-79=23

چون عدد مانده 23 روز و کمتر از یکماه است لذا در ماه اول قرار داریم و ماه و روز به ترتیب 1 و 23 خواهد شد.

۶-اختلاف اول ژانویه تا آخر اسفند برای سال کبیسه 79 و سال غیر کبیسه 78 روز است البته اول ژانویه ای هم داریم که معادل ۱۲ دیماه است پس این دوعدد گفته شده کاملا Reliable برای شما نیست بدلیل اینکه اول ژانویه می تواند در ۱۲ دی ماه بیافتد.


-به ساخت توابعی چون زیر نیاز است :

--تابع M_DAY برای مشخص نمودن تعداد روزهای ماه های شمسی و دارای دو آرگومان سال و ماه : سال برای مشخص نمودن کبیسه

Select Case M

Case 1 To 6:D=31:Case 7 To 11:D=30:Case 12:D=iif(Kabiseh(S)=True,30,29):End Select

--نوشتن تابع کبیسه : در بالا توضیح داده شده که برای سال های 1300 که مبنای ما است تا ... و 1343 تا 1472 چطور باید محاسبه گردد.

--عدد Diff تا یکرقم رُند شود.

--تابعی برای کسرروزهای ماه ها از عدد Diff بدست آمده در مورد ۲ :

۱-اضافه کردن عدد ۱۱ ( ماه ۱۰  : شمسی مبنا) به عدد Diff

2-لوپ تا زمانیکه Diff عدد مثبتی بدست آید ادامه پیدا خواهد کرد.

3-  کسر تعداد روزهای هرماه ( از 10 ببعد ) از عدد Diff.

نکته :بعد ازانجام هر کسری باید یک عدد به M که معرف ماه است اضافه شود اگر M بزرگتر از ۱۲ شد M دوباره یک شود و به سال هم یک عدد اضافه شود

مثال : 

M=10

S=92

Diff=325

325+11=336

---Loop :

336-(M:10)30=306

M=M+1=11

M>12 : False

306-(M:11)30=276

M=M+1=12

M>12 : False

276-(M:12)(S:92:Kabiseh=0)29=247

M=M+1=13

M>12 : True>>>M=1>>>S=S+1=93

247-(M:1)31=216

.

.

.

M=M+1=8

M>12 : False

31-(M:8)30=1

M=M+1

1-(M:9)30=-29>0 : False

---End Loop




MM/DD/YYYY

08/18/2020

ms_datediff

SELECT DateDiff("d", #01/01/1922#, #8/18/2020#);=36024

Leap_years_in_the_Gregorian_calendar

--2020-1922=98

--98×365.25+31+28+31+30+31+30+31-1=36023.5~36024

36024\365.25=98

36024-98×365.25=229.5~230

سال ۹۸ کبیسه نیست بنابراین ماه اسفند ۲۹ روزه در نظر گرفته می شود.

230+11-30-30-29=152

در اینجا یکسال به سال 98 اضافه می شود 

152-31-31-31-31=28

bahesab

1+2=3(1 sunday on 1/1/1922)

نتیجه : سه شنبه ۱۳۹۹/۰۵/۲۸



MM/DD/YYY

12/30/2093

SELECT DateDiff("d", #01/01/1922#, #12/30/2093#);=62821

--following is not applicable on 1922 and the past!!!

-171×365.25+31+28+31+30+31+30+31+31+30+31+30+301=62820.75~62821

62821\365.25=171+1300=1471

62821-171×365.25=363.25~364

سال ۱۴۷۱ کبیسه نیست و ماه اسفند ۲۹ روزه می شود.

364+11-30-30-29=286

یک عدد به عدد سال اضافه می شود : 1472

286-6×31-3×30=10

1+3=4(1 sunday on 1/1/1922)

نتیجه : چهارشنبه ۱۴۷۲/۱۰۱۰


vbSunday

1

Sunday

vbMonday

2

Monday

vbTuesday

3

Tuesday

vbWednesday

4

Wednesday

vbThursday

5

Thursday

vbFriday

6

Friday

vbSaturday

7

Saturday



MM/DD/YYYY

02/19/1956

SELECT DateDiff("d", #01/01/1922#, #2/19/1956#);=12467

12467\365.25=34

12467-34×365.25=48.5~49

49+11-30=30

29 Is True

نتیجه : یکشنبه ??? 1334/11/30

۰+۱=۱(۱ Sunday On 1922)

تاریخ بالا  1334/11/29 اعلام شده که می بایست بصورت یک شمارشگرعدد 12467 به تاریخ مبنا اضافه شود با در نظر گرفتن سال های کبیسه 






MM/DD/YYYY

12/27/2119

SELECT DateDiff("d", #01/01/1922#, #12/27/2119#);=72313

72313\365.25=197+1300=1497

72313-197×365.25=360.72~361

سال ۱۴۹۷ کبیسه نیست.

361+11-30-30-29=283

یک عدد به عدد سال اضافه می شود : 1498

283-6×31-3×30=7????>>>>6 is True


برای تاریخ بالا مشخص شد عدد 365.25 یکروز اختلاف را نشان میدهد در نتیجه بهتر است :

-با عددی که  در ابتدا بیان شد  کار را با تاریخ های بیشتری مورد آزمون قرار دهید . یا حاصل تفریق سال در عدد مورد نظر و Diff را در کبیسه RoundUp کنید یا اینکه یک عدد به عدد صحیح حاصل تفریق اضافه نمائید با حذف اعشارالبته.



این مطلب جهت نشان دادن یکروز اختلاف که قبلا گفته شد ارائه گردید 



















 







                  














در صورتیکه مطلب فوق کمکی به شما نُمود لطفا در نظرسنجی شرکت کرده و یا کامنت بگذارید.

باسپاس فراوان از خواندن این مطلب



تیر ۱۴۰۲ : ( خزعلی ) معاون رییس جمهور در امور زنان و خانواده همچنین در دیدار با مردم روستای گرَهوِن افزود: ۲۰۰ میلیون تومان وام و ۲۰۰ میلیون تومان کالابرگ تهیه جهیزیه و ۲۰۰ میلیون وام اشتغال بخشی از تسهیلاتی است که به دهه شصتی‌ها ارائه می‌شود.
































دریافت داده از ترازو ( Scale )




NETComm6.Output = "p" & Chr(13) 'send PRINT command to the scale.
Dim Buffer As String 'define Buffer    
Buffer$ = Buffer$ & NETComm6.InputData 'wait for the data come into the serial port    
WtInfo = Buffer

And i got this
80 00 000S99291235 F80 00 000S99291236 E80 00 000S99291237 D80 00 000S99291238 K80 00 000S9929123



Weight = Wtarray(0)   // assuming the weight is in the 1st position 




Vbcrlf

-Command: SI + CR + LF (53h, 49h, 0Dh, 0Ah)

Response: <LONG> (after establishing stable value)


-Command for Print

Command: SP + <Weight> + CR + LF

Response: <print>


-Enquiry for current weight value

Command: Sx1 + CR + LF

Response: <LONG>













I have a Magellan scanner/scale. It is connected to my pc through rs232. I can read the weight on the scale by sending the command S11 + ENTER in Hyperterminal program and the weight shows on Hyperterminal with no problems at all.



SI + ENTER





7bit


شاتوت (شاه توت : غرب آسیا ) دارای قند طبیعی و سرشار از ویتامین ها مثل کلسیم ، پتاسیم و منیزیم ... ضدسرطان .. پاک کردن روده ها و رفع یبوست ( نه مزمن )




GSM 03.40


SEND SMS through At Command



00150008810100358500600831c7321d14be87f320b3fcdd06a1cbf23228dd6e97c9e930bdccce87422194f6fd2683cc6179580e5abfdd29


TP-UDL : 31(hex) 3×16+1=49

TP-UD :

c7321d14be87f320b3fcdd06a1cbf232

28dd6e97c9e930bdccce87422194f6fd

2683cc6179580e5abfdd29


-Decode UD

--bring hexes from the last to the first 

29ddbf......C7

--Convert hexes to binary (8bit)

0010100111011101....11000111

29(00101001)

--Remove zero(s) at the left

43×8-Int(43×(8/7))×7=1

--Arrange binaries in 7bit

--Convert binary to hex

--Arrange hexes from the last to the first

--Convert hexes to string





Encoding :

Hex_Count=49

Add Zero(s) at the left

[int(48×(7/8))+1]×8-49×7=1 Zero

Arrange binaries in 8bit

Decoding :

Hex_Count : 43

Remove Zero(s) at the first

How many?

43×8-int(43×(8/7))×7=1 Zero

Arrange binaries in 7bit



کاهش شدید ارزش پولی ظرف فقط ۲۰ ماه




رسول خدا در خطبه ای فرمود:  أَیُّهَا النَّاسُ إِیَّاکُمْ وَ خَضْرَاءَ الدِّمَنِ ای مردم از سبزه مزبله پرهیز کنید.

سؤال شد: "خضراء الدمن= سبزه مزبله"  چیست؟

پیامبر فرمود:  الْمَرْأَةُ الْحَسْنَاءُ فِی مَنْبِتِ السَّوْءِ

زن زیبا رو و رعنا که در محیط نامناسب پرورش یافته و پرورده محیط نامناسب اعتقادی و اخلاقی است. (1)

پس خضراء الدمن یعنی دختران  زیبارویی که در خانواده و محیط ناپاک رشد یافته و گر چه زیبا و رعنا و ماننده سبزه بهار خوش آب و رنگ هستند، ولی ناپاک اند. از لحاظ اخلاق و پای بندی  به عفت و حیا، با توجه به تربیت ناپاکی که داشته اند ، نمره قبولی نمی گیرند.



امکان رشد مجدد دندان‌ها به صورت نامحدود

تا کنون تمام آزمایشات بر روی موش‌های مبتلا به این بیماری دندانی انجام شده است. در طی مطالعات، محققان ژنی را کشف کردند که پروتئینی را که در رشد یا عدم رشد دندان نقش دارد، رمزگذاری می‌کند. محققان دریافتند موش‌هایی که فاقد ژن خاصی هستند، تعداد دندان‌هایشان افزایش یافته است. پروتئینی به نام (USAG-۱) که توسط این ژن سنتز شده است، رشد دندان‌ها را محدود می کند.

هنگامی که همه چیز طبیعی باشد، روند رشد پس از جایگزینی دائمی دندان متوقف می‌شود، بر این اساس دانشمندان با تمرکز بر روی این پروتئین آنتی بادی را تولید کردند که می‌تواند به طور موقت از عملکرد این پروتئین جلوگیری کرده و به دندان‌های جدید اجازه رشد دوباره بدهد.



کامنت یکی از شهروندان در بهبودی با لیزر :

سلام.لیزر پرتوان وکم‌توان به جز هزینه ی زیادی که برای بیمار دارد.هیچ خاصیت دیگری در درمان آن ندارد و فقط بعنوان تکنولوژی جدید جیب بیماران را به نفع صاحب دستگاه لیزر خالی میکنند.که اتفاقا همان فیزیوتراپی اثر خیلی بهتری در درمان دارد.
بعد از ده جلسه لیزرپرتوان و نداشتن یک سر سوزن اثر .پزشک معالج همان فیزیوتراپی را تجویزکردند و از بیماران دیگر هم که از لیزر استفاده کرده اند .سوال کردم که هیچکدام راضی نبوده اند و هیچ خاصیتی نداشته. بجز خالی کردن جیب بیمار . واقعا متاسفم برای افرادی که از این دستگاه بعنوان درمان استفاده می کنند و جیب بیماران را خالی میکنن.و متاسفانه پزشکان هم آنها را به این لیزر هدایت میکنند.
لطفا این مطلب رامنتشر کنید که حداقل بقیه بیماران گرفتار این دام لیزر نشوند.




























TP-DCS



26 خرداد 1402 

نتایج طرح فروش خودرو در سامانه یکپارچه اعلام شد و طی آن شاهد هستیم که برای بسیاری از متقاضیان، خودرویی تخصیص نیافته است و بسیاری دیگر نیز باید خودروهای خود را در زمستان ۱۴۰۳ تحویل بگیرند که این مسئله با قول هایی که پیش از این برای تحویل فوری خودروها به مردم داده شده بود کاملاً متناقض است.





11110010 : F2

F0 (240) GSM 7bit  Class 0 (Flash Message)

F1(241)  GSM 7bit Class 1 (ME-specific)

F2(242) GSM 7bit Class 2 (SIM/USIM specific)

F3(243) GSM 7bit Class 3 (TE-specific)

F4(244) 8 bit data Class 0 ( Flah message)

E3(227)    UCS2       Other Inactive

18(decimal:24)   Class 0 (Flash Msg)


76543210<<<Bits

00101000<<<Binary


Coding Group Bits 7..4 :

-00xx : Like 0001 : General Data Coding indication

--Bit 3..0

General Data Coding indication
Bits 5..0 indicate the following:
Bit 5
0    Text is uncompressed
1     Text is compressed
Bit 4
  0  Bits 1 and 0 are reserved and have no message class meaning
1    Bits 1 and 0 have a message class meaning
Bit3 Bit2   Alphabet being used
  0             0            Default alphabet
  0             1           8 bit data

  1             0           UCS2 (16bit)

  1             1            Reserved
Bit1 Bit0  Message class   Description
  0               0              Class 0                    Immediate display (alert)
  0               1              Class 1                         ME specific
  1               0              Class 2                         SIM specific
  1               1              Class 3                          TE specific


NOTE: The special case of bits 7..0 being 0000 0000 indicates the Default Alphabet as in Phase 2



-0100 ... 0111 : Message Marked for Automatic Deletion

-1100Message Waiting Indication Group: Discard Message

--Bits 3..0 are coded in exactly the same way as Group 1101, however, with bits 7..4 set to 1100 the mobile may discard the contents of the message, and only present the indication to the user.


00150008810100358500CB0002C834

CB : 1100  1011

(1011)

Bits1,0 : 11 : Other Message

Bit2 only set to 0

Bit 3 : Set Indication Active



-1101Message Waiting Indication Group: Store Message ( Only 7 bit)

-- This Group allows an indication to be provided for the user about the status of types of message waiting on systems connected to the GSM PLMN. The mobile may present this indication as an icon on the screen, or another MMI indication. The mobile may take note of the Origination Address for the message in this group and group 1100. For each indication supported, the mobile may provide storage for the Origination Address which is to control the mobile indication.

Text included in the user data is coded in the Default Alphabet.
Where a message is received with bits 7..4 set to 1101, the mobile will store the text of the SMS message in addition to setting the indication.
Bit 3           Descrption
   0         Set Indication Inactive
   1         Set Indication Active



Bit1  Bit0    Indication Type
   1       0      Voicemail Message Waiting
   0       1      Fax Message Waiting
   1       0      Electronic Mail Message Waiting
   1      1      Other Message Waiting

Bit 2 is reserved , and set to 0


* Mobile manufacturers may implement the "Other Message Waiting" indication as an additional indication without specifying the meaning. The meaning of this indication is intended to be standardized in the future, so Operators should not make use of this indication until the standard for this indication is finalized.



-1110Message Waiting Indication Group: Store Message (Only UCS2)

--The coding of bits 3..0 and functionality of this feature are the same as for the Message Waiting Indication Group above, (bits 7..4 set to 1101) with the exception that the text included in the user data is coded in the uncompressed UCS2 alphabet.


-1111Data coding/message class (Only GSM 7 bit & 8 bit data)

Bit 3 is reserved , set to 0

Bit2 Message coding

0             Default alphabet

1             8-bit data

Bit1 Bit0 Message Class  Description

0           0           Class 0                   Immediately

display(alert)

0          1          Class 1                  Me specific

1          0          Class 2                  SIM specific

1          1          Class 3                  TE specific



F0(240) GSM 7 bit Class 0 (Flash message)            -

F1(241) GSM 7 bit Class 1 (ME-specific)                   -

F2(242) GSM 7 bit Class 2 (SIM/USIM-specific) -

F3(243) GSM 7 bitClass 3 (TE-specific)                      -

F4(244) 8 bit data Class 0 (Flash message)             -

F5(245) 8 bit data Class 1 (ME-specific)                    -

F6(246) 8 bit data Class 2 (SIM/USIM-specific)  -

F7(247) 8 bit dataClass 3 (TE-specific)

- : Uncompressed , + : Compressed








0015000881010035850048000406450646


48 >>> 0 1 0 0 1 0 0 0

Bit5 : 0 : Uncompressed

Bit4 : 1 : Bits 1 and 0 have a message class 

Bits3,2 : 10 : UCS2(16bits)

Bits1,0 : 00 : Message Class 0


00150008810100358500600002C834

60(96) Gsm 7 bit Default (+: Compressed)

-0110 : Message Marked for Automatic Deletion



PDU TYPE : 15

00010101

Bits1,0 : 01 : SMS-SUBMIT

Bit2 : 1 : RD (Reject duplicate)

Bits4,3 : 10 : VPF : Present (here 00 after 60)

Bit5 : 0 : SRR : Status report not requested

Bit6 : 0 : UDHI : Not present

Bit7 : 0 : RP (Reply path)






























SMS-SUBMIT binary 8bit



15010A91561904472800F4A718496E6920636F6E746F6820666C61736820534D53206C686F

TP-DCS
F0   GSM 7 bit Class 0 (Flash message)
F4   8 bit data  Class 0 (Flash message)


-1st byte: 0×15 or in binary 00010101
--TP-MTI (bit 0&1) = 01 means this PDU SMS type is SMS-SUBMIT
--TP-RD (bit 2) = 1 means reject duplicate if there’s a same SMS with same TP-MR
--TP-VPF (bit 4&3) = 10 means this SMS contain validity period info with relative format
--TP-SRR (bit 5) = 0 means we don’t ask for delivery report
--TP-UDHI (bit 6) = 0 means no user data header information (UDHI)
--TP-RP (bit 7) = 0 means reply path unused
-2nd byte: TP-MR = 0×01, means message reference number is 0×01
-3rd byte: TP-DA length = 0x0A, this is length of destination address.I want to send to my own number which is 6591407482 -> see there’re 10 digits, to TP-DA should be 0x0A or 10 in decimal
-4th byte: TON/NPI info = 0×91 or in binary format 10010001
--TON (bit 6,5,4) = 001 -> means International Number
--NPI (bit 3,2,1,0) = 0001 -> means ISDN telephone number
-5th byte .. 9th byte: 5619044728 -> this is the destination number 6591407482 but written in BCD semioctet format
-10th byte: TP-PID = 0×00 -> means use default protocol identifier
-11th byte: TP-DCS = 0xF4 or in binary format 11110100
--Bit 3,2 = 01, means TP-UD (user data) is encoded using 8 bit format
--Bit 0,1 = 00, means class 0 {this will make this sms become flash sms}
-12th byte: TP-VP = 0xA7 means this SMS is valid only for 24 hours
-13th byte: TP-UDL = 0×18 means the user data/message part length is 24 character
-the rest byte: 
-496E6920636F6E746F6820666C61736820534D53206C686F + Thi is hex representation of string “Ini contoh flash SMS lho”




SMS-SUBMIT 7bit







0001000C91180910325476400005E8329BFD06


-PDU Type : 01

--00000001 >>> 01 : SMS-SUBMIT

-DA : 0C9118091032547

-PID : 40

-DCS : 00 : Alphabet 7bit

-UDL : 05 in hex

UD : E8329BFD06



Decoding Data :

E8 32 9B FD 06

-Reverse Hex

06 FD 9B 32 E8

-Hex to binary

00000110 11111101 10011011 00110010

11101000

-Remove zero from the left

Hex_Count : 5

5×8-int(5×8/7)×7=5

00000110 11111101 10011011 00110010

11101000


110 11111101 10011011 00110010

11101000

-7bit

1101111 1101100 1101100 1100101 1101000

-Put zero before each 7bit

01101111 01101100 01101100 01100101 01101000

-Binary to hex

6F 6C 6C 65 68

-Reverse hex

68 65 6C 6C 6F

-Hex to string

68656C6C6F

Char Count : 5 







At the beginning of both PDUs, 00 is added as the SCA (Service Center Address) to indicate the default SMSC, and 01 is set in the TP-MTI to indicate SMS-SUBMIT. The TP-PID is set to 00 for a normal text message, and 40 (bit pattern: 01000000) for short message type 0. The phone number +819001234567 set as the TP-DA in the figure is a dummy. The TP-UD is set to hello encoded in GSM 7-bit characters


64/16=4,Reminder=0>>>40


For TP-PID = 63 the SC converts the SM from the received TP Data Coding Scheme to any data coding scheme supported by that MS (e.g. the default).


56–62SC-specific; usage based on mutual agreement between the SME and the SC
63A GSM/UMTS mobile station.
64Short Message Type 0
65Replace Short Message Type 1
66Replace Short Message Type 2
67Replace Short Message Type 3
68Replace Short Message Type 4
69Replace Short Message Type 5
70Replace Short Message Type 6
71Replace Short Message Type 7



نوع پیام کوتاه 0 به عنوان پیامک بی صدا Silent SMS شناخته می شود. هر گوشی باید بتواند چنین پیام کوتاهی را دریافت کند، صرف نظر از اینکه حافظه در (U)SIM یا ME موجود است یا خیر، باید دریافت پیام را تأیید کند، اما نباید دریافت آن را به کاربر نشان دهد و باید محتوای آن را دور بیندازد. بنابراین پیام در (U)SIM یا ME ذخیره نخواهد شد.



فلش اس ام اس نوعی پیامک است که مستقیماً در صفحه اصلی بدون تعامل کاربر ظاهر می شود و به طور خودکار در صندوق ورودی ذخیره نمی شود. این می تواند در مواقع اضطراری، مانند اعلام حریق یا موارد محرمانه، مانند ارائه رمزهای عبور یکبار مصرف، مفید باشد.












































decode SMS-DELIVER


پیامک دریافتی 



SMS DELIVER:
SCA-PDU TYPE-OA-PID-DCS-SCTS-UDL-UD


07917238010010F5040BC87238880900F100009930925161958003C16010


-SCA : 07917238010010F5

--Length: 07 in hex (2byte:2digits)

--10010001 : 91 ( + ) International code

including EXT,TON,NPI

TON ( Type of number ) :bit 6,5,4

000 Unknown

001 International number

010 National number

100 Subscriber number
101 Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)
110 Abbreviated number

NPI ( Numbering plan ) bit 3,2,1,0

0000 Unknown
0001 ISDN/telephone numbering plan (E.164/E.163)
0011 Data numbering plan (X.121)
0100 Telex numbering plan

1000 National numbering plan

1001 Private numbering plan

--7238010010F5
---Ext:1;TON:001;NPI:0001

---Reverse number 2byte from the left

27831000015

So Address is ... +27831000015

-PDU Type : 04 in hex 

MTI :

00         MS>SC SMS-DELIVER-REPORT

00         SC>MS SMS-DELIVER

01         MS>SC SMS-SUBMIT

01        SC>MS SMS-SUBMIT-REPORT

10        MS>SC SMS-COMMAND

10        SC>MS SMS-STATUS-REPORT

11        any           Reserved        


--00000100 ( bit7....bit0 )

---bit0,1 : 00 : SMS-DELIVER

---bit2 : 1 : MMS (0=More message)

---bit3 : 0

---bit5 : 0 : SRI (Status report indication)

---bit6 : 0 : UDHI

---bit7 : 0 : RP(Reply path) 

-OA : 0BC87238880900F1

From this address issued

--Length : 0B in hex

--11001000 : C8

Including EXT,TON,NPI

bit3..0 : NPI : 1000 :national numbering

bit6.4 : TON : 100 : Subscriber number

bit7 : EXT : 1 : Extension

--7238880900F1

---Reverse number 2byte from the left 

27838890001

-PID : 00

-DCS : 00

-SCTS : 99309251619580

Time stamp

2099/03/29 15:16:59 08

-UDL : 03

UD : C16010


Decoding UD (user data)


-Reverse hex

10 60 C1

-Hex to binary (octet : 8bit)

00010000 01100000 11000001

-Remove Extra zero from the left

[int(3×(7÷8))+1]×8-3×7=3

10000 01100000 11000001

-set 7bit binary

1000001 1000001 1000001

-Binary to hex

41 41 41

-Revers hex (Bring the hexes in order from end to first)

41 41 41

-Hex to string

AAA




Finally decided done successfully




00040A91890100358500001230205181020C074374589EA6E701


-4374589EA6E701

01 E7 A6 9E 58 74 43

00000001 11100111 10100110

10011110 01011000 01110100

01000011


[int(7×7/8)+1]×8-7×7=7


00000001 11100111 10100110

10011110 01011000 0111010



1111001 1110100 1101001

1110010 1100001 1101000

1000011


01111001 01110100 01101001

01110010 01100001 01101000

01000011


-79 74 69 72 61 68 43


-43 68 61 72 69 74 79


hex to string (43686172697479)


----------------------------------

-Example 

Encoding :

69 Character Or 69 Hex

7bit>8bit ... Add Zero

[int(69×(7÷8))+1]×8-69×7=5

61×8-69×7=5

Decoding :

61 Hex

8bit>7bit ... Remove zero

61×8-int(61×8/7)=5

61×8-69×7=5

----------------------------------


-Encode following hexes


5a6f6f647461722062696120696e6a

6120756e6a61206e612e




Reverse Hex :

2e 61 6e 20 61 6a 6e 75 20 61 6a 6e

69 20 61 69 62 20 72 61 74 64 6f 6f

5a

Hex to ninary , only 7bit from right

0101110 1100001 1101110 0100000

1100001 1101010 1101110 1110101

0100000 1100001 1101010 1101110

1101001 0100000 1100001 1101001

1100010 0100000 1110010 1100001

1110100 1100100 1101111 1101111

1011010

Add Zero to the left

Hex or chararter count : 25

[int(25×(7÷8))+1]×8-25×7=

22×8-25×7=1

0 0101110 1100001 1101110 0100000

1100001 1101010 1101110 1110101

0100000 1100001 1101010 1101110

1101001 0100000 1100001 1101001

1100010 0100000 1110010 1100001

1110100 1100100 1101111 1101111

1011010

8bit

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

Binary to hex

 00101110 11000011 10111001

2e c3 b9

00000110 00011101 01011011

06 1d 5b

10111010 10100000 11000011

ba a0 c3

10101011 01110110 10010100

ab 76 94

00011000 01110100 11100010

18 74 e2

01000001 11001011 00001111

41 cb 0f

01001100 10011011 11110111

4c 9b f7

11011010

da

Reverse hex

da f7 9b 4c 0f cb 41 e2 74 18 94 76 ab

c3 a0 ba 5b 1d 06 b9 c3 2e


25 (character)  to hex : 25÷16=1,Reminder=9>>19

00040A91890100358500003220208080120819daf79b4c0fcb41e274189476abc3a0ba5b1d06b9c32e



decoding

da f7 9b 4c 0f cb 41 e2 74 18 94 76 ab c3 a0 ba 5b 1d 06 b9 c3 2e

Reverse hex and convert to binary

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

Remove zero

Hex_Count=22

22×8-25×7=1

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010


0101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

-7bit to hex (can add zero to each 7bit then convert to hex)

0101110 1100001 1101110

2e 61 6e

0100000 1100001 1101010

20 61 6a

1101110 1110101 0100000

6e 75 20

1100001 1101010 1101110

61 6a 6e

1101001 0100000 1100001

69 20 61

1101001 1100010 0100000

69 62 20

1110010 1100001 1110100

72 61 74

1100100 1101111 1101111

64 6f 6f

1011010

5a


2e 61 6e 20 61 6a 6e 75 20 61 6a 6e

69 20 61 69 62 20 72 61 74 64 6f 6f

5a

Reverse hex and convert to string

5a6f6f647461722062696120696e6a

6120756e6a61206e612e























Concatenates message



If you send a long text message containing only characters that are part of the GSM 03.38 character set, then each SMS segment can contain up to 153 characters. (140 bytes - 6 bytes for the concatenation header leaves 134 available bytes, or 7 * 134 = 1072 bits. The most 7-bit characters that can be packed into 1072 bits is 153.)

If you send a long text message that includes any characters that require Unicode encoding, then each SMS segment can contain up to 67 characters. (67 * 16 = 1072 bits)


140×8=1120   1byte=8bits 

160×7=1120    1byte=7bits

1120-6×8(see below)=1072

1072/7=153 in 7bit 

1072/8=134 in 8 bit 


05 00 03 CC 02 01=6Byts=6×8bits=48bits


in 12bits ( Unicode )  like persian

(1072-48)/16=67 Characters can be sent in  each part



UDHI 


05 00 03 44 03 01


05 : Length including 5 byte
00 : indicate multipart
03 : Subpart length
44 : Refrences from 00 to FF
03 : Total number to be send
01 : Sequence number



در ارسال بصورت پَک شده ۷ بیتی برای ارسال پیامک
چند پارتی 153 کاراکتر قابل ارسال است و در ۸ بیتی
134 کاراکتر ... در یونیکد یا 16 بیتی تنها 67 کاراکتر
را می توان در هر پارت ارسال کرد تا در مبدا بصورت
پیوسته در قالب یک پیام مشاهده شوند.

در ارسال بصورت پک شده ۷ بیتی می بایست در ابتدا
hex اسکی کد کاراکتر را برعکس نموده و تبدیل به
باینری کرد ، سپس محاسبه کرد که چند صفر قبل از
اولین کد باینری قرار گیرد تا تعداد جمع مجموعه بر ۸
تقسیم پذیر باشد.۷ رقم ۷ رقم جداسازی کرده و به هگز
تبدیل می نمائیم ، هگزهای بدست آمده را از آخر به اول
مرتب کرده و آنرا به کاراکتر تبدیل می کنیم.
در ارسال بصورت ۸ بیتی همان تبدیل به هگز کافیست
در ارسال بصورت ۱۶ بیت هم همان کد یونیکد کاراکتر
قرار می گیرد.


مثال در ارسال بصورت پَک ۷ بیتی :
فقط کدهای اسکی در ۷ بیتی مجاز هستند
ارسال کلمه Hi ... به طول ۲ بایت
Hex(H)=48
Hex(i)=69
هگزها را از آخر به اول مرتب می کنیم
69 48
هگزها را به باینری تبدیل می کنیم البته ۷ بیتی
یعنی جدا کردن ۷ رقم از سمت راست بایتری ۸
بیتی
69 : 01101001
48 : 01001000
حال باید از سمت راست ۷ رقم جدا کرد
1101001 1001000
در اینجا چند صفر می بایست قبل از باینری اول
قرار داد؟ تا جائیکه تعداد کل بر ۸ بخشپذیر باشد
2×7=14
16 بر ۸ بخشپذیر است لذا اگر 14 را از 16 کم
کنیم عدد باقیمانده 2 است پس 2 تا صفر اضافه
می کنیم
00 1101001 1001000
شروع به جداسازی ۷ رقم ۷ رقم می کنیم
00110100 11001000
باینری را به هگز بر می گردانیم
34 C8
هگزها را از آخر به اول مرتب می کنیم 
C834

0011000A9189010035850000AA02C834

PDU Type : 11
MR : 00
DA : 0A918901003585
PID : 00
DCS : 00 7bit ( Alphabet )
VPF : AA ( 4 days validity period )
UDL : 02 Length of char in hex
UD : C834 ( Hi )


129÷16=8 , Reminder=1
145÷16=9 , Reminder=1
129- if the value of address does not start with
a "+" character. For example, "85291234567".
145- if the value of address starts with a "+"
character. For example, "+85291234567"

Address 

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

EXT : 1

TON : Bit 6 5 4  Type Of Number 

Bit
6 5 4
Meaning
0 0 0Unknown
0 0 1International number
0 1 0National number

NPI : Bit 3 2 1 0 : Numbering plan
0 0 0 1ISDN/telephonenumbering
plan (E.164/E.163)

10010001=91 (+)
10100001=A1
10000001=81

0011000A9A89010035850000AB02C8348
00110008A1010035850000AB02C8348
hex(9A)=9×16+10=154(decimal)
hex(A1)=10×16+1=161(decimal)







پس از کشته شدن مرحوم کیان پیرفلک
به دست تروریست‌ها مادر وی سبک 
جدیدی از بلاگری به نام بلاگری خون 
را آغاز کرد. این کار اکنون باعث
 شهادت یک افسر پلیس در ایذه و 
یتیم شدن پنج فرزند او شده است.
 حالا خواهر قاتل افسر پلیس هم به 
بلاگری خون روی آورده است.

















SMS-SUBMIT in 8bit





It is possible to use a 16 bit CSMS reference number in order to reduce the probability that two different concatenated messages are sent with identical reference numbers to a receiver. In this case, the User Data Header shall be:

  • Field 1 (1 octet): Length of User Data Header (UDL), in this case 06.
  • Field 2 (1 octet): Information Element Identifier (IEI), equal to 08 (Concatenated short messages, 16-bit reference number)
  • Field 3 (1 octet): Length of the Information Element (IEL), excluding the IEI and the IEL; equal to 04
  • Field 4 (2 octets): 0000-FFFF, CSMS reference number, must be same for all the SMS parts forming the concatenated message
  • Field 5 (1 octet): 00-FF, total number of parts. The value shall remain constant for every short message which makes up the concatenated short message. If the value is zero then the receiving entity shall ignore the whole information element
  • Field 6 (1 octet): 00-FF, this part's number in the sequence. The value shall start at 1 and increment for every short message which makes up the concatenated short message. If the value is zero or greater than the value in Field 5 then the receiving entity shall ignore the whole information element.




0051000C912943524295050004AA0F060804112F01014869206475646521


-SCA : 00

-PDU Type : 51 (01010001)

from right 

bit0,1: 01:SMS-SUBMIT

bit3,4 : 10 : VPF present

bit6 : UDHI present

-MR : 00

-DA : 0C91294352429505

lengrh : 0C : 12

number : +923425245950

-PID : 00

-DCS : 04 ( 8 bit ) binary

-VPF : AA

-UDL : 0F : 15

-UDHI : 060804112F0101

-UD : 4869206475646521

Hex to string : put above UD 

https://codebeautify.org/hex-string-converter

































decode SMS-SUBMIT



SMS-SUBMIT including : 
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD



0891683108200805F01151048181160000FF16C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01



-SMSC : 0891683108200805F0

--Length : 08 (2digit 2digit)

--number : 91683108200805F0

---International : 91 (+ )

---683108200805F0

Reverse 2digits

86 13 80 02 80 50 00

number is >>> +8613800280500

-PDU Type : 11

--00010001

>>>from right to left 

---MTI : 01 ( SMS SUBMIT )

---RD : 0 ( Reject duplicate )

---VPF : 10 means present see FF after DCS

---SRR : 0 status report not requested

---UDHI : 0 no header present in multi part sms

---RP : 0 (Replay path )

-MR : 51 in hex : 5×16+1=81

-DA : 04818116

--Length : 04

--Number : 818116

---national : 81

---8116

Reverse

1861

number >>> 1861

-PID : 00 ( Protocol ID )

-DCS : 00 ( Data coding scheme : alphabet 7bit )

-VPF : FF in hex 141 days

( Validity period format bit3,4 present in pdu type )

-UDL : 16

-UD : C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01---Decoding User Data 

C8329BFD66B5F320B8BC4CA7E7

41F7B79C4D0E01

---Reverse hex

01 0E 4D 9C B7 F7 41 E7 A7 4C

BC B8 20 F3 B5 66 FD 9B 32 C8

hex_count :20

---hex to binary

00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000

---Remove zeros from the left

20×8-int((20×(8/7))×7=6

20×822×7=6


00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000


---Seperate in 7bits

0100001 1100100 1101100

1110010 1101111 1110111

0100000 1111001 1110100

1110100 1100101 1110010

1110000 0100000 1111001

1101101 0101100 1101111

1101100 1101100 1100101

1001000

---Binary to hex


21 64 6C 72 6F 77 20 79 74

74 65 72 70 20 79 6D 2C 6F

6C 6C 65 48


---Reverse hex


48656C6C6F2C6D79207072657474

7920776F726C6421


hex_count=22>>>22÷16=1 Reminder=6

UDL=16


---Put hex here

https://codebeautify.org/hex-string-converter



Finally decoded done successfully.


Encoding : 

Hex_Count:22

Int(22×(7÷8))+1-22×7=6

Add 6 Zero to the first

Decoding : 

Hex_Count :20

20×8-int(20×(8/7))=6

Remove 6 zero from the first







GSM-7 messages break down as follows:

  • Standard single SMS messages: For GSM phones with 7-bit character encoding, a standard SMS message can contain a maximum of 160 characters. That is 1120 bits / (7 bits/character) = 160 characters for a single SMS message.
  • GSM-7 multi-part or concatenated messages: When the message text is longer than 160 GSM characters, the message is concatenated and sent. When a message is concatenated, the user data header (UDH) consumes 6 bytes or 48 bits. This reduces the maximum number of characters in each message part:

1120 bits - 48 bits = 1072 bits

1072 bits / (7 bits/character) = 153 characters per message part.





























decode SMS-SUBMIT




079144872000626011000C914477000910320011002154747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29



-0791448720006260 : SMSC

--07 : Length(Hex)

---Number :

91448720006260

91 : International ( + )

448720006260

Reverse 2digits from left

number is ... 44 78 02 00 26 06

-11 : PDU Type

--00010001

bit0,1(from right) : 01 : MTI

SMS-SUBMIT :01 & DELIVER : 00

bit2 : 0 : RD ( Reject duplicate )

bit3,4 : 10 : VPF : present

bit5 : 0 : SRR

bit6: 0 : UDHI : not present ( for concatenated messages or multi part)

bit7 : 0 : RP ( Reply path )

-00 : MR ( Message refrence in hex )

-0C91447700091032 : DA (send To this)

--0C : Length in hex

C=0×16+12=12

---Number

91 : International ( + )

447700091032

Reverse 2digits from the left

number is ... 44 77 00 90 01 23

-00 : PID

-11 : DCS ( Data coding scheme )

Alphabet 7bit

--Group coding

General data coding

11 GSM 7BIT CLASS 1 (ME-specific)


-00 : VPF
( Ckeck bit3,4 of PDU Type [10] ,it means present)

-21 : UDL in hex

-54747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29 : UD


---Decoding User Data ( UD )

Data coding is ... alphabet mode 


54747A0E4ACF416190BD2CCF8

3E6E9369C5D06B5CBF379F85C06

E95A29


-Reverse above Hex 

29 5A E9 06 5C F8 79 F3 CB B5 06 

5D 9C 36 E9 E6 83 CF 2C BD 90 61

41 CF 4A 0E 7A 74 54


-Hex to binary

00101001 01011010 11101001

00000110 01011100 11111000

01111001 11110011 11001011

10110101 00000110 01011101

10011100 00110110 11101001

11100110 10000011 11001111

00101100 10111101 10010000

01100001 01000001 11001111

01001010 00001110 01111010

01110100 01010100



Hex_Count (2digits)=29

How many zeros to be remove? ( from the left of binery [Octet])

29×8-int(29×8/7)×7=1


Remove 1 Zero from the left then Set to septet (7bit) All binaries

0101001 0101101 0111010

0100000 1100101 1100111

1100001 1110011 1110011

1100101 1101101 0100000

1100101 1101100 1110000

1101101 1101001 1110011

0100000 1111001 1110010

1100101 1110110 0100000

1100001 0100000 1110011

1101001 010 0000 1110011

1101001 1101000  1010100


-Binary to hex

Ex : 010 1001:010=2,1001:9

29 2D 3A 20 65 67 61 73 73

65 6D 20 65 6C 70 6D 69 73

20 79 72 65 76 20 61 20 73

69 20 73 69 68 54

-Reverse hex 

546869732069732061207665727920

73696D706C65206D65737361676520

3A2D29

Hex_Count=33

33 >>> 33÷16=2 Reminder=1>>21

21... is the actual length of UDL

-Put hex here

https://codebeautify.org/hex-string-converter


Finally decoded done successfully!!!

do not forget >>> like & comment 



Have a sweet day 

































decode SMS-SUBMIT




0001AB0B915121551532F400C80F3190BB7C07D9DFE971B91D4EB301


Data coding : SMS Default Alphabet


00 : SMSC ( use cell phone default )

01 : PDU Type

-00000001 : 01 >>> SMS-SUBMIT

--bit0,1:01 MTI message type indicator

--bit2 : 0 RD reject duplicate

--bit3,4 : 00 VPF not presented

--bit5 : 0 SRR status not requested

--bit6 : 0 UDHI not presented

--bit7 : 0 RP reply path

Decimal =10×16+11=171
AB : MR ( Message refrence ) hex value

DA : 0B915121551532F4

Destination address

--0B : Length hex value

decimal=0×16+11=11

International number : 91(+)

number : 5121551532F4

51 21 55 15 32 F4 ( remove F )

decode : 15125551234

finally >>> +15125551234

00 : PID

C8 : DCS 

--Coding Group: Message Waiting Info: Discard Message

C8  : Voicemail Active
C9  : Fax Active
CA  : E-mail Active

0F : UDL

3190BB7C07D9DFE971B91D4EB301 : UD


decoding User Data :

-Reverse hex

01B34E1DB971E9DFD9077CBB9031

-Change to bunary

00000001 10110011  01001110

00011101 10111001 01110001

11101001 11011111 11011001

00000111 01111100 10111011

10010000 00110001

-How many zeros to be remove from the left?

14×814×(8÷7)×7=0 ( means nothing )


--convert 7bits 7bits to hex value


0000000:00

1101100:6C

1101001:69

1100001:61

1101101:6D

1100101:65

1100011:63

1101001:69

1101111:6F

1110110:76

0100000:20

1110111:77

1100101:65

1101110:6E

0100000:20

0110001:31


-Reverse hex

31206E657720766F6963656D61696C00

-Hex to string ( Copy here )

https://codebeautify.org/hex-string-converter




finally decoded done successfully.
































decode SMS-SUBMIT



Read following  first : 

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP

0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU




SMS-SUBMIT :
000100
0B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


-SMSC Defualt in cell phone : 00

-PDU TYPE : 01

00000001

Starting from right  :

bit0,1 : 01 >>> SMS-SUBMIT

bit2 : 0 >>> RD ( Reject duplicate)

bit3,4 : 00 >>> VP (Valudity period)

if 00 means not present

bit5: 0 >>> SRR (Status report requested) if 1 report requested

bit6: 0 >>> UDHI (User data header indicator) ... use for cancatenated message if 1 means header is present like 05 00 03 CC 02 01 (total02/number01)

bit7: 0 >>> RP ( Reply path ) 

-MR : 00 ( Message refrence by SMSC )

-DA : 0B915892214365F7

DA Len : 0B (Destination address Length)

International code : 91 : Display (+)

Number : 58 92 21 43 65 F7

reverse number from begining as 2 digits

58>>>85

So >>>> 85291234567

---From : +85291234567

-PID : 00

-DCS : 00 (Alphabet) (Dada scheme coding)

if Unicode >>> 08

-UD : 21493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E

UDL : 21 in hex value (User data length)

UD : 493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


decoding Data : 

-Reverse Hex value


2EE7973E1E7CF2ED41D3C65E88326ECBCD06FE883CF3C395073D283A49


-Hex to binary

00101110 11100111 10010111 00111110

00011110 01111100 11110010 11101101

01000001 11010011 11000110 01011110

10001000 00110010 01101110 11001011

11001101 00000110 11111110 10001000

00111100 11110011 11000011 10010101

00000111 00111101 00101000 00111010

01001001


Change octet to septet

--Get the number of zeros to be remove.

29×833×7=1

29×8-int(29×8/7)×7=1


-Remove 1 Zero from the left of first above binary ( octet : 00101110 )  and convert 7bits 7bits to hex value like as follows : 



0101110:2E

1110011:73

1100101:65

1100111:67

1100001:61

1110011:73

1110011:73

1100101:65

1101101:6D

0100000:20

1110100:74

1111000:78

1100101:65

1110100:74

0100000:20

1100100:64

1101110:6E

1100101:65

1110011:73

0100000:20

1101111:6F

1110100:74

0100000:20

1111001:79

1110011:73

1100001:61

1100101:65

0100000:20

1110011:73

1101001:69

0100000:20

1110100:74

1001001:49


-Binary to Hex and reverse

4974206973206561737920746F207365

6E642074657874206D65737361676573

2E

-Hex to text convertor : 

https://codebeautify.org/hex-string-converter



finally decoded done successfully !!!



Please do not hesitate to forget >>> Like and Comment






















SMS-SUBMIT



-Decode UD(User data) in 7bit (Sending max 160 char)-(Ascii 140 Char Max Len)


below Text(fingilish)  to Hex


4d616e206d6f6469726520696e206d616a6d6f6f652068617374616d206c6f7466616e2062612062616e64652068616d6168616e672062617368696420676f6c616e616d2e


Length : 69 (2digits)-change to hex value

Hex : 69÷16=4 & 69-4×15=5 : 45

So UDL(User data length)=45 


Hex to binary  : 

2E=2×16+14=46(decimal)

46÷2=23 Reminder=0

23÷2=11 Reminder=1

11÷2=5    Reminder=1

5÷2=2     Reminder=1

2÷2=1        Reminder=0

1÷2=0   Reminder=1

0÷2=0 Reminder=0


From Down to up :


hex(2E):decimal(46):binary(0101110)




Reverse Hex : 

2E6D616E616C6F672064696873616220676E6168616D61682065646E6162206162206E6166746F6C206D617473616820656F6F6D6A616D206E6920657269646F6D206E614D



2E : octet(00101110)>>>septet(01011110)[Len 7 from the right]


0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101



Add the required zero from the left until it is devided by 8 : 

69×7+x Mod 8=0

7bit > 8bit

int(69×7/8)+1=61×8-69×7=5



00000 0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101


Seperate 8digits (octet) : 


00000010111011011011100001110111

01100001110110011011111100111010

00001100100110100111010001110011

11000011100010010000011001111101

11011000011101000110000111011011

10000111010000100000110010111001

00110111011000011100010010000011

00001110001001000001101110110000

11100110111010011011111101100010

00001101101110000111101001110011

11000011101000010000011001011101

11111011111101101110101011000011

10110101000001101110110100101000

00110010111100101101001110010011

01111110110101000001101110110000

11001101


تبدیل باینری های بالا  طبق جدول به Hex : 


02 ED B8 77 61 D9 BF 3A 0C 9A 74 73 C3 89 06 7D D8 74 61 DB 87 42 0C B9 37 61 C4 83 0E 24 1B B0 E6 E9 BF 62 0D B8 7A 73 C3 A1 06 5D FB F6 EA C3 B5 06 ED 28 32 F2 D3 93 7E D4 1B B0 CD



برعکس کردن مقادیر Hex : 


CDB01BD47E93D3F23228ED06B5C3EA

F6FB5D06A1C3737AB80D62BFE9E6B0

1B240E83C46137B90C4287DB6174D8

7D0689C373749A0C3ABFD96177B8ED

02


00110008810100358500000C45CDB01BD47E93D3F23228ED06B5C3EAF6FB5D06A1C3737AB80D62BFE9E6B01B240E83C46137B90C4287DB6174D87D0689C373749A0C3ABFD96177B8ED02

UDL(User data length)=45hex=69




Address Example  : 


Alphanumeric address is at first put to the GSM 7-bit default alphabet, then encoded the same way as any message text in TP-UD field (that means it is 7-bit packed) and then the address is supplied with the "number" length and TON and NPI.

For example, a fictional alphanumeric address Design@Home is converted to the GSM 7-bit default alphabet which yields 11 bytes 44 65 73 69 67 6E 00 48 6F 6D 65 (hex), the 7-bit packing transforms it to 77 bits stored in 10 octets as C4 F2 3C 7D 76 03 90 EF 76 19; 77 bits is 20 nibbles (14 hex) which is the value of the first octet of the address. The second octet contains TON (5) and NPI (0), which yields D0 hex. The complete address in the GSM format is 14 D0 C4 F2 3C 7D 76 03 90 EF 76 19.

-Text to Hex Value : Design@Home

44657369676e40486f6d65

Length : 11

-Reverse Hex Values

65 6D 6F 48 40 6E 67 69 73 65 44

-Binary ( 7 bit from the right )

1100101 1101101 1101111 1001000

1000000 1101110 1100111 1101001

1110011 1100101 1000100

-Add required zero to the left : 

int(11×7/8)+1=10×8-11×7=80-77=3

000 1100101 1101101 1101111 

1001000 1000000 1101110 1100111 

1101001 1110011 1100101 1000100

-Octet :

00011001011101101110111110010001

000000110111011001111101

001111001111001011000100

-Binary to Hex :

19 76 EF 91 03 76 7D 3C F2 C4

-Reverse Hex : 

C4 F2 3C 7D 76 03 91 EF 76 19


80÷4=20>>>hex(14)


The format of addresses in the GSM 03.40 is described in the following table:

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

the nibble is often called a semi-octet


-Ext : usaually 1

-TON ( Type of number )

bit 6,5,4 :

unknown 000

international number : 001

National number : 010

Network specific number : 011

Subscriber number  100

Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)  101

Abbreviated number 110

Reserved for extension 111


-NPI ( Numbering plan id )

bit 3,2,1,0

Unknown 0000

ISDN/telephone numbering plan (E.164/E.163) 0001

Data numbering plan (X.121) 0011

Telex numbering plan 0100

Service Centre Specific plan 0101

Service Centre Specific plan 2) 0110

National numbering plan 1000

Private numbering plan 1001

ERMES numbering plan (ETSI DE/PS 3 01 3) 1010

Reserved for extension 1111



EXT : 1 , TON : 001 , NPI : 0001 :

10010001 >>>>  Hex : 91

EXT : 1 , TON : 000 , NPI : 0001 :

10000001 >>>> Hex : 81


1 010 1000 : A8


00110008A8010035850008051006450647080006650666


1 001 1001 : 99


0011000A9989010035850008051006450647080006650666






002414
D0C4F23C7D760390EF76190000111011315214000BE474D81C0EBB5DE3771B


-TP-DCS : 


Message Classes
ValueMessage Class
0 00 - Flash messages
0 11 - ME-specific
1 02 - SIM / USIM specific
1 13 - TE-specific

Flash messages are received by a mobile phone even though it has full memory. They are not stored in the phone, they just displayed on the phone display.


Coding Group : General Data Coding


00  0   GSM 7 bit Default
08  8   UCS2        Default
10 16 GSM 7 bit  Class 0 (Flash message)
14 20 8 bit data Class 0 (Flash message)
18 24 UCS2 Class 0 (Flash message)
20 32 GSM 7 bit   Default  +(compressed)
30 48 GSM 7 bit  Class 0 (Flash message) +(compressed)

Message Marked for Automatic Deletion :
40 64 GSM 7 bit Default
44 68 8 bit data Default
48 72 UCS2       Default

48 : Hex , 72 : decimal

50 80 GSM 7 bit Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
54 84 8 bit data Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
70 112 GSM 7 bit Class 0 (Flash message) +(compressed)


0031000B9189199370489400480036062F06310020062D062706440020062A0633062A0020062706310633062706440020067E06CC0627064506A9002006470633062A0645

UDL:decimal(54),Hex(36)

062F : د

Length from 0B to the end : 66





























SMS in Alphabet mode



SMS DELIVER:
SCA-PDU TYPE-OA-PID-DCS-SCTS-UDL-UD
SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD




Mode Alphabet : 160  Character in part 1 ( Ascii 140,binary septet 160 )

Text : Salam

1-Ascii text to Hexadecimal

53 61 6C 61 6D

?H53

2-Decimal to binary




83÷2=41 Reminder 1

41÷2=20 Reminder 1

20÷2=10 Reminder 0

10÷2=5 Reminder 0

5÷2=2 Reminder 1

2÷2=1 Reminder 0

1÷2=0 Reminder 1

Hex53Decimal83=1010011

Hex61Decimal97=1100001

Hex6CDecimal108=1101100

Hex61Decimal97=1100001

Hex6DDecimal109=1101101



3-Change 8 bit to 7 bit  : 10001100>0001100

Seperate 7 digits from Right 

4-Reverse Binary from last hex to the first

1101101 1100001 1101100 1100001 1010011

5-how many 0 reqired?  5×(7+1)-5×7=5

Add 5 Zero to the left 

00000 1101101 1100001 1101100 1100001 1010011

6-Change binary  to hex



0000011011011100001110110011000011010011


0110=0×2^(3)+1×2^(2)+1×2^(1)+0×2^(0)=6


0D33D3






7-Reverse Hex

D3303BDC06



SMS SUBMIT

00311E08810100353800000A05D3303BDC06


MR(Message refrence)=hex(1E):decimal(30)

DCS(Data coding scheme):00

Validity : 0A

UDL(User data length) : 05

UD (User data) : D3303BDC06




Packed




0110001 0110010 0110011 0110100 0110101 0110110 0110111 0111000

Reverse binary:

0111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Add Zero to the first 8×(7+1)-8×7=8

000000000111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Seperate 8 digits 8 digits :

00000000 : 00

01110000 : 70

11011101 : DD

10110011 : B3

01010110 : 56

10001100 : 8C

11011001 : D9

00110001 : 31

Reverse Hex : 

31 D9 8C 56 B3 DD 70 00


0031000881010035850000000831D98C56B3DD7000

Message : 12345678






-Hex

Hex Len:16

54 61 73 68 20 4D 65 6E 65 20 53 69 6C 65 73 68

-Septet

1010100 1100001 1110011 1101000 0100000 

1001101 1100101 1101110 1100101 0100000

1010011 1101001 1101100 1100101 1110011

1101000

-Reverse binary

1101000 1110011 1100101 1101100 1101001

1010011 0100000 1100101 1101110 1100101

1001101 0100000 1101000 1110011 1100001

1010100

-16×(7+1)-16×7=16

-Required Zero at the first =16

8 digits separation

00000000: 00

00000000:00

11010001:D1

11001111:CF

00101110:2E

11001101:CD

00110100:34

11010000:D0

01100101:65

11011101:DD

10010110:96

01101010:6A

00001101:0D

00011100:1C

11110000:F0

11010100:D4

-Revers Hex

D4 F0 1C 0D 6A 96 DD 65 D0 34 CD 2E CF D1 00 00


00310008810100358500000B10D4F01C0D6A96DD65D034CD2ECFD10000

UDL=16(decimal)=10(Hex)

UD=D4F01C0D6A96DD65D034CD2ECFD10000



SCA

Service Center Address information element

Telephone number of the Service Center

PDU Type

Protocol Data Unit

Type

 

MR

Message Reference

successive number (O. .255) of all SMS-SUBMIT Frames set by the MOBILE

OA

Originator Address

Address of the originating SME

DA

Destination Address

Address of the destination SME

PID

Protocol Identifier

Parameter showing the SMSC how to process the SM (as FAX, Voice etc)

DCS

Data Coding Scheme

Parameter identifying the coding scheme within the User Data (UD)

SCTS

Service Center Time Stamp

Parameter identifying time when the SMSC received the message

VP

Validity Period

Parameter identifying the time from where the message is no longer valid in the SMSC

UDL

User Data Length

Parameter indicating the length of the UD-field

UD

User Data

Data of the SM

RP

Reply Path

Parameter indicating that Reply Path exists

UDHI

User Data Header Indicator

Parameter indicating that the UD field contains a header

SRI

Status Report Indication

Parameter indicating if the SME has requested a status report

SRR

Status Report Request

Parameter indicating if the MS has requested a status report

VPF

Validity Period Format

Parameter indicating whether or not the VP field is present

MMS

More Messages to Send

Parameter indicating whether or not there are more messages to send

RD

Reject Duplicate

 

MTI

Message

Type

Indicator

Parameter describing the message type

00 means SMS-DELIVER

01 means SMS-SUBMIT




TPDU Types
TP-MTIdirectionmessage type
0 0MS → SCSMS-DELIVER-REPORT
0 0SC → MSSMS-DELIVER
0 1MS → SCSMS-SUBMIT
0 1SC → MSSMS-SUBMIT-REPORT
1 0MS → SCSMS-COMMAND
1 0SC → MSSMS-STATUS-REPORT
1 1anyReserved


SMS-DELIVER is used to deliver a message from SMSC to a mobile phone.


Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT


According to above table ( PDU Type ) :  

Submit : MTI-RD-VPF-SRR-UDHI-RP

Deliver : MTI-MMS-LP-SRI-UDHI-RP



TP-SRI(only set by SMSC) :

0: a status report will not be returned to the SME

1: a status report will  be returned to the SME






00400881010035850008322131313121000B050003CC020106450648

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP
0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU

11=00010001

31=00110001

61=01100001


006100088101003585000809050003CC02010645
PDU  61 : 01100001
From the rightest digit : 
bit0,1:MTI:01:SMS-SUBMIT
bit 2:RD:0
bit 3,4:VP:00 Not Present
bit 5:SRR:1:report requested
bit6:UDHI:1:Present:050003CC0201
bit7:RP:0


0031000881010035850008BB020645
PDU 31 : 00110001
MTI : 01 : SMS-SUBMIT
-Different with PDU 61
From the rightest digit ( See Bold )
VP : 10 : Present : BB(21 Day validity)
UDHI : 0 : Not Present


0021000881010053850008020645
PDU  21 : 00100001
bit0,1 : 01 : MTI : SMS-SUBMIT
bit 5 : 1 : SRR : status report request
VP : not present
UDHI : not present

0025000881010035850008020645
SMSC:00 >Using Sms center number from cell phone
MR : Message refrence (Hex value) : 00
Usaully originated from SMSC and no need changing it from 00 to another
TO : 10005358 : 01003558
iff Odd Number then Add F to the last then reverse 2-digits from the left
PDU 25 : 00100101
bit0,1 : 01 : SMS-SUBMIT
bit2 : 1 : RD : Reject duplicate
bit3,4 : 00 : VP : not present
bit5 : 1 : SRR : status report requested
bit6 : 0 : UDHI : not present ( use in concatenated message : multi part )
bit 7 : 0 : RP : not present

00F5000881010035850008CC09050003BB04010645
VP:CC:84days
Data header:050003BB0401
UDL:09
UD:050003BB04010645
text: م
SMSC:00 (Use default center in cell)
PDU F5 : 11110101
bit0,1 : MTI : 01 : SMS-SUBMIT
bit2 : RD : 1
bit3,4 : VP : 10 : validity present
bit5 : SRR : 1 : status report requested
bit6 : UDHI : 1 : present ( Concatenated Message )
bit7 : RP : 1 :  present




there are 40, 44, and 60, there are additional header fields because it is a concatenated SMS. This means that the SMS is divided into parts and sent in segments, and then the modem/phone reassembles them. And there are headers for collecting the SMS parts




0021000881010035850008020645

SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD

PDU TYPE

21=00100001






AT COMMAND : 

Sending in text mode

AT

>ATOK

AT+CMGF=1[ENTER]
Enter the destination phone number
AT+CMGS=”+61419879619”[ENTER]
Enter the text message and terminate it with “CTRL Z”
>hello[CTRL Z]




Baud Rate:19200 : bps
Data Bits : 8
Stop Bits : 1
Parity N : None

AT+CMGS=18 (actual pdu length)
>0011000A814091786991000001
05E8329BFD06[CTRL Z]

+CMGS: 12

OK 

To : 0419879619

Message : hello

PDU type : SMS-SUBMIT (11)

Refrence : 0 (00)

Validity : 10 minutes (01)

Data coding : SMS Default Alphabet

UDL : 05

UD : E8329BFD06



+CMGF: 0
OK
SMS message for is configured for PDU mode
Checking SMS Mode…
AT+CMGS=48

0011000881010035850000aa28D3E614D42CCFE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB5D


+CMGS: 23

OK


UDL:28

message : SMS Message sent from AT Command Tester.

Hex Value of message : 

534d53204d6573736167652073656e742066726f6d20415420436f6d6d616e64205465737465722e

Length : 40 (2digits)

UDL in alphabet mode is the length of septet before encoding to octet.

40decimal=28hex

40÷2=2 40-2×16=8 so 28



AT COMMAND : READ 


AT+CMGR=1 [ENTER]

+CMGR: 0,,24

07911614786007F0040B911604994743F400009930139100406B05E8329BFD06

OK










برای دفع سنگ کلیه  خربزه را تمیز شسته و با پوست و گوشت و تخم داخل مخلوط کن بریزید تا کامل میکس شود و روزی 2تا ۳ لیوان میل کنید .

 















SMSPDU-DELIVER


069189190150132006918908080008712042518192818406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A



***06918919015013

06>>>Length (91/89/19/01/50/13)  91=1 Len

91>>>+

8919015013>>>9891100531


***200691890808000871204251819281

TP-DCS : Data Coding Scheme (08)

TP-SCTS : Time Stamp

712042518192>>>YYMMDD:170224

518192>>>HHMMSS:151829

TP-UDL(User Data Length) & TP-UD

***8406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A

0628 has 2 Length :06/28

User Data Length : 

132 Decimal to Hex ?!!!

132>>>132\16 & 132  Mod 16>>>84



Concatenated SMS

in every part 70 Characer including space

05 00 03 CC 03 01

05 00 03 CC 03 02

05 00 03 CC 03 03


Field1: Length of UDH

Field2: IEI (information Element Identifier)-1 octet

Field3: IEL(information Element Length)-1 octet

Length Excluding IEI

Field4 : Unique Refrence number For All Parts-1 octet

From 00 to FF   ( 00-FF )

Field5 : Total number of parts-1 octer

00-FF ... Not Be Zero

Field6 : this part's number in sequence-1 octet

Start from 1 To 






Sending Message : ( Single Part )


PDU
07912160130300F411000A8158888700890000aa27D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01


SCA(Service Center Address)07912160130300F4
length 07
Address type 91
Service center address 2160130300F4

PDU-TYPE11

MR (Message ID) 00
DA (Destination Address) : 0A815888870089

Lenght of the address : 10>>>0A

Address Type : 81

Destination phone number: 5888870089
PID (Protocol ID) : 00
DCS (Data Coding Scheme) : 00
VP(Validity Period ) : aa
UDL (User Data Length) :  39 >>> 27
(User Data) :
D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01




another Ex. Submit-SMS

Message Split into two part

just part 1 :

007100098121436587F90008008C050003000201063306440627064500200639064406CC0020062D06270644062A002006860637064806310647002006450646002006270644062706460020062F06310020062C064406330647002006470633062A06450020064800200646064506CC0020062A06480646064500200635062D0628062A002006A9064606450020063406280020063306270639

Split Message >>>> 05 00 03 00 02 01

Data Coding Scheme >>> 08 ( UCS )  Like Persian format




00310D0881010035850008011E0645064606380645002006280627063400200641063106320646062F0645


Status Report : 31

MR ( Message Refren e ) : 0D

UDL ( User Data Length ) : 16 >>> Hex=10

UD ( User Data ) : 0645064606380645002006280627063400200641063106320646062F0645




User Data Header (UDH) is a binary structure which may be present at the start of a short message in the Short Message Service in GSM. It does not contain any text, but it specifies how the message should be formatted and processed.

UDH can be used to form Concatenated SMS





SMS (Short Message Service) can contain up to 160 characters, using the 7-bits GSM default alphabet or 140 characters for an 8 bit alphabet or 70 characters for a 16 bit UCS-2 alphabet.



MultiPart SMS : Submit-SMS


----- PDU---1/7 ------

0071000881010035850008058C050003000701062F0631002006AF0648063406CC200C0647062706CC00200633063106CC002006AF064406A9063306CC002006330627064506330648064606AF0020062706320020062C064506440647002006330627064506330648064606AF002006AF064406A9063306CC0020006100350030002006480020006100350031002006280647002006470645

08(Length)-81-10005358>>>088101003585

User Data Length (UDL) : Decimal=140>>>Hex=8C

UDH ( User Data Header ) : 050003000701

05 Length 00 03 00 Refrence 07 Total 01 Number

Length: 152

----- PDU---2/7 ------

0071000881010035850008058C050003000702063106270647002006AF0648063406CC200C0647062706CC00200645062D0628064806280020062F06CC06AF063106CC002006470645068606480646002006AF064406A9063306CC002000610032003100200645063406A906440020062A0628062F06CC064400200073006D00730020062806470020006D006D0073002006280647200C0635

Length: 152

----- PDU---3/7 ------

0071000881010035850008058C05000300070306480631062A0020062E0648062F06A906270631002006CC06A900200645063406A9064400200628063306CC0627063100200631062706CC062C0020064800200622063206270631062F06470646062F0647002006270633062A002E00200645063906450648064406270020062806270020062706410632062706CC06340020062A0639062F

Length: 152

----- PDU---4/7 ------

0071000881010035850008058C0500030007040627062F002006A906270631062706A9062A06310020062706330020062706450020062706330020062F0631002006330627064506330648064606AF00200028064506390645064806440627064B0020003300300030002006A906270631062706A9062A06310029002006280647200C063506480631062A0020067E06CC0634200C06410631

Length: 152

----- PDU---5/7 ------

0071000881010035850008058C050003000705063600200073006D0073002006CC06270020067E06CC0627064506A900200645062A064606CC0020062806470020067E06CC06270645002006860646062F002006310633062706460647200C062706CC002006CC06270020006D006D00730020062A0628062F06CC06440020064506CC200C06340648062F002E0020062A0628062F06CC0644

Length: 152

----- PDU---6/7 ------

0071000881010035850008058C0500030007060020067E06CC0627064500200645062A064606CC0020062806470020067E06CC06270645002006860646062F0020063106330627064606470020062706CC0020062A062C063106280647002006460627062E06480634062706CC0646062F06CC002006270633062A002006A9064700200647064606AF06270645002006270631063306270644

Length: 152

----- PDU---7/7 ------

007100088101003585000805740500030007070020067E06CC0627064506A900200637064806440627064606CC0020062F0631002006330627064506330648064606AF00200648002006AF0648063406CC200C0647062706CC002006270646062F0631064806CC062F06CC00200631062E0020064506CC200C062F0647062F002E

Length: 128





SMS-SUBMIT

Message To : 10005358

00710E088101003585001A000E050003CC07010645064606380645



Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT



004008810100358500083231213121530016050003CC030106450646063806450200062806270634

DeliveyDate/Time :

323121312153>>>2023/12/13 13:12:35

TP-UDL : Decimal:22>>>Hex:16

TP-UDH : 050003CC0301




















الگوریتم لان ( Luhn algorithm )





الگوریتم لان یا فرمول لان، که به الگوریتم "پیمانه ۱۰" نیز مشهور است، یک فرمول ساده برای درستی یابی تعداد زیادی شماره شناسایی است، مانند شماره کارت‌های اعتباری، شماره‌های IMEI و شماره ملی.



در محاسبات یک Payload ظرفیت حمل یک بسته یا سایر واحدانتقال داده است


شرح برای شماره ای که حاوی Check digit نباشد : 

-شماره شامل 10 رقم 

--اولین رقم سمت راست را در نظر می گیریم و آنرا دوبل می کنیم مثلا اگر رقم سمت راست یک باشد عدد دوم میشود دو

--عدد یک و دو ( و به ترتیب تکرار می کنیم ) را زیر رقم های سمت چپ قرار می دهیم و در هم ضرب می کنیم 

--عدد حاصل از ضرب هر رقم ( در یک یا ۲ ) اگر دو رقمی شد ، آن عدد دو رقمی حاصله را رقم اول و دومش را با هم جمع می کنیم

--اعداد بدست آمده را باهم جمع می کنیم

--از فرمول زیر برای Check digit استفاده می کنیم 

10-(s mOod 10)


Example :

7992739871


1->>>> 1

2>>>> 1×2=2

3>>>>

7x1=7

9×2=18 >>>> 1+8=9

9×1=9

2×2=4

7×1=7

3×2=6

9×1=9

8×2=16 >>>> 1+6=7

7×1=7

1×2=2


s=Sum(7+9+9+4+7+6+9+7+7+2)=67

10-(67 mod 10)=3

67÷10=6.7>>67-(6×10)=67-60=3


final >>>> 79927398713












حوادث روزگار نامروت : 


محسن فوق‌لیسانس حسابداری داشت و یک تاجر بین‌المللی و پولدار بود. همه‌‌چیز در زندگی او به خوبی پیش می‌رفت تا اینکه شریکش سر او را کلاه گذاشت و اموالش را تصاحب کرد. محسن ماند با کلی بدهی؛ او در فضای مجازی از 10 پزشک به‌صورت آنلاین مشورت گرفت تا با شیوه بیهوشی از زنان سرقت کند. او که سال‌ها قبل مقام قهرمانی شطرنج کشور و کیک بوکسینگ را کسب کرده بود حالا تبدیل به یک سارق حرفه‌ای شده است.

چون ورشکست شدم. شریکم سرم را کلاه گذاشت و از کشور فرار کرد. مرا اینجوری نگاه نکنید، زمانی برای خودم برو و بیایی داشتم؛ مدام سفر خارجی می‌رفتم و زندگی‌ام لاکچری بود اما شریکم که از چشمانم بیشتر به او اعتماد داشتم زندگی‌ام را با خودش برد و کاری در حقم کرد که تبدیل به یک ورشکسته و بعد سارق حرفه‌ای شدم.







ISO 8583 ( تبادل پیام تراکنش مالی )


ISO 8583 یک استاندارد بین المللی برای کارت تراکنش مالی  منشا پیام های تبادلی است


-فرمت پیام 

--نشانگر نوع پیام یا MTI

از ۴ رقم تشکیل شده ، رقم اول نسخه ، رقم دوم هدف کلی پیام ، رقم سوم چگونگی جریان در سیستم و رقم چهارم  مکان منبه پیام در زنجیره پرداخت را مشخص می کند


مثال : برای 0110

رقم اول از سمت چپ : نسخه 1987
رقم دوم از سمت چپ : کلاس پیام ( یک برابر پیام مجوز)
رقم سوم از سمت چپ : عملکرد پیام (  یک برابر جواب )
رقم چهارم از سمت چپ : چه کسی ارتباط را آغاز می کند ( صفر برابر خریدار )  
بنابراین ، MTI 0110 یک پیام پاسخ مجوز است که در آن  تراکنش واقعی توسط خریدار انجام شده است.

0*** - ISO 8583:1987
1*** - ISO 8583:1993
2*** - ISO 8583:2003
...


یک بیتمپ کدباینری است در این ایزو که نشان میدهد کدام فیلد  در یک پیام تراکنش مالی  موجودیت دارد . هر بیت بیانگر یک تک فیلد است ، با یک به معنی موجودیت و 0 عدم موجودیت فیلد .
مثال : 
ما فیلدهای زیر را در پیام  ایزو دریافت کردیم
 3, 4, 6, 7, 10, 12, 13, 14, 21, 24, 25, 27, 29, 30, 33, 34, 36, 39, 44, 48, 52, 55, 57, 59, 62,63

 اگر بعنوان باینری بخواهیم ارائه کنیم بصورت زیر می شود : 64 بیت برابر با ۸ بایت از باینری 

 0011 0110 0101 1100 0000 1001 1010 1100 1101 0010 0001 0001 0001 0010 1010 0110


0011 از سمت چپ شروع کنید  00  اول یعنی فیلد اول و دوم وجود ندارند و دو تای بعدی که یک هستند یعنی فیلد سوم و چهارم موجود هستند (فیلد چهارم میشه مبلغ تراکنش)

وقتی بخواهیم چیزی را خواناتر و فشرده تر سازیم ، می توانیم باینری را به صورت 16 بایت از مقدار هگزادسیمال ( Unpacked ) نشان دهیم که به شکل زیر می شود

365C09ACD21112A6

در زیر نشان داده شده که چگونه هگزادسیمال از باینری بدست آمده 

0011 -> 3
0110 -> 6
0101 -> 5
1100 -> C
... etc
مثال دیگر : موجودیت بیت ها 
3,4,7,11,12,13,15,17,32,35,37,41,43,48,
49,60,61,62,63,64,100,102
0011(3) 0010(2) 0011(3) 1010(A) 1000(8) 0000(0) 0000(0) 0001(10010(2) 1000(8) 1010(A) 0001(1) 1000(8) 0000(0) 0001(1) 1111(F)
323A800128A1801F0000000014000000
بصورت ۱۶ کاراکتر هگزادسیمال : 
Primary : 323A800128A1801F
Secondary :0000000014000000

فیلد 49 ( Currency ) برای ایران : کد ۳۶۴

Iran

IRR

364

درجدول ستون Data Field رو ملاحظه کنید که جلوی مقدار 49 ذکر کرده Alpha numeric به طول ۳ کاراکتر ( یعنی می توان یکی از IRR یا کد 364 را وارد کرد.)

----بیتمپ ممکن است به صورت ۸ بایت داده باینری یا بصورت 16 کاراکتر هگزادسیمال ارسال شود.0-9 ، A-F در مجموعه کاراکترهای ASCII یا EBCDIC. یک فیلد تنها زمانی وجود دارد که بیت خاص در بیتمپ درست باشد.به عنوان مثال ، بایت 82x و باینری 1000 0010 و بدین معنی است که  فیلدهای 1 و 7 در پیام موجود است و فیلدهای 2 تا 6 وجود ندارند.

Field 1 : Binary 1000 : Hex 8
Field 64 : Binary 0001 : Hex 1
8000000000000001 (Fields 1, 64)
Field 127,128 :Binary  0011 : Hex 3
0000000000000003
(secondary bitmap) Fields 127, 128


1011001000111000000000000000000000001000100000010000000000010000 .
-Now group it by 4 when it will be like
1011 0010 0011 1000 0000 0000 0000 0000 0000 1000 1000 0001 0000 0000 0001 0000 .
-Get the Hex value of each of the 4 groups.
1011 = B
0010 = 2
0011 = 3
1000 = 8
and so on
-Now put them all together to get the primary bitmap  :
B238000008810010


020012100000000080000000001100000504135520122348IRR
MTI:0200
Primary Bitmap : 1210000000008000
Field 4,7,12,49 are prsent


در ISO 8583 یک Bitmap فیلد یا زیرفیلدهایی درون یک پیام است ، که مشخص می کند سایر عناصر داده یا زیر فیلدهای عنصر داده در جای دیگری از پیام وجود دارند یا خیر.

یک فیلد زمانی وجود دارد که بیت مربوطه در بیتمپ تنظیم شده باشد.بعنوان مثال ، یک هگز با مقدار 0x82 ( دسیمال 130 ) باینری 0010 1000 است.یعنی فیلدهای 1 و 7 در پیام وجود دارند و فیلدهای 6،5،4،3،2 و 8 وجود ندارند.

Bitmap ممکن است بعنوان 8 بایت از داده باینری یا کاراکترهای هگزادسیمال ( A-F , 0-9 ) در کاراکتر اسکی بیان گردد.یک پیام شامل حداقل یک بیتمپ با نام Primary bitmap خواهد بود و نمایانگر اجزاء داده 1 تا 64 موجود است.وجود یک بیتمپ ثانویه اختیاری نیز با بیت اول در بیت مپ اولیه نمایش داده می شود ( یعنی اگر بیت اول یک باشد مثل کد باینری 1000 در اول کدهای باینری Primary با دارا  بودن اولین کاراکتر سمت چپ که  یک است ، نشاندهنده وجود Secondary Bitmap است.  در صورت وجود ، بیتمپ ثانویه نشان می دهد که آیا عناصر داده 65 تا 128 وجود دارند یا خیر .به طور مشابه یک بیتمپ سوم می تواند برای نشان دادن حضور فیلدهای 129 تا 192 استفاده شود ، اگر چه این عناصر به ندرت استفاده می شوند.


مثال : 

مقدار بیتمپ داده شده 

70 10 00 11 02 C0 48 04

هگز 70 برابر 0000 0111 ( شمارش از سمت چپ ، دوم تا چهارمین بیت یک است ، که نشان می دهد فیلد 2 تا 4 موجود هستند.)


هگز 10 برابر باینری 0000 0001 ( اولین بیت متعلق به فیلد 9 است ، همچنین بیت چهارم اینجا نشان می دهد که فیلد 12 موجود است.)


هگز 00 یا باینری 0000 0000 ( هیچ فیلدی موجود نیست )


هگز 11 یا باینری 0001 0001 ( فیلد 28 و 32 موجودند)


هگز 02 یا باینری 0010 0000 ( فیلد 39 موجود است)


هگز C0 یا باینری 0000 1100 ( فیلد 41 و 42 موجودند )



هگز 48 یا باینری 1000 0100 ( فیلد 50 و 53 موجودند)


هگز 04 یا باینری 0100 0000 ( فیلد 62 موجود است )



هگز به دسیمال : 
(70)₁₆ = (7 × 16¹) + (0 × 16⁰) = (112)₁₀
دسیمال به هگز
112÷16=7
112-(7×16)=0
70

هگز 7 به باینری ( دودویی)
7/2=3 , reminder=1
3/2=1 , reminder=1
1/2=0 , reminder=1
So >>> 111 ... 0111
5/2=2 , Reminder=1
2/2=0 , Reminder=0
0/2=0 , reminder=1
So >>> 101 ... 0101
&H57 = 01010111




فیلد 4 حاوی مبلغ تراکنش می باشد، به طور کلی اگر تراکنشی دارای مبلغ باشد، باید مقدار آن را در فیلد شماره 4 با طول ثابت 12 رقم قرار دهد برای مثال 1000 تومن را باید 000000010000 در نظر گرفت.

b 64 منظور تشکیل شده از ۶۴ بیت 
n یعنی فقط  عددی  وقتی dot دارد یعنی تا آن طول
در جدول زیر فیلد 4 ستون Type یعنی  فقط ارقام با طول دوازده کاراکتر
فیلد 7 برای تاریخ و زمان با طول ۱۰ کاراکتر مثل 0504162603 اولی Date و بعدی شامل ساعت دقیقه و ثانیه 
Data fieldTypeUsage
1b 64Bitmap
2n..19Primary account number (PAN)
3n 6Processing Code
4n 12Amount Transaction
5n 12Amount, settlement
6n 12Amount, cardholder billing
7n 10Transmission date & time
8n 8Amount, cardholder billing fee
9n 8Conversion rate, settlement
10n 8Conversion rate, cardholder billing
11n 6System trace audit number (STAN)
12n 6Local transaction time (hhmmss)
13n 4Local transaction date (MMDD)
14n 4Expiration date (YYMM)
15n 4Settlement date
16n 4Currency conversion date
17n 4Capture date
18n 4Merchant type, or merchant category code
19n 3Acquiring institution (country code)
20n 3PAN extended (country code)
21n 3Forwarding institution (country code)
22n 3Point of service entry mode
23n 3Application PAN sequence number
24n 3Function code (ISO 8583:1993), or network international identifier (NII)
25n 2Point of service condition code
26n 2Point of service capture code
27n 1Authorizing identification response length
28x+n 8Amount, transaction fee
29x+n 8Amount, settlement fee
30x+n 8Amount, transaction processing fee
31x+n 8Amount, settlement processing fee
32n ..11Acquiring institution identification code
33n ..11Forwarding institution identification code
34ns ..28Primary account number, extended
35z ..37Track 2 data
36n ...104Track 3 data
37an 12Retrieval reference number
38an 6Authorization identification response
39an 2Response code
40an 3Service restriction code
41ans 8Card acceptor terminal identification
42ans 15Card acceptor identification code
43ans 40Card acceptor name/location (1–23 street address, –36 city, –38 state, 39–40 country)
44an ..25Additional response data
45an ..76Track 1 data
46an ...999Additional data (ISO)
47an ...999Additional data (national)
48an ...999Additional data (private)
49a or n 3Currency code, transaction
50a or n 3Currency code, settlement
51a or n 3Currency code, cardholder billing
52b 64Personal identification number data
53n 16Security related control information
54an ...120Additional amounts
55ans ...999ICC data – EMV having multiple tags
56ans ...999Reserved (ISO)
57ans ...999Reserved (national)
58ans ...999
59ans ...999
60ans ...999Reserved (national) (e.g. settlement request: batch number, advice transactions: original transaction amount, batch upload: original MTI plus original RRN plus original STAN, etc.)
61ans ...999Reserved (private) (e.g. CVV2/service code   transactions)
62ans ...999Reserved (private) (e.g. transactions: invoice number, key exchange transactions: TPK key, etc.)
63ans ...999Reserved (private)
64b 64Message authentication code (MAC)
65b 1Extended bitmap indicator
66n 1Settlement code
67n 2Extended payment code
68n 3Receiving institution country code
69n 3Settlement institution country code
70n 3Network management information code
71n 4Message number
72n 4Last message's number
73n 6Action date (YYMMDD)
74n 10Number of credits
75n 10Credits, reversal number
76n 10Number of debits
77n 10Debits, reversal number
78n 10Transfer number
79n 10Transfer, reversal number
80n 10Number of inquiries
81n 10Number of authorizations (PUTA!)
82n 12Credits, processing fee amount
83n 12Credits, transaction fee amount
84n 12Debits, processing fee amount
85n 12Debits, transaction fee amount
86n 16Total amount of credits
87n 16Credits, reversal amount
88n 16Total amount of debits
89n 16Debits, reversal amount
90n 42Original data elements
91an 1File update code
92an 2File security code
93an 5Response indicator
94an 7Service indicator
95an 42Replacement amounts
96b 64Message security code
97x+n 16Net settlement amount
98ans 25Payee
99n ..11Settlement institution identification code
100n ..11Receiving institution identification code
101ans ..17File name
102ans ..28Account identification 1
103ans ..28Account identification 2
104ans ...100Transaction description
105ans ...999Reserved for ISO use
106ans ...999
107ans ...999
108ans ...999
109ans ...999
110ans ...999
111ans ...999
112ans ...999Reserved for national use
113ans ...999
114ans ...999
115ans ...999
116ans ...999
117ans ...999
118ans ...999
119ans ...999
120ans ...999Reserved for private use
121ans ...999
122ans ...999
123ans ...999
124ans ...999
125ans ...999
126ans ...999
127ans ...999
128b 64Message authentication code (This field belongs to Philipine's Eifle Tower)



00Approved or completed successfully
03Invalid merchant
09Request in progress
12Invalid transaction
13Invalid amount
14Invalid card number (no such number)
19Re-enter transaction
20Invalid response
33Expired card
41Lost card
51Not sufficient funds
54Expired card
57Transaction not permitted to cardholder
58Transaction not permitted to terminal
59Suspected fraud
101expired card
111invalid card number
119transaction not permitted to cardholder
120transaction not permitted to terminal
201expired card


Hex : 080020200000008000000000000000013239313130303031

Table 3. Primary Bitmap
bytehex valuebit valuefield #

0

20

0010 0000

3

1

20

0010 0000

11

2

00

0000 0000

3

00

0000 0000

4

00

0000 0000

5

80

1000 0000

41

6

00

0000 0000

7

00

0000 0000


MTI (0800)
bitmap (2020000000800000)
طبق بالا فیلدهای 3 ، 11 و 41 موجودند بنابراین فیلد بعدی ما شماره 3 است ( اولی MRI دومی BITMAP و سومی ... )



Table 9. Sample authorization request
Fld #DescriptionValueComments

0

MTI

0100

Authorization request

2

Primary Account Number

4321123443211234

3

Processing Code

000000

4

Amount transaction

000000012300

e.g., 123.00

7

Transmission data/time

0304054133

MMYYHHMMSS

11

System trace audit number

001205

14

Expiration date

0205

YYMM

18

Merchant Type

5399

22

POS Entry Mode

022

Swiped Card

25

POS Condition Code

00

35

Track 2

4321123443211234=0205..

37

Retrieval Reference Number

206305000014

41

Terminal ID

29110001

42

Merchant ID

1001001

49

Currency

840












Val(&HE)=Decimal(14) .... Binary (1110)
HEX2BIN:
Dim b As string * 4
b="0000"
جاگذاری از سمت راست
14 Mod 2=0
14\2=7 > 7 Mod 2=1
7\2=3 >  3 Mod 2=1
3\2=1 > 1 Mod 2=1
در نتیجه : 0000 >>>>> 1110 

تبدیل باینری به دسیمال و بعد هگزادسیمال :
Binary(1010)

1×2^(3)+0×2^(2)+1×2^(1)+0×2^(0)=10

Hex(10)=A

Binary(1100)

1×2^(3)+1×2^(2)+0×2^(1)+0×2^(0)=12

Hex(12)=C

Binary(1111)

1×2^(3)+1×2^(2)+1×2^(1)+1×2^(0)=15

Hex(15)=F



هر عنصر داده در قالب استانداردی  توصیف می شود که محتوای  مجاز فیلد ( عددی ، باینری و ... ) و طول فیلد ( متغیر یا ثایت ) را تعریف می کند.

هر فیلد ممکن است دارای طول ثابت یا متغیر باشد.اگر متغیر باشد ، قبل از طول فیل  یک نشانگر طول قرار می گیرد.

TypeMeaning
Fixedno field length used
LLVAR or (..xx)Where 0 < LL < 100, means two leading digits LL specify the field length of field VAR
LLLVAR or (...xxx)Where 0 < LLL < 1000, means three leading digits LLL specify the field length of field VAR
LL and LLL are hex or ASCII. A VAR field can be compressed or ASCII depending on the data element type.LL can be one or two bytes. For example, if compressed as one hex byte, '27x means there are 27 VAR bytes to follow. If ASCII, the two bytes '32x, '37x mean there are 27 bytes to follow. Three-digit field length LLL uses two bytes with a leading '0' nibble if compressed, or three bytes if ASCII. The format of a VAR data element depends on the data element type. If numeric it will be compressed, e.g. 87456 will be represented by three hex bytes '087456x. If ASCII then one byte for each digit or character is used, e.g. '38x, '37x, '34x, '35x, '36x.




00000:00 5B 30 31 31 30 30 30 30 30 30 30 30 38 32 30 80 38 00 00 [.[01100000000820.8..] 
00020:00 81 00 00 04 00 00 00 00 00 00 00 33 36 32 39 31 30 31 30 [............36291010] 
00040:32 39 35 37 31 30 33 31 31 30 30 30 30 30 30 35 30 33 31 53 [2957103110000005031S] 
00060:55 32 30 31 31 31 30 33 31 31 30 32 39 35 37 32 30 31 31 31 [U2011103110295720111] 
00080:30 33 31 31 30 32 39 35 37 33 30 30 31 [0311029573001 ]

5B طول پیام هست و معادل 91 یعنی 11+16×5

1×18+3×20+13=91


بیتمپ اولیه : 

80 38 00 00 00 81 00 00 
فیلدهای 48 ، 41 ،  13 ، 12 ، 11 ، 1 موجود است و فیلد یک یعنی بیتمپ ثانویه نیز موجود است.

بیتمپ ثانویه : 

04 00 00 00 00 00 00 00 
  • فیلد 70 موجود است 

فیلد ۱۱ :   30 31 39 32 36 33   >>>362910
فیلد ۱۲ : 37 35 39 32 39 31  >>> 102957 hhmmss
فیلد ۱۳ :  31 33 30 31  >>> 1031 MMDD
فیلد ۴۱ : 35 30 30 30 30 30 30 31  >>> 10000005
فیلد ۴۸ : 031 
SU20111031102957201110311029573
به فیلد طول 3 رقمی قبل از داده های باقیمانده در این فیلد توجه کنید . که یک فیلد عمومی ( استفاده آینده / خصوصی ) است.
فیلد 70 : 001  مقدار 001 از پیام این نشانه را میدهد که MTI باید 0800 باشد 

Field DefinitionMeaning
n 6Fixed length field of six digits
n.6LVAR numeric field of up to 6 digits in length
a..11LLVAR alpha field of up to 11 characters in length
b...999LLLVAR binary field of up to 999 bytes in length


بررسی پیام ایزو زیر : 

01581200F230040102B000000000000004000000

1048468112122012340000100000001107221800

000001161204171926FABCDE123ABD06414243

000termid1210Community106A5DFGR1112341234234

0158 : طول هدر ( 4 بایت یا ارقام هدر ).نشان می دهد که طول پیام غیر از هدر 158 رقم است . بصورت دو بایت آورده شده.
از خود 1200به طول 4 تا آخرین کاراکترشمارش کنید طول 158 بدست می آید ... 44+38+40+32+4
1200 : نشاندهنده MTI است .
F23 ببعد فیلد یک دارد و نشاندهنده وجود بیتمپ ثانویه چون F را اگر به باینری تبدیل کنید میشود 1111 . از اینجا مشخص می شود که فیلد یک تا 4 موجود است و فیلد یک هم با یک بودنش نمایانگر Secondary Bitmap است.
104846811212 : فیلد دو حاوی شماره حساب اولیه  ( پیشوند هدر نمایانگر طول فیلد 2 یعنی رقم 10 است ) اگر در جدوا فیلدها مشاهده کنید در ستون وسط قید شده n.19 یعنی فیلد فقط numeric یا عددی است و تا 19 عدد را می تواند شامل شود لذا چون طول حساب کمتر از 19 شده لذا طول آن که 10 است قبل آن پیوست شده.
201234 : فیلد سوم  حاوی کد پردازش
000010000000 : فیلد چهارم حاوی  مبلغ تراکنش.اگر در جدول مشاهده کنید فیلد فقط   از نوع numeric یا عددی است با طول 12 و ننوشته تا 12 در نتیجه جای کاراکتر های خالی قبلش تا طول 12 را با صفر پر کرده.
1107221800 : فیلد 7 حاوی  تاریخ و زمان انتقال.
000001 : فیلد 11 حاوی شماره حسابرسی ردیابی سیستم
161204171926 : فیلد 12 حاوی زمان محلی تراکنش
FABCDE123ABD : فیلد 22 کد داده pos
06414243 : فیلد 32 حاوی اخذ شناسایی موسسه    ( پیشوند هدر 06 که نمایانگر طول فیلد 32 است ).طبق جدول فیلد از نوع فقط numeric یا عددی و تا طول 11 را می پذیرد چون در اینجا هدر 6 عدد است لذا طول 6 را در اول آن قرار می دهیم.
000 : فیلد 39 حاوی کد پاسخ.
termid12 : فیلد 41 حاوی شماره شناسایی ترمینال
در جدول ans 8 قید کرده یعنی شامل عدد و حرف و کاراکترهای ویژه . اگر فرضاً عنوان میشد ans .. 8 اگر طول کاراکتر کمتر از 8 میشد می بایست قبل از آن طول قید گردد.
10Community : فیلد 43 حاوی موقعیت داده ( پیشوند هدر نمایانگر طول فیل  43 یعنی رقم 10 است.)
06A5DFGR : فیلد 44 حاوی کد پاسخ اضافی ( پیشوند هدر نمایانگر طول فیلد 32 یعنی رقم 6 است.)
1112341234234 : فیلد 102 حاوی شماره حساب ... این فیل  طبق جدول طولش تا 28 کاراکتر شامل ارقام و حروف و special character است >>>> ans .. 28 که احتمال زیاد عدد 11 اولی طول هدر است .


















13 خرداد ۱۴۰۲ شرکت در جشن ولیعهد اُردُن