How to pass from CRC Kermit to CRC Xmodem

Hi, I am trying to créate a CRC Xmodem calculator. I write a number, and the program is supposed to generate the CRC Xmodem 4 character code of that number.
So far, I managed to calculate the CRC Kermit and the CRC-16, but I am not able to find how to calculate the CRC Xmodem number. Thanks in advance for the help.
string input_number;
int input_number_length;
string stringArray = "";
string[] str_parsed = new string[4096];
int[] input_bytes = new int[4096];
int stringStart = 0;
int initial_crc = 0x0000;
int initial_Coefficient = 0x8408;
int lessSignificantB, crcByteA, crcByteB;
input_number = textoTrama.Text;
if (input_number.Length % 2 != 0)
input_number = input_number + " ";
input_number_length = input_number.Length/2;
//************* Divide the string *************
for (int k = 0; k<input_number_length; k++)
stringArray = input_number.Substring(stringStart, 2);
str_parsed[k] = stringArray;
stringStart = stringStart + 2;
//******* Conversion from hex string to int *******
for (int i = 0; i < input_number_length; i++)
input_bytes[i] = Int32.Parse(str_parsed[i], NumberStyles.HexNumber); //Pasa el array Hex a array Int
//***************** Algorithm ******************
for (int i = 0; i < input_number_length; i++)
initial_crc = initial_crc ^ input_bytes[i];
for (int j = 0; j < 8; j++)
lessSignificantB = initial_crc & 0x0001; // Mask of LSB
initial_crc = initial_crc >> 1;
initial_crc = initial_crc & 0x7FFF;
if (lessSignificantB == 1)
initial_crc = initial_crc ^ initial_Coefficient;
crcByteA = initial_crc & 0x00FF;
crcByteB = (initial_crc >> 8) & 0x00FF;
miCRC.Text = crcByteA.ToString("X") + crcByteB.ToString("X");

Hi Manolo_007,
Thank you for posting in the MSDN forum.
Thank you for posting in the MSDN forum. It seems that it is not the correct forum for this issue, since
this forum is to discuss Visual Studio IDE. I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
Maybe the language developing forum would be better for you.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral%2Ccsharpgeneral%2Cvcgeneral&filter=alltypes&sort=lastpostdesc
Sincerely,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to pass from a document pdf towards another

    Hello,
    I have two open documents.
    In javascript, how to pass from a document pdf towards another.
    David G

    You need to mark each document as "disclosed", in order for them to talk to each other. See the Acrobat JavaScript docs on "this.disclosed".
    Leonard

  • How to pass from method to arguments to main and get the day of the week

    Hi
    Need some help, this code below doesnt fit the requirement.
    For this program, i need to: take in day, month,year of a date as int argument, return the day of the week for the date entered in App()
    In Main: call the App() to get the day of the week to display when user enter the date in dd/mm/yyyy
    StringTokenizer is required for this program.
    - How can the arguments pass back to main by returning of month & day of the week?
    - Program cant take in int and return as string
    - Date cant display day of the week
    Code
    import java.util.*;
    public class App2 {
        private int day;
        private int month;
        private int year;
             private int inputDay;
                private int inputMonth;
                private int inputYear;
        public static String App2(String day2, String month2, String year2) { // this is wrong should pass int in
              String date = day2 + month2 + year2;
             DateFormat df = new SimpleDateFormat("dd/MM/yyyy");  
              try
              Date today = df.parse(date);               
              System.out.println("Today = " + df.format(today));
              catch(ParseException e)
              if(month2.equals("01") || month2.equals("1")){month2 = "January";}              
              else if(month2.equals("02") || month2.equals("2")){month2 = "February";}              
              else if(month2.equals("03") || month2.equals("3")){month2 = "March";}              
              else if(month2.equals("04") || month2.equals("4")){month2 = "April";}              
              else if(month2.equals("05") || month2.equals("5")){month2 = "May";}              
              else if(month2.equals("06") || month2.equals("6")){month2 = "June";}              
              else if(month2.equals("07") || month2.equals("7")){month2 = "July";}              
              else if(month2.equals("08") || month2.equals("8")){month2 = "August";}              
              else if(month2.equals("09") || month2.equals("9")){month2 = "September";}              
              else if(month2.equals("10")){month2 = "October";}              
              else if(month2.equals("11")){month2 = "November";}              
              else if(month2.equals("12")){month2 = "December";}
              return month2;
        public static void main (String [ ] args){
             Scanner sc = new Scanner(System.in);
                System.out.print("Enter the date in dd/mm/yyyy: ");
                String date = sc.nextLine();
                StringTokenizer st = new StringTokenizer(date, "/");
                String day = st.nextToken();
                String month = st.nextToken();
                String year = st.nextToken();
                App2(day, month, year);
                String test = App2(day, month, year);
                     System.out.print(test);
    }Program output: 29 Aug 2010 is a Sunday

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

  • Snippets, Sites - how to pass from CS4 to CS5

    I saved my Snippets from CS4.
    How do I get them inside CS5? Where is the file where I should put them? Please provide the complete path for Windows 7.
    Thanks

    C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS5\configuration\Snippets

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • How to pass multiple values from workbook to planning function ?

    Hi,
    I have created Planning function in Modeler and it has one parameter(Variable represents = Multiple single values).
    When executing the planning function by create planning seq. in the web template : I see value of variable store data like ...
        A.) input one value -> V1
        B.) input three values -> V1;V2;V3
    This function execute completely in web.
    However, I want to use the planning function in workbook(Excel).
    The value of variable can't input V1;V2;V3... I don't know how to pass multiple values from workbook to parameter(Multiple single values type) in planning function ?
    thank you.

    Hi,
    Please see the attached how to document (page no 16).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be">how to</a>
    Hope this was helpful
    thanks

  • How to pass a value from the report to a form ( BIT OF URGENT ).

    Hi,
    I had created a "Form on a Table with Report" on the report I had remove the edit link and set one of the column feilds that functionality. Now I want to know how to pass that value that is clicked ( having hyper link ) on to the form where it runs a SQL query and then displays the reuslts on the form.
    Illustrating with an example.
    I am having these following columns on the report ( these are the results for the join statement )
    JOBNUM JOBNAME DEPTNUMBER SAL EMPNO LNAME FNAME
    In the above JOBNUM is having Hyper link as I removed the edit image.
    Now this is area I am having problem. When the user clicked on the JOBNUM then on form it should display 20 other columns( pulled from 5 other tables ) which are related to that particualr JOBNUM.
    Anybody give me a solution in which area I have to include my SQL statement and how to pass that selected value to that SQL statement.
    Cheers,
    Krishna

    Hi Ron,
    I am doing exaclty what you have suggested me but no luck. I started changing the DEMO_CUSTOMERS application to my requirements.The report is working fine and on the report I have created a page attribute to the Hyper linked column and linked that to the page 2 and assign that attribute with #JOBNUM#.
    I am able to pass that value on to form when I click on the JOBNUM. But the problem is I am not able to pass that value into the SQL query so that my query pulls 20+ columns on to the Form ( which is second page ).
    Small clarification... On the form region it is said FORM NAME and type is HTML is that is the way the APEX was designed or does it need to say region type as FORM.
    Thanks for your help in advance.
    Cheers,
    Krishna.

  • How to pass a single element in an array to XSL from BPEL

    In a bpel (2.0) process I have a for-each loop iterating through a list in the original input document.  Within that loop I need to construct an  input document  for a call to a web service based on data in the current node of the list objects I am looping through.
    Constructing the input document via BPEL assign activity copies within the for-each loop is an option but due to the complexity of that document I would prefer to use XSL.  But I don't know how to pass the index information (ie. the for-each counter) into XSL and use it there (and I would prefer not to have to do so, since that will prevent use of the XSL GUI in jdev), so I would prefer to send  the current node of the list as input to XSL instead.
    Is it possible to pass a sub-section of an XML document (e.g. one node in the array) as input into XSL rather than the whole document?  In other words, I would like to send the current array element from the original input document rather than the entire original input document because I will be using the data within that array element to create the web service input document.
    Example:
    <forEach parallel="no" counterName="i"
                         name="ForEachEntry">
                  <startCounterValue>1</startCounterValue>
                  <finalCounterValue>$numTimeEntries</finalCounterValue>
    If I used the BPEL assign activity to populate the input document I would need lots of copies similar to this:
                  <copy>
                      <from>$inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]/ns3:origtransactionreference</from>
                      <to>$InvokeOteDetailAbsenceErrorStatusService_OteAbsenceDetailFailureService_InputVariable.OteAbsenceDetailFailureServiceInput_msg/ns19:OrigTransactionReference</to>
                  </copy>
    I would prefer to send the current list object as an input variable into an XSL transform: 
         $inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]
    Is there syntax in bpel that would do that?
    Thanks

    You need use While Element and use Array like Element[number]
    With While element you iterate <employee> node
    and with Element[number] you can extract information from that node.
    I wrote a BPEL that scan a XML file, the input is:
    <cliente>
            <codigo>01</codigo>
            <nombre>Deiby Mauricio Gomez</nombre>
                    <productos>
                            <producto>
                                    <nombre>Camisa Polo</nombre>
                                    <precio>50</precio>
                            </producto>
                            <producto>
                                    <nombre>Pantalon Lona</nombre>
                                    <precio>100</precio>
                            </producto>
                    </productos>
            </cliente>
            <cliente>
            <codigo>02</codigo>
            <nombre>Julio Cesar Ayapan</nombre>
                    <productos>
                            <producto>
                                    <nombre>Camisa Polo</nombre>
                                    <precio>50</precio>
                            </producto>
                    </productos>
            </cliente>
    In my BPEL I added up all article prices and after that I write to txt file the client and the Total.
    Example:
    Deiby Gomez, 150
    Cesar Ayapan, 50
    My while element is this (Please pay attention in bold words):
      <while name="While1"
               condition="bpws:getVariableData('variable1')&lt;=count(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente'))">
          <sequence>
            <assign name="Assign1">
              <copy>
                <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:cantidad"/>
              </copy>
              <copy>
                <from variable="Receive1_input_files" part="body"
                      query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:id"/>
              </copy>
            </assign>
            <invoke name="Invoke1" inputVariable="Invoke1_process_InputVariable"
                    outputVariable="Invoke1_process_OutputVariable"
                    partnerLink="ValidacionBancos2WS" portType="ns5:BPELProcess1"
                    operation="process" bpelx:invokeAsDetail="no"/>
            <switch name="Switch1">
              <case condition="bpws:getVariableData('Invoke1_process_OutputVariable','payload','/ns5:processResponse/ns5:resultado')='true'">
                <bpelx:annotation>
                  <bpelx:pattern>Si el cliente es aprobado</bpelx:pattern>
                  <bpelx:general>
                    <bpelx:property name="userLabel">Si Aprobado</bpelx:property>
                  </bpelx:general>
                </bpelx:annotation>
                <sequence>
                  <assign name="Assign4">
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:id"/>
                    </copy>
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:nombre"/>
                    </copy>
                    <copy>
                      <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:total"/>
                    </copy>
                  </assign>
                  <invoke name="Invoke2" inputVariable="Approved_Write_input"
                          partnerLink="fileAdapterWriteApproved"
                          portType="ns6:Write_ptt" operation="Write"
                          bpelx:invokeAsDetail="no"/>
                </sequence>
              </case>
              <otherwise>
                <sequence name="Sequence1">
                  <assign name="Assign5">
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:id"/>
                    </copy>
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:nombre"/>
                    </copy>
                    <copy>
                      <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:total"/>
                    </copy>
                  </assign>
                  <invoke name="Invoke3"
                          inputVariable="Rechazados_Write_input"
                          partnerLink="fileAdapterWriteRechazados"
                          portType="ns8:Write_ptt" operation="Write"
                          bpelx:invokeAsDetail="no"/>
                </sequence>
              </otherwise>
            </switch>
            <assign name="Assign2">
              <copy>
                <from expression="''"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:id"/>
              </copy>
              <copy>
                <from expression="bpws:getVariableData('variable1')+1"/>
                <to variable="variable1"/>
              </copy>
              <copy>
                <from expression="''"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:cantidad"/>
              </copy>
            </assign>
          </sequence>
        </while>

  • Regarding how to pass the data from web dynpro to workflow

    hi gurus,
    how to pass the data from web dynpro to workflow.
    Regards
    vijay

    Check this [thread|SAP_WAPI_START_WORKFLOW;

  • How to pass the data from a pop up window to the parent window

    Hi All,
    I have a jsp page which contains a add button, while clicking it a popup will come out(which is a another jsp page). There are some input fieldsand a submit button. Now how could I send the data from the pop up to the parent winow. Also I have to check that if the pop up is open and I click add button then another pop up must not open.
    Plz reply its urgent
    Thanks and Regards
    Rajib Sharma

    Thanks for the reply
    But it not worked
    I have a jsp page and the popup is also a jsp page the data that is passed from the popup window to the parent must be send to the server from the parent window to get a data from the data base as search result. Its of no use to get it as js data
    Thanks and regards
    Rajib Sharma

  • How to pass the data from web dynpro to workflow.

    hi gurus,
    how to pass the data from web dynpro to workflow.
    Regards
    vijay

    Hi
    you can use function module
    data   ls_input_container  TYPE swr_cont.
    data   lt_input_container  TYPE TABLE OF  swr_cont.
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
        EXPORTING
          task            = ptask
        IMPORTING
          return_code     = lv_return_code
          new_status      = lv_new_status
        TABLES
          input_container = pinput_container
          message_lines   = lt_message_lines
          message_struct  = lt_message_struct.
    where you pass the data in imnternal table "pinput_container" as
      ls_input_container-element = 'KUNNR'.
      ls_input_container-value = ls_skna1-kunnr ."wd_this->lv_kunnr.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'CLUSER'.
      ls_input_container-value = lv_cluser.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'BUKRS'.
      ls_input_container-value = lv_bukrs. " youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'VKORG'.
      ls_input_container-value = ls_sknvv-vkorg. " youe value as per requirement
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'VTWEG'.
      ls_input_container-value = ls_sknvv-vtweg. "youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'SPART'.
      ls_input_container-value = ls_sknvv-spart. "youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
    *Also Forgot to mention where ptask is your workflow ID *
    Regards,
    Arvind
    Edited by: Arvind Patel on May 14, 2010 7:38 AM

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • How to pass the data from wa_itab to  fieldcatlog?

    how to pass the data from wa_itab to  fieldcatlog?

    Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related.  There are several other more general ABAP related forums.

  • ADF : How to pass a variable from one frame to another frame ?

    Hi,
    I have an html page divided into 3 frames, all inside a frameset. Each frame are linked to a specific .jsf page (src attribute). When I list a list thanks to a ADF datatable in ONE frame, each row has a "show more" button. When I click this button I succeeded to print row detail inside the same frame thanks to the processScope ADF's native variable. The problem is that I want to display the row detail in another frame, clicking from this current frame. So for this I need to reload the other frame which display the content of the processScope variable.
    For this I use the javascript code :
    => parent.frames['bottomRight'].location.reload()
    Just before refreshing, I put the variable in the processScope of course like it appears in the backing bean :
    FacesContext context = FacesContext.getCurrentInstance();
              CLPRMBuilding building = (CLPRMBuilding)
         context.getApplication().getVariableResolver().resolveVariable(context, "building");
         if (building == null)
         return "error";
         AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
         afContext.getProcessScope().put("buildingDetail", building);
    Next, when the user click on the button "show more" a binding CoreCommandButton component is done. And the accessor's code is executed :
    public void setShowMoreCommandButton(CoreCommandButton showMoreCommandButton) {
              this.showMoreCommandButton = showMoreCommandButton;
              showMoreCommandButton.setOnclick("parent.frames['bottomRight'].location.reload()");
    And so the other frame is reloaded ! But the "buildingDetail" variable seems not to be present in the processScope because in the jsf page displayed by the other frame no content is printed, like if the variable were not initialized. How to do then ? How to pass the buildingDetail variable to the other frame which I need to reload to refresh it's content ?

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • How to pass a Variable value into an ODI Scenario from ODI Package

    I have created an Interface that uses the variable #ENTITY_ID for retrieving entity data from the DWH; now I have generated a Scenario from the interface and placed the Scenario in an ODI Package; am not sure how to pass the #ENTITY_ID variable to the ODI Scenario?
    Any help is greately appreciated.
    Best Regards
    Bee

    Hi Sutrtha,
    Yeah I got the pop up asking to select the variables used, I have selected ENTITY_ID that was used by the interfaces, but on execution of the package the Scenario did not work as the passeed variable #ENTITY_ID is set to 0 instead of the value I am passing.
    Am I missing something?
    Regards
    B

Maybe you are looking for

  • ALV + layout varient on selection screen

    hiii with ALV list i want to know with how to allow to put the layout on the selection screen and when user press F4 he will be able to use the list of layout he has save on the ALV output Note for the layout button to appear i had to activate shown

  • Icloud inop since update to 3.0

    Since icloud control panel updated to 3.0 & iTunes to 11.1.0.126, neither icloud control panel nor iTunes store works. iCloud control panel locks up and never connects to the server to download information although my apple id shows correctly.  Task

  • Installing elements 12 on desktop when it is already installed on laptop.

    I was told when I purchased Elements 12 that I could install it on a laptop (I did) and on a desktop but could not use both at the same time (not a problem).  So how do I do this? I can find downloading instructions for a trial but not the program th

  • My iPhone backup is gone!!

    Hi, I ran in to some problems with my iPhone as it was restarting a lot randomly by itself. So I thought I would restore it. I backed it up with itunes first, restored it, but when I wanted to restore from back up it says that the phone has not been

  • Best hardware/OS for Photoshop CS5

    Hi there, i want to build a new PC, optimized for Photoshop CS5, with Windows OS. Can anybody tell me the optimal hardware configuration to make Photoshop as fast as possible? The program is primarly used for poster design. how much ram makes sense?