<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=12&amp;t=10022&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-01-04T15:22:59+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=10022&amp;mode</id>
<entry>
<author><name><![CDATA[atmel]]></name></author>
<updated>2015-01-04T15:22:59+01:00</updated>
<published>2015-01-04T15:22:59+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112209#p112209</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112209#p112209"/>
<title type="html"><![CDATA[Re: Konwersja zmiennej LONG na BCD]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112209#p112209"><![CDATA[
Kod wydaje się być w porządku, a jedynym problemem jaki może zaistnieć to jedynie ta linia:<br /><br />[syntax=basic4gl]Printbin B1 ; B2 ; B3 ; B4 ; 1[/syntax]<br />A dokładniej to po czym sądzisz, że dane są błędnie przetwarzane?<br />Próbując wysłać dane w sposób binarny nie otrzymasz &quot;poprawnej&quot; (oczekiwanej) odpowiedzi np. w terminalu. Samo kodowanie BCD wymusza pewien specyficzny format zapisu, który nijak nie da się przedstawić w sposób typowy.<br /><br />W efekcie nie otrzymasz napisu &quot;123456780&quot;, a mimo wszystko konwersja mogła przebiec pomyślnie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1183">atmel</a> — 4 sty 2015, o 15:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2015-01-04T07:47:15+01:00</updated>
<published>2015-01-04T07:47:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112139#p112139</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112139#p112139"/>
<title type="html"><![CDATA[Konwersja zmiennej LONG na BCD]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10022&amp;p=112139#p112139"><![CDATA[
Witam,<br /><br />Jak można zamienić zmienną typu LONG na kod BCD , mam taki kod ale on źle dzieli liczby <br /><br />[syntax=basic4gl]Dim _freq As Long<br />Dim L As Long<br />Dim B As Byte<br />Dim B1 As Byte<br />Dim B2 As Byte<br />Dim B3 As Byte<br />Dim B4 As Byte<br /><br /><br />_freq = 123456780<br />Cls<br />Do<br />   '_freq is a long and the frequency value is in Hz<br />   'split freq into 4 bcd pairs<br />   '100/10MHZ    1MHZ/100KHz   10/1KHz    100/10Hz<br /><br />   'eg _freq= 123 456 780<br />   L = _freq / 10000000                                     'eg L = 12<br />   B = L                                                    'eg b = 12<br />   B1 = Makebcd(b)                                          'e.g. bcd for 1 and bcd for 2<br /><br />   _freq = _freq Mod 10000000                               'eg _freq = 3456780<br />   L = _freq / 100000                                       'eg L = 34<br />   B = L                                                    'eg b = 34<br />   B2 = Makebcd(b)                                          'e.g. bcd for 3 and bcd for 4<br /><br />   _freq = _freq Mod 100000                                 'eg _freq = 56780<br />   L = _freq / 1000                                         'eg L = 56<br />   B = L                                                    'eg b = 56<br />   B3 = Makebcd(b)                                          'e.g. bcd for 5 and bcd for 6<br /><br />   _freq = _freq Mod 1000                                   'eg _freq = 780<br />   L = _freq / 10                                           'eg L = 78<br />   B = L                                                    'eg b = 78<br />   B4 = Makebcd(b)                                          'e.g. bcd for 7 and bcd for 8<br /><br />   <br />   Printbin B1 ; B2 ; B3 ; B4 ; 1[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 4 sty 2015, o 07:47</p><hr />
]]></content>
</entry>
</feed>