Today 07:42
Forum: The Lounge
Starter: charliecoultas
Views: 0
Replies: 11
Go to last post By: shantanu@india
Yesterday 13:16
Forum: The Lounge
Starter: shantanu@india
Views: 0
Replies: 16
+ Reply to Thread
Results 1 to 6 of 6

Thread: Send many digits with serial103 days old

  1. #1
    Member davidsgr's Avatar
    Join Date
    Jul 2009
    Posts
    130
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Send many digits with serial

    I wish to everybody a HAPPY NEW YEAR...!!
    I have a problem with a code and i need any help please.
    I need to control a machine with serial rs 232 and i am trying to send some many datas for callibration.
    I have use the old terminal of the machine to read the datas with hyper terminal and i can only send the first data for wake up.
    As you can see on my code i am sending 000 dec and the machine responce , but i cannot send the other many datas (callibration informations)
    for start the machine.
    If someone can help me with any ideas i will appriciate it .
    Thanks for reading ..!!!

    David

    Device = 18F46K22






    Xtal = 20


    Clear

    PORTC=$ff;
    PORTD=$ff;
    TRISD =$00
    TRISB =$00
    TRISC =$00
    All_Digital = True



    SerOut PORTB.4 ,1, 16468,[$00] 'wake up ,on hyper terminal i should send 000 , with this way the machine start responce!!!!!
    DelayMS 500 'wait to wake up the machine

    SerOut PORTB.4 ,1, 16468,[CStr RESPONCE] '??????????? send decimal data for start working
    RESPONCE:
    CData 070 047 151 239 011 011 011 011 011 011 011 011 011 011 254 119 049 108 055 055 254 063 064 111 093 034 045 229 000 063 096 050 037:_
    044 052 048 026 116 022 049 059 031 018 041 085 254 063 064 111 021 038 188 107 254 063 040 050 021 052 048 026 116 022 049 107 031



    End

  2. #2
    Member SELCUK's Avatar
    Join Date
    Sep 2006
    Posts
    187
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    364.84 MB

    0 Not allowed!

    Default Re: Send many digits with serial

    Hi,


    Your CDATA code should be:


    CDATA AS BYTE 070, 047, 151, ... etc..


    and

    ... 050 037:_ is wrong for continuous line of data. Use ... 050, 037, 044, ... etc

    Selcuk
    [url]www.sfy.com.tr[/url]

  3. #3
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    773
    Thumbs Up
    Received: 18
    Given: 12
    Total Downloaded
    387.83 MB

    0 Not allowed!

    Default Re: Send many digits with serial

    Well there's no much info to go on.

    Did you test the machine you are working with by sending commands from a pc, did it respond ok to that?

    You don't have any serial setup in the code you posted, eg setting the baud rate etc.

  4. #4
    Member davidsgr's Avatar
    Join Date
    Jul 2009
    Posts
    130
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    0

    1 Not allowed!

    Default Re: Send many digits with serial

    Quote Originally Posted by SELCUK View Post
    Hi,


    Your CDATA code should be:


    CDATA AS BYTE 070, 047, 151, ... etc..


    and

    ... 050 037:_ is wrong for continuous line of data. Use ... 050, 037, 044, ... etc

    Selcuk
    Thanks for the responce.!!
    and i should use cstr on serial out?

    Thank you again

  5. #5
    Member davidsgr's Avatar
    Join Date
    Jul 2009
    Posts
    130
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Send many digits with serial

    Hello .
    Unfortunatly i cannot solve it until now.
    I am trying to send hex digits and the datas change on the pc .
    this is my example:




    SerOut PORTB.3 , 16468,[CStr RESPONCE/21]



    End
    RESPONCE:
    CData As Byte $80,$00,$00,$00,$00,$00,$00,$80,$00,$80,$80,$00,$0 0,$00,$80,$00,$80,$00,$80,$00,$00
    End

    And on the serial terminal on the pc is:
    44 E2 67 80 60 B1 42 6B 0D 41 19 07 56 C6 60 6A 94 07 46 84 63 C2 40 A4 72 25 8A 4B F9
    I have attached a picture from the pc for more informations.

    PLEASE HEELP TERMINAL.jpg

  6. #6
    Member SimonGie's Avatar
    Join Date
    May 2009
    Posts
    226
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    75.91 MB

    0 Not allowed!

    Default Re: Send many digits with serial

    Is that gap between your zeros in the CData line just a typo, or is it in your code?
    What are your start of transmission and end of transmission bytes supposed to be?

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. How send hexa in serial?
    By jgoris in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 18th September 2011, 14:38
  2. Send 12v Serial Data to ECU
    By chrisall in forum The Lounge
    Replies: 8
    Last Post: 17th June 2008, 19:10
  3. How to send whole files over serial in Java
    By groggory in forum ALFAT
    Replies: 1
    Last Post: 12th October 2007, 09:25
  4. How to send files over Serial from ALFATxp?
    By groggory in forum The Lounge
    Replies: 0
    Last Post: 8th October 2007, 23:03

Members who have read this thread : 46

Actions :  (Set Date)

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

Tags for this Thread

Posting Permissions

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