Test and Measurement Forum

Developing in VB... ADC16

Forum for discussing PicoLog

Developing in VB... ADC16

Postby rui_santos » Mon Nov 17, 2003 11:38 am

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
rui_santos
 

Postby markspencer » Tue Nov 18, 2003 8:20 am

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,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Driver??

Postby Guest » Tue Nov 18, 2003 10:36 am

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... :(

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
Guest
 

Postby markspencer » Wed Nov 19, 2003 8:24 am

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 (<<8) for the MSB and then add the next 8 bits onto this result.
Code: Select all
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: Select all
result = (buffer(0) * 256) + buffer(1)


I hope this helps you.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am


Return to PicoLog

Who is online

Users browsing this forum: No registered users and 0 guests