Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

send the hex data

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2007, 03: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, 06:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,731
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 06: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 06:29 AM.
  #4 (permalink)  
Old 12-16-2007, 06:54 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,731
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Where does this data come from?
  #5 (permalink)  
Old 12-16-2007, 07: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, 07:24 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,731
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 36 views)
  #7 (permalink)  
Old 12-16-2007, 07: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, 08: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, 08:29 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,731
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

See the Text Files tutorial: http://www.basic4ppc.com/forum/tutorials/943-text-files.html
It will help you with the ini file.
  #10 (permalink)  
Old 12-17-2007, 08: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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 06:08 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0