Developing in VB... ADC16

 
Post new topic   Reply to topic    Pico Technology Forum Index -> PicoLog
Author Message
rui_santos
Guest





PostPosted: Mon Nov 17, 2003 11:38 am    Post subject: Developing in VB... ADC16 Reply with quote

I’m writing a program in Visual Basic, and I’m with some problems with the protocol communications…

I’ll have done like the ADC16 manual, but when I receive the data (MSComm.input) I can’t decode the Binary data!

Can enyone help me?

Best Regards,
Rui Santos
Back to top
markspencer
Site Admin
Site Admin


Joined: 07 May 2003
Posts: 610

PostPosted: Tue Nov 18, 2003 8:20 am    Post subject: Reply with quote

Hi,

All the details that you need about the protocol communication can be found in the help manual.

If you are using any of our driver functions and believe that they are not performing as expected please let me know.

We do not provide other examples appart from those already available on our website.

Best regards,
Back to top
Guest






PostPosted: Tue Nov 18, 2003 10:36 am    Post subject: Driver?? Reply with quote

Hello Again..

I'm using your manual to try to commect to the ADC16..
I can connect and i can send and request data.. my problem is onthe received data from the ADC16..
In the manual is writed that ADC16 will send 3bytes, the first is the sign, and the second is the MSB result (bynary) and the thrid is the LSB result (binay). I need help in that 3bytes.. because i get them but i can't convert them... Sad

But you are saying that i can "call" functions of your driver?? From VB? I can i do that? Can youhelp me? Maybe is better like that...

Best Regards,
Rui Santos
Back to top
markspencer
Site Admin
Site Admin


Joined: 07 May 2003
Posts: 610

PostPosted: Wed Nov 19, 2003 8:24 am    Post subject: Reply with quote

Hi,

We provide simple example in VB and VBA, the syntax for both are almost identical and you can view either of these to get an understanding of how to setup the calls and in what order the calls are made.

To conver the three bytes, the first byte is the sign.

To convert the two bytes to a 16 bit integer, in C you would use the left shift by 8 bits (<<Cool for the MSB and then add the next 8 bits onto this result.
Code:

result = (buffer[0] << 8) + buffer[1];


unfortunately, I do not know if VB has something similiar, if it does not then you will have to manipulate the result in this manner:

Code:

result = (buffer(0) * 256) + buffer(1)


I hope this helps you.

Best regards,
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> PicoLog
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group