Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


send the hex data


Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2007, 04:48 PM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default send the hex data

Hi to All!
How to send the Hex data over Serial ?

Thank you.
  #2 (permalink)  
Old 12-15-2007, 07:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You can send data as a string or as an array of bytes.
What type of data do you have? Can you give us a small example of it.
  #3 (permalink)  
Old 12-16-2007, 07:24 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

Quote:
Originally Posted by Erel View Post
You can send data as a string or as an array of bytes.
What type of data do you have? Can you give us a small example of it.
Erel ,
I need to send for example follow data:

1. 7E 40 25 01 00 00 8E 03 09 40 7E
2. 7E 40 25 00 00 00 8E 03 A3 11 7E

here two commands


Regards,
Alex

Last edited by alex_up : 12-16-2007 at 07:29 AM.
  #4 (permalink)  
Old 12-16-2007, 07:54 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Where does this data come from?
  #5 (permalink)  
Old 12-16-2007, 08:04 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

Quote:
Originally Posted by Erel View Post
Where does this data come from?
Erel , from simple host terminal (for win2k) for control servo drivers
  #6 (permalink)  
Old 12-16-2007, 08:24 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

I've modified the SerialTermial example to parse the data, convert it to a bytes array and send it.
bit is a Bitwise object.
The complete source code is attached.
Code:
Sub btnSend_Click
    strings() = StrSplit(textBox1.Text," ")
    Dim data(ArrayLen(strings())) As byte
    For i = 0 To ArrayLen(strings())-1
        data(i) = bit.HexToDec(strings(i))
    Next
    If serial.PortOpen = true Then serial.Output2(data())
End Sub
Attached Files
File Type: sbp a.sbp (3.1 KB, 20 views)
  #7 (permalink)  
Old 12-16-2007, 08:40 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

Quote:
Originally Posted by Erel View Post
I've modified the SerialTermial example to parse the data, convert it to a bytes array and send it.
bit is a Bitwise object.
The complete source code is attached.
Code:
Sub btnSend_Click
    strings() = StrSplit(textBox1.Text," ")
    Dim data(ArrayLen(strings())) As byte
    For i = 0 To ArrayLen(strings())-1
        data(i) = bit.HexToDec(strings(i))
    Next
    If serial.PortOpen = true Then serial.Output2(data())
End Sub


Erel its great!!!
Its work!
Thank you very very match!!!
Best regards,
Alex.
  #8 (permalink)  
Old 12-16-2007, 09:14 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

Quote:
Originally Posted by alex_up View Post
Erel its great!!!
Its work!
Thank you very very match!!!
Best regards,
Alex.
Erel ,can you create Text ini file for 20 commands ,with 20 buttons?
Its very hard?

I am sorry for my stupid questions but its necessary for me (i beginning user)

Regards.
  #9 (permalink)  
Old 12-16-2007, 09:29 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

See the Text Files tutorial: Text Files
It will help you with the ini file.
  #10 (permalink)  
Old 12-17-2007, 09:48 PM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

Erel,
Why compilled Device.exe not run on my PPC (Error loading programm .....\Serial2.dll)?
It's work only under Basic4ppc ,from source code.

Operation system WM2003SE, .NET CF 2.0 and Bitwise.dll,Serial2.dll installed.

Regards.
Closed Thread



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
send sms and store Roadrunner Questions & Help Needed 3 10-24-2008 08:47 AM
how to send sms thaidelphi Questions & Help Needed 1 08-11-2008 05:54 AM
Send data to serial port for other application schimanski Questions & Help Needed 6 04-08-2008 06:45 PM
QuickSMS - Define your own custom speed send messages and send them quickly! Oran Share Your Creations 2 02-17-2008 07:30 AM
Use Basic4ppc to send serial data from a PDA to a BlueSMiRF Bluetooth module. pdablue Share Your Creations 3 11-19-2007 10:58 PM


All times are GMT. The time now is 04:53 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0