[SOLVED !] Serial Software vs Hardware


Closed Thread
Results 1 to 5 of 5

Thread: Serial Software vs Hardware490 days old

  1. #1
    Rox
    Guest Rox's Avatar

    0 Not allowed!

    Default Serial Software vs Hardware

    Hi, can someone have a look, I have software and hardware serial on the same for..next loop, the software serial is for debugging. The issue is on the hardware serial there's extra zeroes, i can't find where its coming from.

    The srout returns the data's: 1 5 0 1 255 0 , which is correct with length 6 bytes.
    The hrsout returns : 1 0 5 0 0 0 1 0 255 0 0 0


    Code:
    TX_Recieve:                                         ' use only for payload with ack
         spi_array[0] = R_RX_PAYLOAD                    ' Read Rx payload command
         NRF_CSN = 0
         If mbBuffer[2] = 5 Then
            nrf_ptr = bLength  
         EndIf                                  
         GoSub SPI_NRF
         NRF_CSN = 1
         RsOut "Len:",Dec bLength,13
          For i = 1 To bLength                  'Copy spi buffer to modbus buffer
               mbBuffer[i] = spi_array[i]
               HRSOut mbBuffer[i]
               RsOut Dec mbBuffer[i]," "
               
           Next 
         Return
    Thanks in advance.

    Complier Version: 3616

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,676
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    You don't say what array type mbuffer is. I suspect if you use the Dec modifier before the Hrsout you will get the same results
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Rox
    Guest Rox's Avatar

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Thanks Tim, Im using a terminal for Hrsout where i can set the Dec Modifier on the terminal itself.. will try Hrsout with Dec modifier this evening.



    Rox

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Rox
    Guest Rox's Avatar

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Tim! you are right its sending an ascii, if I put dec modifier on Hrsout they're the same result in ascii.. i will need to convert it to Integer, or else the Modbus Master (UI/HMI) will interpret the reply as error... I still dont know how, i will research, I tried the Val command but failed.

    Rox

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Rox
    Guest Rox's Avatar

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Solved!

    the extra zeroes are Null terminations, below strips the extra zeroes.

    For i = 1 To bLength
    bTemp = spi_array[i]
    HRSOut bTemp
    next

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Analogue PIR - Hardware and Software
      By rpm26 in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 27th January 2015, 09:33
    2. [SOLVED !] Difference between hardware and software USART
      By Zain in forum Serial / Ethernet
      Replies: 2
      Last Post: 14th June 2013, 16:02
    3. [SOLVED !] Hardware and Software Interrupts
      By ~ Sy ~ in forum The Lounge
      Replies: 4
      Last Post: 13th August 2009, 08:16
    4. hardware/software uart problem
      By richardy in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 22nd July 2007, 23:28
    5. [SOLVED !] SPI Software / Hardware
      By dmTulsa in forum Proton Plus Compiler v3
      Replies: 10
      Last Post: 27th October 2006, 21:50

    Members who have read this thread : 36

    Actions :  (Set Date)

    You do not have permission to view the list of names.

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts