Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:16 09 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : picaxe to vb6

Author Message
jdearman
Newbie

Joined: 27/10/2006
Location: United Kingdom
Posts: 6
Posted: 09:01pm 07 Jun 2007
Copy link to clipboard 
Print this post

hi im working with picaxes and vb6 and i need to get the picaxe to display the info coming into the serial port and show it on a screen a bit like your pic logger.
so far iv got vb6 to display the info into a textbox
but what i really want is to display it into a listbox and seperate the info into 2 or 3 different items in the list.
iv found out how to add items to the listbox, i added the word "AMP" but eery time i send it data it just makes a new item saying "amp" in the list but i dont want it to i just want the input data displayed next to the word "AMP" just like your piclogger
i hop you understand what im talking about as i have a habbit of confuseing paople
thanks in advance
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5031
Posted: 09:43pm 07 Jun 2007
Copy link to clipboard 
Print this post

Hi jdearman

What I need is a snippet of you code, and maybe a pic or screen shot of what you want.

The PicLog sends a stream of data with some well defined area's. By this I mean, it uses a format thats easy to find the bit of the datastream you want. The picaxe chips sends the following example data.

[<V>123</V><I>456</I><R>789</R><M>1<M>]

The vb6 software looks for a [ and a ] as the start and finish of a data packet. It then looks for a <V> and </V>, and what ever is between these is the volts value, some thing happens with the other bits of data in the data packet ( I, R, M ). Its all done with what we call "string manipulation"

Once you have yor bits of info you can then display it, which is where I think your getting stuck. List Boxes, like combo boxes and listviews, can be a little fiddly to use for the beginner.

Check out google, try vb6 listbox as search words.

Glenn


The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
jdearman
Newbie

Joined: 27/10/2006
Location: United Kingdom
Posts: 6
Posted: 09:56pm 07 Jun 2007
Copy link to clipboard 
Print this post

hi glenn
thank for getting back to me so quikly
i dont really have a full code that i have working at the mo,
i have a bout 6 saved projets each with bits andbobs in it,
iv managed to get data into a textbox but that isnt where i want it if i could find out how to get info into the listbox and then slit it up into "RPM" and "AMPS" then id like to plot that on a graph but thats not important at the mo.
would you mind heping me with a bit of code i would be very greatfull and id even pay for your time
thanks james
 
jdearman
Newbie

Joined: 27/10/2006
Location: United Kingdom
Posts: 6
Posted: 01:32am 08 Jun 2007
Copy link to clipboard 
Print this post

Hi sorry to bother you again glenn but i think i my have sorted it (i hope)
anyway every time i try and program th pixaxe i get an error saying illegal character: ((oxffao))
here is my picaxe code:
Start:
SYMBOL RPM = W2
SYMBOL BAR = B1

Main:
readadc10 4, BAR  "THIS LINE IS THE PROBLEM"
Count 3, 1000, RPM
sertxd("[<B>", #BAR, "</B><R>", #RPM, "</R>]")
goto main

i have also tried programming with your std code and i get the same thing
here isa copy of you code that i have
Start:
SYMBOL WSpeed = W3
SYMBOL RPM = W2
SYMBOL Amp = W1
SYMBOL Volt = W0

Main:
readadc10 4,Volt 
readadc10 1, Amp 
Count 3, 1000, RPM
Count 5, 1000, WSpeed
sertxd("[<V>", #volt, "</V><A>", #Amp, "</A><R>", #RPM, "</R><S>", WSpeed, "</S>]")
goto mainEdited by jdearman 2007-06-09
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5031
Posted: 01:42am 08 Jun 2007
Copy link to clipboard 
Print this post

I need to read my manuals, they are at home, but a couple of things worth trying.

BAR may be a reservered word, meaning you cant use it as a variable, try changing it to something else like BARA. Also you assigned B1 for BAR, but thats only a 8 bit integer, and you use that on a 10 bit value from ReadADC10. It should still work, but the results may be unpredictable.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
jdearman
Newbie

Joined: 27/10/2006
Location: United Kingdom
Posts: 6
Posted: 01:48am 08 Jun 2007
Copy link to clipboard 
Print this post

great thanks glenn i changed it to BARA and it has programed it now thanks alot i would have sat up all night trying to get that working
thanks
and i changed all your vb code about changed volt for bar and deleted the bits i didnt need and hopfuly that does what i need
thanks glenn
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024