webdesignbas.blogg.se

Excel vba serial port mscomm32 example
Excel vba serial port mscomm32 example







excel vba serial port mscomm32 example excel vba serial port mscomm32 example

' intPortID - Port ID used when port was opened. ' CommRead - Read serial port input buffer. So, I would like to Thank You up front for any time you spend on this. I am sure this is old code and am sure you have better things to do than look at it again. StrData always comes back as "" and udtCommStat.cbInQue in the procedure commRead is always 0.Īs a result I am having a great deal of dificulty reading the weight on the connected scale into my Access database.

excel vba serial port mscomm32 example

The code that IONS is talking about appears to be the same code that I am using (except that mine is VBA and his is VB) the problem is the same. I read somewhere that you are the one who originally wrote this code so I searched for your name and landed on this website. In tracing the code I have found that then function CommRead seems to not function correctly. I got this code and brought it into Access 2010 and it seems to work fine when I write to the serial ports however, when I attempt to read I get nothing. I found some VBA code that is supposed to work in Excel to make API calls to read and write to the serial ports. When I said I was having the same problem I was really refering to the second part of IONS question. Why am I not capturing data from the scale? I believe I have the parameters correct "baud=9600 parity=E data=7 stop=2". StrData is always "" and udtCommStat.cbInQue in the procedure commRead is always 0 in my case. **Note there is another locked down program (I cant' see the source code) on the machine that does capture the data from the scale. Also I am not sure what the VBP and VBW files are for.Ģ) When I run David's Code everything runs without errors but I can never read data from the scale. I just pasted that code into a module so I am not sure what the.

excel vba serial port mscomm32 example

BAS file, a VBP and a VBW file along with sample code in a txt file.ġ) My first question is what are. I am trying to use David Hitchner's very good code to read data from a scale connected to a COM port.









Excel vba serial port mscomm32 example