ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send data to serial port (https://www.excelbanter.com/excel-programming/442687-send-data-serial-port.html)

Andrew P.

Send data to serial port
 
Hi All

I want to be able to send small bits of HEX data to the serial port from
Excel. I dont have any VB program other than the standard editor in Excel,
Acces etc.

I have read some posts that refer to MSCOMM32, but from what I understand,
it is for use by people with a full VB program. Is there any way to do it?

Thanks a lot
Andrew

EricG

Send data to serial port
 
Here are a few examples I found through Google:

http://www.pencomdesign.com/support/...re_example.htm

http://dev.emcelettronica.com/serial...tion-excel-vba

http://www.activexperts.com/activcomport/howto/vba/

http://stackoverflow.com/questions/5...-port-from-vba

HTH,

Eric


"Andrew P." wrote:

Hi All

I want to be able to send small bits of HEX data to the serial port from
Excel. I dont have any VB program other than the standard editor in Excel,
Acces etc.

I have read some posts that refer to MSCOMM32, but from what I understand,
it is for use by people with a full VB program. Is there any way to do it?

Thanks a lot
Andrew


Andrew P.

Send data to serial port
 
Thanks Eric

Im using the code in http://www.thescarms.com/vbasic/commio.aspx and I can
see that I have activity on the port now. The commands are not being
recognised by the connected equipment though. The equipment expects a HEX
string, I have the HEX data (which works if I send via another program) but
Im not sure how I should present it in this code. For example, one command is:

0E0E00000505000C20450164A5A5

The data is made up of groups of 2 HEX digits, so the first is OE, second is
OE, third is 00 etc

I tried using:
strData = "0E0E00000505000C20450164A5A5"

I tried also doing it as decimal:
strData = "014014000000005005000012032069001100165165"

and:
strData = "014" & "014" & "000" & "000" & "005" & "005" & "000" & "012" &
"032" & "069" & "001" & "100" & "165" & "165"

and also as:
strData = "0E" & "0E" & "00" & "00" & "05" & "05" & "00" & "0C" & "20" &
"45" & "01" & "64" & "A5" & "A5"

and a bunch of other ways of representing it, but always no good. Any help
would be greatly appreciated!

Thanks again

Andrew




"EricG" wrote:

Here are a few examples I found through Google:

http://www.pencomdesign.com/support/...re_example.htm

http://dev.emcelettronica.com/serial...tion-excel-vba

http://www.activexperts.com/activcomport/howto/vba/

http://stackoverflow.com/questions/5...-port-from-vba

HTH,

Eric


"Andrew P." wrote:

Hi All

I want to be able to send small bits of HEX data to the serial port from
Excel. I dont have any VB program other than the standard editor in Excel,
Acces etc.

I have read some posts that refer to MSCOMM32, but from what I understand,
it is for use by people with a full VB program. Is there any way to do it?

Thanks a lot
Andrew


EricG

Send data to serial port
 
Unfortunately it's been at least 20 years since I've had to deal with issues
like this, and my memory is fading fast! I do remember that there were
escape codes I had to send to whatever box or board I was working with to get
its attention before I sent it any commands or grabbed any data.

Sorry I can't be more helpful. Good luck in figuring it out.

Eric

"Andrew P." wrote:

Thanks Eric

Im using the code in http://www.thescarms.com/vbasic/commio.aspx and I can
see that I have activity on the port now. The commands are not being
recognised by the connected equipment though. The equipment expects a HEX
string, I have the HEX data (which works if I send via another program) but
Im not sure how I should present it in this code. For example, one command is:

0E0E00000505000C20450164A5A5

The data is made up of groups of 2 HEX digits, so the first is OE, second is
OE, third is 00 etc

I tried using:
strData = "0E0E00000505000C20450164A5A5"

I tried also doing it as decimal:
strData = "014014000000005005000012032069001100165165"

and:
strData = "014" & "014" & "000" & "000" & "005" & "005" & "000" & "012" &
"032" & "069" & "001" & "100" & "165" & "165"

and also as:
strData = "0E" & "0E" & "00" & "00" & "05" & "05" & "00" & "0C" & "20" &
"45" & "01" & "64" & "A5" & "A5"

and a bunch of other ways of representing it, but always no good. Any help
would be greatly appreciated!

Thanks again

Andrew




"EricG" wrote:

Here are a few examples I found through Google:

http://www.pencomdesign.com/support/...re_example.htm

http://dev.emcelettronica.com/serial...tion-excel-vba

http://www.activexperts.com/activcomport/howto/vba/

http://stackoverflow.com/questions/5...-port-from-vba

HTH,

Eric


"Andrew P." wrote:

Hi All

I want to be able to send small bits of HEX data to the serial port from
Excel. I dont have any VB program other than the standard editor in Excel,
Acces etc.

I have read some posts that refer to MSCOMM32, but from what I understand,
it is for use by people with a full VB program. Is there any way to do it?

Thanks a lot
Andrew



All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com